vega_lite/
vegalite.rs

1// Example code that deserializes and serializes the model.
2// extern crate serde;
3// #[macro_use]
4// extern crate serde_derive;
5// extern crate serde_json;
6//
7// use generated_module::[object Object];
8//
9// fn main() {
10//     let json = r#"{"answer": 42}"#;
11//     let model: [object Object] = serde_json::from_str(&json).unwrap();
12// }
13
14extern crate serde_json;
15use std::collections::HashMap;
16
17#[derive(Debug, Serialize, Deserialize)]
18pub struct Vegalite {
19    /// URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
20    /// have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
21    /// Setting the `$schema` property allows automatic validation and autocomplete in editors
22    /// that support JSON schema.
23    #[serde(rename = "$schema")]
24    pub schema: Option<String>,
25    /// Sets how the visualization size should be determined. If a string, should be one of
26    /// `"pad"`, `"fit"` or `"none"`.
27    /// Object values can additionally specify parameters for content sizing and automatic
28    /// resizing.
29    /// `"fit"` is only supported for single and layered views that don't use `rangeStep`.
30    ///
31    /// __Default value__: `pad`
32    pub autosize: Option<Autosize>,
33    /// CSS color property to use as the background of visualization.
34    ///
35    /// __Default value:__ none (transparent)
36    pub background: Option<String>,
37    /// Vega-Lite configuration object.  This property can only be defined at the top-level of a
38    /// specification.
39    pub config: Option<Config>,
40    /// An object describing the data source
41    pub data: Option<Data>,
42    /// A global data store for named datasets. This is a mapping from names to inline datasets.
43    /// This can be an array of objects or primitive values or a string. Arrays of primitive
44    /// values are ingested as objects with a `data` property.
45    pub datasets: Option<HashMap<String, InlineDatasetValue>>,
46    /// Description of this mark for commenting purpose.
47    pub description: Option<String>,
48    /// A key-value mapping between encoding channels and definition of fields.
49    ///
50    /// A shared key-value mapping between encoding channels and definition of fields in the
51    /// underlying layers.
52    pub encoding: Option<Encoding>,
53    /// The height of a visualization.
54    ///
55    /// __Default value:__
56    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
57    /// is `"fit"` or its y-channel has a [continuous
58    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be
59    /// the value of
60    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
61    /// - For y-axis with a band or point scale: if
62    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
63    /// or unspecified, the height is [determined by the range step, paddings, and the
64    /// cardinality of the field mapped to
65    /// y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the
66    /// `rangeStep` is `null`, the height will be the value of
67    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
68    /// - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
69    ///
70    /// __Note__: For plots with [`row` and `column`
71    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
72    /// height of a single view.
73    ///
74    /// __See also:__ The documentation for [width and
75    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
76    pub height: Option<f64>,
77    /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
78    /// `"line"`,
79    /// `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
80    /// object](https://vega.github.io/vega-lite/docs/mark.html#mark-def).
81    pub mark: Option<AnyMark>,
82    /// Name of the visualization for later reference.
83    pub name: Option<String>,
84    /// The default visualization padding, in pixels, from the edge of the visualization canvas
85    /// to the data rectangle.  If a number, specifies padding for all sides.
86    /// If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
87    /// "bottom": 5}` to specify padding for each side of the visualization.
88    ///
89    /// __Default value__: `5`
90    pub padding: Option<Padding>,
91    /// An object defining properties of geographic projection, which will be applied to `shape`
92    /// path for `"geoshape"` marks
93    /// and to `latitude` and `"longitude"` channels for other marks.
94    ///
95    /// An object defining properties of the geographic projection shared by underlying layers.
96    pub projection: Option<Projection>,
97    /// A key-value mapping between selection names and definitions.
98    pub selection: Option<HashMap<String, SelectionDef>>,
99    /// Title for the plot.
100    pub title: Option<Title>,
101    /// An array of data transformations such as filter and new field calculation.
102    pub transform: Option<Vec<Transform>>,
103    /// The width of a visualization.
104    ///
105    /// __Default value:__ This will be determined by the following rules:
106    ///
107    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
108    /// is `"fit"` or its x-channel has a [continuous
109    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be
110    /// the value of
111    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
112    /// - For x-axis with a band or point scale: if
113    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
114    /// or unspecified, the width is [determined by the range step, paddings, and the cardinality
115    /// of the field mapped to
116    /// x-channel](https://vega.github.io/vega-lite/docs/scale.html#band).   Otherwise, if the
117    /// `rangeStep` is `null`, the width will be the value of
118    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
119    /// - If no field is mapped to `x` channel, the `width` will be the value of
120    /// [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height)
121    /// for `text` mark and the value of `rangeStep` for other marks.
122    ///
123    /// __Note:__ For plots with [`row` and `column`
124    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
125    /// width of a single view.
126    ///
127    /// __See also:__ The documentation for [width and
128    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
129    pub width: Option<f64>,
130    /// The alignment to apply to grid rows and columns.
131    /// The supported string values are `"all"`, `"each"`, and `"none"`.
132    ///
133    /// - For `"none"`, a flow layout will be used, in which adjacent subviews are simply placed
134    /// one after the other.
135    /// - For `"each"`, subviews will be aligned into a clean grid structure, but each row or
136    /// column may be of variable size.
137    /// - For `"all"`, subviews will be aligned and each row or column will be sized identically
138    /// based on the maximum observed size. String values for this property will be applied to
139    /// both grid rows and columns.
140    ///
141    /// Alternatively, an object value of the form `{"row": string, "column": string}` can be
142    /// used to supply different alignments for rows and columns.
143    ///
144    /// __Default value:__ `"all"`.
145    pub align: Option<Align>,
146    /// The bounds calculation method to use for determining the extent of a sub-plot. One of
147    /// `full` (the default) or `flush`.
148    ///
149    /// - If set to `full`, the entire calculated bounds (including axes, title, and legend) will
150    /// be used.
151    /// - If set to `flush`, only the specified width and height values for the sub-view will be
152    /// used. The `flush` setting can be useful when attempting to place sub-plots without axes
153    /// or legends into a uniform grid structure.
154    ///
155    /// __Default value:__ `"full"`
156    pub bounds: Option<Bounds>,
157    /// Boolean flag indicating if subviews should be centered relative to their respective rows
158    /// or columns.
159    ///
160    /// An object value of the form `{"row": boolean, "column": boolean}` can be used to supply
161    /// different centering values for rows and columns.
162    ///
163    /// __Default value:__ `false`
164    ///
165    /// Boolean flag indicating if subviews should be centered relative to their respective rows
166    /// or columns.
167    ///
168    /// __Default value:__ `false`
169    pub center: Option<Center>,
170    /// An object that describes mappings between `row` and `column` channels and their field
171    /// definitions.
172    pub facet: Option<FacetMapping>,
173    /// Scale, axis, and legend resolutions for facets.
174    ///
175    /// Scale, axis, and legend resolutions for layers.
176    ///
177    /// Scale and legend resolutions for repeated charts.
178    ///
179    /// Scale, axis, and legend resolutions for vertically concatenated charts.
180    ///
181    /// Scale, axis, and legend resolutions for horizontally concatenated charts.
182    pub resolve: Option<Resolve>,
183    /// The spacing in pixels between sub-views of the composition operator.
184    /// An object of the form `{"row": number, "column": number}` can be used to set
185    /// different spacing values for rows and columns.
186    ///
187    /// __Default value__: `10`
188    ///
189    /// The spacing in pixels between sub-views of the concat operator.
190    ///
191    /// __Default value__: `10`
192    pub spacing: Option<Spacing>,
193    /// A specification of the view that gets faceted.
194    pub spec: Box<Option<SpecClass>>,
195    /// Layer or single view specifications to be layered.
196    ///
197    /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
198    /// layering facet specifications is not allowed.
199    pub layer: Option<Vec<LayerSpec>>,
200    /// An object that describes what fields should be repeated into views that are laid out as a
201    /// `row` or `column`.
202    pub repeat: Option<Repeat>,
203    /// A list of views that should be concatenated and put into a column.
204    pub vconcat: Option<Vec<Spec>>,
205    /// A list of views that should be concatenated and put into a row.
206    pub hconcat: Option<Vec<Spec>>,
207}
208
209#[derive(Debug, Serialize, Deserialize)]
210pub struct RowColVgLayoutAlign {
211    pub column: Option<VgLayoutAlign>,
212    pub row: Option<VgLayoutAlign>,
213}
214
215#[derive(Debug, Serialize, Deserialize)]
216pub struct AutoSizeParams {
217    /// Determines how size calculation should be performed, one of `"content"` or `"padding"`.
218    /// The default setting (`"content"`) interprets the width and height settings as the data
219    /// rectangle (plotting) dimensions, to which padding is then added. In contrast, the
220    /// `"padding"` setting includes the padding within the view size calculations, such that the
221    /// width and height settings indicate the **total** intended size of the view.
222    ///
223    /// __Default value__: `"content"`
224    pub contains: Option<Contains>,
225    /// A boolean flag indicating if autosize layout should be re-calculated on every view
226    /// update.
227    ///
228    /// __Default value__: `false`
229    pub resize: Option<bool>,
230    /// The sizing format type. One of `"pad"`, `"fit"` or `"none"`. See the [autosize
231    /// type](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for
232    /// descriptions of each.
233    ///
234    /// __Default value__: `"pad"`
235    #[serde(rename = "type")]
236    pub auto_size_params_type: Option<AutosizeType>,
237}
238
239#[derive(Debug, Serialize, Deserialize)]
240pub struct RowColBoolean {
241    pub column: Option<bool>,
242    pub row: Option<bool>,
243}
244
245/// Vega-Lite configuration object.  This property can only be defined at the top-level of a
246/// specification.
247#[derive(Debug, Serialize, Deserialize)]
248pub struct Config {
249    /// Area-Specific Config
250    pub area: Option<AreaConfig>,
251    /// Sets how the visualization size should be determined. If a string, should be one of
252    /// `"pad"`, `"fit"` or `"none"`.
253    /// Object values can additionally specify parameters for content sizing and automatic
254    /// resizing.
255    /// `"fit"` is only supported for single and layered views that don't use `rangeStep`.
256    ///
257    /// __Default value__: `pad`
258    pub autosize: Option<Autosize>,
259    /// Axis configuration, which determines default properties for all `x` and `y`
260    /// [axes](https://vega.github.io/vega-lite/docs/axis.html). For a full list of axis
261    /// configuration options, please see the [corresponding section of the axis
262    /// documentation](https://vega.github.io/vega-lite/docs/axis.html#config).
263    pub axis: Option<AxisConfig>,
264    /// Specific axis config for axes with "band" scales.
265    #[serde(rename = "axisBand")]
266    pub axis_band: Option<VgAxisConfig>,
267    /// Specific axis config for x-axis along the bottom edge of the chart.
268    #[serde(rename = "axisBottom")]
269    pub axis_bottom: Option<VgAxisConfig>,
270    /// Specific axis config for y-axis along the left edge of the chart.
271    #[serde(rename = "axisLeft")]
272    pub axis_left: Option<VgAxisConfig>,
273    /// Specific axis config for y-axis along the right edge of the chart.
274    #[serde(rename = "axisRight")]
275    pub axis_right: Option<VgAxisConfig>,
276    /// Specific axis config for x-axis along the top edge of the chart.
277    #[serde(rename = "axisTop")]
278    pub axis_top: Option<VgAxisConfig>,
279    /// X-axis specific config.
280    #[serde(rename = "axisX")]
281    pub axis_x: Option<VgAxisConfig>,
282    /// Y-axis specific config.
283    #[serde(rename = "axisY")]
284    pub axis_y: Option<VgAxisConfig>,
285    /// CSS color property to use as the background of visualization.
286    ///
287    /// __Default value:__ none (transparent)
288    pub background: Option<String>,
289    /// Bar-Specific Config
290    pub bar: Option<BarConfig>,
291    /// Circle-Specific Config
292    pub circle: Option<MarkConfig>,
293    /// Default axis and legend title for count fields.
294    ///
295    /// __Default value:__ `'Number of Records'`.
296    #[serde(rename = "countTitle")]
297    pub count_title: Option<String>,
298    /// A global data store for named datasets. This is a mapping from names to inline datasets.
299    /// This can be an array of objects or primitive values or a string. Arrays of primitive
300    /// values are ingested as objects with a `data` property.
301    pub datasets: Option<HashMap<String, InlineDatasetValue>>,
302    /// Defines how Vega-Lite generates title for fields.  There are three possible styles:
303    /// - `"verbal"` (Default) - displays function in a verbal style (e.g., "Sum of field",
304    /// "Year-month of date", "field (binned)").
305    /// - `"function"` - displays function using parentheses and capitalized texts (e.g.,
306    /// "SUM(field)", "YEARMONTH(date)", "BIN(field)").
307    /// - `"plain"` - displays only the field name without functions (e.g., "field", "date",
308    /// "field").
309    #[serde(rename = "fieldTitle")]
310    pub field_title: Option<FieldTitle>,
311    /// Geoshape-Specific Config
312    pub geoshape: Option<MarkConfig>,
313    /// Header configuration, which determines default properties for all
314    /// [header](https://vega.github.io/vega-lite/docs/header.html). For a full list of header
315    /// configuration options, please see the [corresponding section of in the header
316    /// documentation](https://vega.github.io/vega-lite/docs/header.html#config).
317    pub header: Option<HeaderConfig>,
318    /// Defines how Vega-Lite should handle invalid values (`null` and `NaN`).
319    /// - If set to `"filter"` (default), all data items with null values will be skipped (for
320    /// line, trail, and area marks) or filtered (for other marks).
321    /// - If `null`, all data items are included. In this case, invalid values will be
322    /// interpreted as zeroes.
323    #[serde(rename = "invalidValues")]
324    pub invalid_values: Option<InvalidValues>,
325    /// Legend configuration, which determines default properties for all
326    /// [legends](https://vega.github.io/vega-lite/docs/legend.html). For a full list of legend
327    /// configuration options, please see the [corresponding section of in the legend
328    /// documentation](https://vega.github.io/vega-lite/docs/legend.html#config).
329    pub legend: Option<LegendConfig>,
330    /// Line-Specific Config
331    pub line: Option<LineConfig>,
332    /// Mark Config
333    pub mark: Option<MarkConfig>,
334    /// D3 Number format for axis labels and text tables. For example "s" for SI units. Use [D3's
335    /// number format pattern](https://github.com/d3/d3-format#locale_format).
336    #[serde(rename = "numberFormat")]
337    pub number_format: Option<String>,
338    /// The default visualization padding, in pixels, from the edge of the visualization canvas
339    /// to the data rectangle.  If a number, specifies padding for all sides.
340    /// If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
341    /// "bottom": 5}` to specify padding for each side of the visualization.
342    ///
343    /// __Default value__: `5`
344    pub padding: Option<Padding>,
345    /// Point-Specific Config
346    pub point: Option<MarkConfig>,
347    /// Projection configuration, which determines default properties for all
348    /// [projections](https://vega.github.io/vega-lite/docs/projection.html). For a full list of
349    /// projection configuration options, please see the [corresponding section of the projection
350    /// documentation](https://vega.github.io/vega-lite/docs/projection.html#config).
351    pub projection: Option<ProjectionConfig>,
352    /// An object hash that defines default range arrays or schemes for using with scales.
353    /// For a full list of scale range configuration options, please see the [corresponding
354    /// section of the scale
355    /// documentation](https://vega.github.io/vega-lite/docs/scale.html#config).
356    pub range: Option<HashMap<String, ConfigRange>>,
357    /// Rect-Specific Config
358    pub rect: Option<MarkConfig>,
359    /// Rule-Specific Config
360    pub rule: Option<MarkConfig>,
361    /// Scale configuration determines default properties for all
362    /// [scales](https://vega.github.io/vega-lite/docs/scale.html). For a full list of scale
363    /// configuration options, please see the [corresponding section of the scale
364    /// documentation](https://vega.github.io/vega-lite/docs/scale.html#config).
365    pub scale: Option<ScaleConfig>,
366    /// An object hash for defining default properties for each type of selections.
367    pub selection: Option<SelectionConfig>,
368    /// Square-Specific Config
369    pub square: Option<MarkConfig>,
370    /// Default stack offset for stackable mark.
371    pub stack: Option<StackOffset>,
372    /// An object hash that defines key-value mappings to determine default properties for marks
373    /// with a given [style](https://vega.github.io/vega-lite/docs/mark.html#mark-def).  The keys
374    /// represent styles names; the values have to be valid [mark configuration
375    /// objects](https://vega.github.io/vega-lite/docs/mark.html#config).
376    pub style: Option<HashMap<String, VgMarkConfig>>,
377    /// Text-Specific Config
378    pub text: Option<TextConfig>,
379    /// Tick-Specific Config
380    pub tick: Option<TickConfig>,
381    /// Default datetime format for axis and legend labels. The format can be set directly on
382    /// each axis and legend. Use [D3's time format
383    /// pattern](https://github.com/d3/d3-time-format#locale_format).
384    ///
385    /// __Default value:__ `''` (The format will be automatically determined).
386    #[serde(rename = "timeFormat")]
387    pub time_format: Option<String>,
388    /// Title configuration, which determines default properties for all
389    /// [titles](https://vega.github.io/vega-lite/docs/title.html). For a full list of title
390    /// configuration options, please see the [corresponding section of the title
391    /// documentation](https://vega.github.io/vega-lite/docs/title.html#config).
392    pub title: Option<VgTitleConfig>,
393    /// Trail-Specific Config
394    pub trail: Option<LineConfig>,
395    /// Default properties for [single view
396    /// plots](https://vega.github.io/vega-lite/docs/spec.html#single).
397    pub view: Option<ViewConfig>,
398}
399
400/// Area-Specific Config
401#[derive(Debug, Serialize, Deserialize)]
402pub struct AreaConfig {
403    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
404    pub align: Option<HorizontalAlign>,
405    /// The rotation angle of the text, in degrees.
406    pub angle: Option<f64>,
407    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
408    ///
409    /// __Default value:__ `"middle"`
410    pub baseline: Option<VerticalAlign>,
411    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
412    /// will override `color`.
413    ///
414    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
415    ///
416    /// __Note:__ This property cannot be used in a [style
417    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
418    pub color: Option<String>,
419    /// The radius in pixels of rounded rectangle corners.
420    ///
421    /// __Default value:__ `0`
422    #[serde(rename = "cornerRadius")]
423    pub corner_radius: Option<f64>,
424    /// The mouse cursor used over the mark. Any valid [CSS cursor
425    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
426    pub cursor: Option<Cursor>,
427    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
428    /// This property determines on which side is truncated in response to the limit parameter.
429    ///
430    /// __Default value:__ `"ltr"`
431    pub dir: Option<Dir>,
432    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
433    /// is applied after rotation by the _angle_ property.
434    pub dx: Option<f64>,
435    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
436    /// is applied after rotation by the _angle_ property.
437    pub dy: Option<f64>,
438    /// The ellipsis string for text truncated in response to the limit parameter.
439    ///
440    /// __Default value:__ `"…"`
441    pub ellipsis: Option<String>,
442    /// Default Fill Color.  This has higher precedence than `config.color`
443    ///
444    /// __Default value:__ (None)
445    pub fill: Option<String>,
446    /// Whether the mark's color should be used as fill color instead of stroke color.
447    ///
448    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
449    ///
450    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
451    ///
452    /// __Note:__ This property cannot be used in a [style
453    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
454    pub filled: Option<bool>,
455    /// The fill opacity (value between [0,1]).
456    ///
457    /// __Default value:__ `1`
458    #[serde(rename = "fillOpacity")]
459    pub fill_opacity: Option<f64>,
460    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
461    pub font: Option<String>,
462    /// The font size, in pixels.
463    #[serde(rename = "fontSize")]
464    pub font_size: Option<f64>,
465    /// The font style (e.g., `"italic"`).
466    #[serde(rename = "fontStyle")]
467    pub font_style: Option<FontStyle>,
468    /// The font weight.
469    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
470    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
471    #[serde(rename = "fontWeight")]
472    pub font_weight: Option<FontWeight>,
473    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
474    pub href: Option<String>,
475    /// The line interpolation method to use for line and area marks. One of the following:
476    /// - `"linear"`: piecewise linear segments, as in a polyline.
477    /// - `"linear-closed"`: close the linear segments to form a polygon.
478    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
479    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
480    /// function.
481    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
482    /// function.
483    /// - `"basis"`: a B-spline, with control point duplication on the ends.
484    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
485    /// - `"basis-closed"`: a closed B-spline, as in a loop.
486    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
487    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
488    /// will intersect other control points.
489    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
490    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
491    /// spline.
492    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
493    pub interpolate: Option<Interpolate>,
494    /// The maximum length of the text mark in pixels. The text value will be automatically
495    /// truncated if the rendered size exceeds the limit.
496    ///
497    /// __Default value:__ `0`, indicating no limit
498    pub limit: Option<f64>,
499    /// A flag for overlaying line on top of area marks, or an object defining the properties of
500    /// the overlayed lines.
501    ///
502    /// - If this value is an empty object (`{}`) or `true`, lines with default properties will
503    /// be used.
504    ///
505    /// - If this value is `false`, no lines would be automatically added to area marks.
506    ///
507    /// __Default value:__ `false`.
508    pub line: Option<Line>,
509    /// The overall opacity (value between [0,1]).
510    ///
511    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
512    /// `square` marks or layered `bar` charts and `1` otherwise.
513    pub opacity: Option<f64>,
514    /// The orientation of a non-stacked bar, tick, area, and line charts.
515    /// The value is either horizontal (default) or vertical.
516    /// - For bar, rule and tick, this determines whether the size of the bar and tick
517    /// should be applied to x or y dimension.
518    /// - For area, this property determines the orient property of the Vega output.
519    /// - For line and trail marks, this property determines the sort order of the points in the
520    /// line
521    /// if `config.sortLineBy` is not specified.
522    /// For stacked charts, this is always determined by the orientation of the stack;
523    /// therefore explicitly specified value will be ignored.
524    pub orient: Option<Orient>,
525    /// A flag for overlaying points on top of line or area marks, or an object defining the
526    /// properties of the overlayed points.
527    ///
528    /// - If this property is `"transparent"`, transparent points will be used (for enhancing
529    /// tooltips and selections).
530    ///
531    /// - If this property is an empty object (`{}`) or `true`, filled points with default
532    /// properties will be used.
533    ///
534    /// - If this property is `false`, no points would be automatically added to line or area
535    /// marks.
536    ///
537    /// __Default value:__ `false`.
538    pub point: Option<PointUnion>,
539    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
540    /// by the `x` and `y` properties.
541    pub radius: Option<f64>,
542    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
543    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
544    ///
545    /// __Default value:__ `"circle"`
546    pub shape: Option<String>,
547    /// The pixel area each the point/circle/square.
548    /// For example: in the case of circles, the radius is determined in part by the square root
549    /// of the size value.
550    ///
551    /// __Default value:__ `30`
552    pub size: Option<f64>,
553    /// Default Stroke Color.  This has higher precedence than `config.color`
554    ///
555    /// __Default value:__ (None)
556    pub stroke: Option<String>,
557    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
558    ///
559    /// __Default value:__ `"square"`
560    #[serde(rename = "strokeCap")]
561    pub stroke_cap: Option<StrokeCap>,
562    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
563    #[serde(rename = "strokeDash")]
564    pub stroke_dash: Option<Vec<f64>>,
565    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
566    #[serde(rename = "strokeDashOffset")]
567    pub stroke_dash_offset: Option<f64>,
568    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
569    ///
570    /// __Default value:__ `"miter"`
571    #[serde(rename = "strokeJoin")]
572    pub stroke_join: Option<StrokeJoin>,
573    /// The miter limit at which to bevel a line join.
574    #[serde(rename = "strokeMiterLimit")]
575    pub stroke_miter_limit: Option<f64>,
576    /// The stroke opacity (value between [0,1]).
577    ///
578    /// __Default value:__ `1`
579    #[serde(rename = "strokeOpacity")]
580    pub stroke_opacity: Option<f64>,
581    /// The stroke width, in pixels.
582    #[serde(rename = "strokeWidth")]
583    pub stroke_width: Option<f64>,
584    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
585    pub tension: Option<f64>,
586    /// Placeholder text if the `text` channel is not specified
587    pub text: Option<String>,
588    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
589    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
590    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
591    /// indicating "north".
592    pub theta: Option<f64>,
593    /// The tooltip text to show upon mouse hover.
594    pub tooltip: Option<serde_json::Value>,
595}
596
597#[derive(Debug, Serialize, Deserialize)]
598pub struct OverlayMarkDef {
599    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
600    pub align: Option<HorizontalAlign>,
601    /// The rotation angle of the text, in degrees.
602    pub angle: Option<f64>,
603    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
604    ///
605    /// __Default value:__ `"middle"`
606    pub baseline: Option<VerticalAlign>,
607    /// Whether a mark be clipped to the enclosing group’s width and height.
608    pub clip: Option<bool>,
609    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
610    /// will override `color`.
611    ///
612    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
613    ///
614    /// __Note:__ This property cannot be used in a [style
615    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
616    pub color: Option<String>,
617    /// The radius in pixels of rounded rectangle corners.
618    ///
619    /// __Default value:__ `0`
620    #[serde(rename = "cornerRadius")]
621    pub corner_radius: Option<f64>,
622    /// The mouse cursor used over the mark. Any valid [CSS cursor
623    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
624    pub cursor: Option<Cursor>,
625    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
626    /// This property determines on which side is truncated in response to the limit parameter.
627    ///
628    /// __Default value:__ `"ltr"`
629    pub dir: Option<Dir>,
630    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
631    /// is applied after rotation by the _angle_ property.
632    pub dx: Option<f64>,
633    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
634    /// is applied after rotation by the _angle_ property.
635    pub dy: Option<f64>,
636    /// The ellipsis string for text truncated in response to the limit parameter.
637    ///
638    /// __Default value:__ `"…"`
639    pub ellipsis: Option<String>,
640    /// Default Fill Color.  This has higher precedence than `config.color`
641    ///
642    /// __Default value:__ (None)
643    pub fill: Option<String>,
644    /// Whether the mark's color should be used as fill color instead of stroke color.
645    ///
646    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
647    ///
648    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
649    ///
650    /// __Note:__ This property cannot be used in a [style
651    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
652    pub filled: Option<bool>,
653    /// The fill opacity (value between [0,1]).
654    ///
655    /// __Default value:__ `1`
656    #[serde(rename = "fillOpacity")]
657    pub fill_opacity: Option<f64>,
658    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
659    pub font: Option<String>,
660    /// The font size, in pixels.
661    #[serde(rename = "fontSize")]
662    pub font_size: Option<f64>,
663    /// The font style (e.g., `"italic"`).
664    #[serde(rename = "fontStyle")]
665    pub font_style: Option<FontStyle>,
666    /// The font weight.
667    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
668    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
669    #[serde(rename = "fontWeight")]
670    pub font_weight: Option<FontWeight>,
671    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
672    pub href: Option<String>,
673    /// The line interpolation method to use for line and area marks. One of the following:
674    /// - `"linear"`: piecewise linear segments, as in a polyline.
675    /// - `"linear-closed"`: close the linear segments to form a polygon.
676    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
677    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
678    /// function.
679    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
680    /// function.
681    /// - `"basis"`: a B-spline, with control point duplication on the ends.
682    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
683    /// - `"basis-closed"`: a closed B-spline, as in a loop.
684    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
685    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
686    /// will intersect other control points.
687    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
688    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
689    /// spline.
690    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
691    pub interpolate: Option<Interpolate>,
692    /// The maximum length of the text mark in pixels. The text value will be automatically
693    /// truncated if the rendered size exceeds the limit.
694    ///
695    /// __Default value:__ `0`, indicating no limit
696    pub limit: Option<f64>,
697    /// The overall opacity (value between [0,1]).
698    ///
699    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
700    /// `square` marks or layered `bar` charts and `1` otherwise.
701    pub opacity: Option<f64>,
702    /// The orientation of a non-stacked bar, tick, area, and line charts.
703    /// The value is either horizontal (default) or vertical.
704    /// - For bar, rule and tick, this determines whether the size of the bar and tick
705    /// should be applied to x or y dimension.
706    /// - For area, this property determines the orient property of the Vega output.
707    /// - For line and trail marks, this property determines the sort order of the points in the
708    /// line
709    /// if `config.sortLineBy` is not specified.
710    /// For stacked charts, this is always determined by the orientation of the stack;
711    /// therefore explicitly specified value will be ignored.
712    pub orient: Option<Orient>,
713    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
714    /// by the `x` and `y` properties.
715    pub radius: Option<f64>,
716    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
717    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
718    ///
719    /// __Default value:__ `"circle"`
720    pub shape: Option<String>,
721    /// The pixel area each the point/circle/square.
722    /// For example: in the case of circles, the radius is determined in part by the square root
723    /// of the size value.
724    ///
725    /// __Default value:__ `30`
726    pub size: Option<f64>,
727    /// Default Stroke Color.  This has higher precedence than `config.color`
728    ///
729    /// __Default value:__ (None)
730    pub stroke: Option<String>,
731    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
732    ///
733    /// __Default value:__ `"square"`
734    #[serde(rename = "strokeCap")]
735    pub stroke_cap: Option<StrokeCap>,
736    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
737    #[serde(rename = "strokeDash")]
738    pub stroke_dash: Option<Vec<f64>>,
739    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
740    #[serde(rename = "strokeDashOffset")]
741    pub stroke_dash_offset: Option<f64>,
742    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
743    ///
744    /// __Default value:__ `"miter"`
745    #[serde(rename = "strokeJoin")]
746    pub stroke_join: Option<StrokeJoin>,
747    /// The miter limit at which to bevel a line join.
748    #[serde(rename = "strokeMiterLimit")]
749    pub stroke_miter_limit: Option<f64>,
750    /// The stroke opacity (value between [0,1]).
751    ///
752    /// __Default value:__ `1`
753    #[serde(rename = "strokeOpacity")]
754    pub stroke_opacity: Option<f64>,
755    /// The stroke width, in pixels.
756    #[serde(rename = "strokeWidth")]
757    pub stroke_width: Option<f64>,
758    /// A string or array of strings indicating the name of custom styles to apply to the mark. A
759    /// style is a named collection of mark property defaults defined within the [style
760    /// configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is
761    /// an array, later styles will override earlier styles. Any [mark
762    /// properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly
763    /// defined within the `encoding` will override a style default.
764    ///
765    /// __Default value:__ The mark's name.  For example, a bar mark will have style `"bar"` by
766    /// default.
767    /// __Note:__ Any specified style will augment the default style. For example, a bar mark
768    /// with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
769    /// specified style `"foo"` has higher precedence).
770    pub style: Option<Style>,
771    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
772    pub tension: Option<f64>,
773    /// Placeholder text if the `text` channel is not specified
774    pub text: Option<String>,
775    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
776    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
777    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
778    /// indicating "north".
779    pub theta: Option<f64>,
780    /// The tooltip text to show upon mouse hover.
781    pub tooltip: Option<serde_json::Value>,
782    /// Offset for x2-position.
783    #[serde(rename = "x2Offset")]
784    pub x2_offset: Option<f64>,
785    /// Offset for x-position.
786    #[serde(rename = "xOffset")]
787    pub x_offset: Option<f64>,
788    /// Offset for y2-position.
789    #[serde(rename = "y2Offset")]
790    pub y2_offset: Option<f64>,
791    /// Offset for y-position.
792    #[serde(rename = "yOffset")]
793    pub y_offset: Option<f64>,
794}
795
796/// Axis configuration, which determines default properties for all `x` and `y`
797/// [axes](https://vega.github.io/vega-lite/docs/axis.html). For a full list of axis
798/// configuration options, please see the [corresponding section of the axis
799/// documentation](https://vega.github.io/vega-lite/docs/axis.html#config).
800#[derive(Debug, Serialize, Deserialize)]
801pub struct AxisConfig {
802    /// An interpolation fraction indicating where, for `band` scales, axis ticks should be
803    /// positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5`
804    /// places ticks in the middle of their bands.
805    #[serde(rename = "bandPosition")]
806    pub band_position: Option<f64>,
807    /// A boolean flag indicating if the domain (the axis baseline) should be included as part of
808    /// the axis.
809    ///
810    /// __Default value:__ `true`
811    pub domain: Option<bool>,
812    /// Color of axis domain line.
813    ///
814    /// __Default value:__  (none, using Vega default).
815    #[serde(rename = "domainColor")]
816    pub domain_color: Option<String>,
817    /// Stroke width of axis domain line
818    ///
819    /// __Default value:__  (none, using Vega default).
820    #[serde(rename = "domainWidth")]
821    pub domain_width: Option<f64>,
822    /// A boolean flag indicating if grid lines should be included as part of the axis
823    ///
824    /// __Default value:__ `true` for [continuous
825    /// scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned;
826    /// otherwise, `false`.
827    pub grid: Option<bool>,
828    /// Color of gridlines.
829    #[serde(rename = "gridColor")]
830    pub grid_color: Option<String>,
831    /// The offset (in pixels) into which to begin drawing with the grid dash array.
832    #[serde(rename = "gridDash")]
833    pub grid_dash: Option<Vec<f64>>,
834    /// The stroke opacity of grid (value between [0,1])
835    ///
836    /// __Default value:__ (`1` by default)
837    #[serde(rename = "gridOpacity")]
838    pub grid_opacity: Option<f64>,
839    /// The grid width, in pixels.
840    #[serde(rename = "gridWidth")]
841    pub grid_width: Option<f64>,
842    /// The rotation angle of the axis labels.
843    ///
844    /// __Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.
845    #[serde(rename = "labelAngle")]
846    pub label_angle: Option<f64>,
847    /// Indicates if labels should be hidden if they exceed the axis range. If `false `(the
848    /// default) no bounds overlap analysis is performed. If `true`, labels will be hidden if
849    /// they exceed the axis range by more than 1 pixel. If this property is a number, it
850    /// specifies the pixel tolerance: the maximum amount by which a label bounding box may
851    /// exceed the axis range.
852    ///
853    /// __Default value:__ `false`.
854    #[serde(rename = "labelBound")]
855    pub label_bound: Option<Label>,
856    /// The color of the tick label, can be in hex color code or regular color name.
857    #[serde(rename = "labelColor")]
858    pub label_color: Option<String>,
859    /// Indicates if the first and last axis labels should be aligned flush with the scale range.
860    /// Flush alignment for a horizontal axis will left-align the first label and right-align the
861    /// last label. For vertical axes, bottom and top text baselines are applied instead. If this
862    /// property is a number, it also indicates the number of pixels by which to offset the first
863    /// and last labels; for example, a value of 2 will flush-align the first and last labels and
864    /// also push them 2 pixels outward from the center of the axis. The additional adjustment
865    /// can sometimes help the labels better visually group with corresponding axis ticks.
866    ///
867    /// __Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.
868    #[serde(rename = "labelFlush")]
869    pub label_flush: Option<Label>,
870    /// The font of the tick label.
871    #[serde(rename = "labelFont")]
872    pub label_font: Option<String>,
873    /// The font size of the label, in pixels.
874    #[serde(rename = "labelFontSize")]
875    pub label_font_size: Option<f64>,
876    /// Maximum allowed pixel width of axis tick labels.
877    #[serde(rename = "labelLimit")]
878    pub label_limit: Option<f64>,
879    /// The strategy to use for resolving overlap of axis labels. If `false` (the default), no
880    /// overlap reduction is attempted. If set to `true` or `"parity"`, a strategy of removing
881    /// every other label is used (this works well for standard linear axes). If set to
882    /// `"greedy"`, a linear scan of the labels is performed, removing any labels that overlaps
883    /// with the last visible label (this often works better for log-scaled axes).
884    ///
885    /// __Default value:__ `true` for non-nominal fields with non-log scales; `"greedy"` for log
886    /// scales; otherwise `false`.
887    #[serde(rename = "labelOverlap")]
888    pub label_overlap: Option<LabelOverlapUnion>,
889    /// The padding, in pixels, between axis and text labels.
890    #[serde(rename = "labelPadding")]
891    pub label_padding: Option<f64>,
892    /// A boolean flag indicating if labels should be included as part of the axis.
893    ///
894    /// __Default value:__  `true`.
895    pub labels: Option<bool>,
896    /// The maximum extent in pixels that axis ticks and labels should use. This determines a
897    /// maximum offset value for axis titles.
898    ///
899    /// __Default value:__ `undefined`.
900    #[serde(rename = "maxExtent")]
901    pub max_extent: Option<f64>,
902    /// The minimum extent in pixels that axis ticks and labels should use. This determines a
903    /// minimum offset value for axis titles.
904    ///
905    /// __Default value:__ `30` for y-axis; `undefined` for x-axis.
906    #[serde(rename = "minExtent")]
907    pub min_extent: Option<f64>,
908    /// Whether month names and weekday names should be abbreviated.
909    ///
910    /// __Default value:__  `false`
911    #[serde(rename = "shortTimeLabels")]
912    pub short_time_labels: Option<bool>,
913    /// The color of the axis's tick.
914    #[serde(rename = "tickColor")]
915    pub tick_color: Option<String>,
916    /// Boolean flag indicating if pixel position values should be rounded to the nearest integer.
917    #[serde(rename = "tickRound")]
918    pub tick_round: Option<bool>,
919    /// Boolean value that determines whether the axis should include ticks.
920    pub ticks: Option<bool>,
921    /// The size in pixels of axis ticks.
922    #[serde(rename = "tickSize")]
923    pub tick_size: Option<f64>,
924    /// The width, in pixels, of ticks.
925    #[serde(rename = "tickWidth")]
926    pub tick_width: Option<f64>,
927    /// Horizontal text alignment of axis titles.
928    #[serde(rename = "titleAlign")]
929    pub title_align: Option<String>,
930    /// Angle in degrees of axis titles.
931    #[serde(rename = "titleAngle")]
932    pub title_angle: Option<f64>,
933    /// Vertical text baseline for axis titles.
934    #[serde(rename = "titleBaseline")]
935    pub title_baseline: Option<String>,
936    /// Color of the title, can be in hex color code or regular color name.
937    #[serde(rename = "titleColor")]
938    pub title_color: Option<String>,
939    /// Font of the title. (e.g., `"Helvetica Neue"`).
940    #[serde(rename = "titleFont")]
941    pub title_font: Option<String>,
942    /// Font size of the title.
943    #[serde(rename = "titleFontSize")]
944    pub title_font_size: Option<f64>,
945    /// Font weight of the title.
946    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
947    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
948    #[serde(rename = "titleFontWeight")]
949    pub title_font_weight: Option<FontWeight>,
950    /// Maximum allowed pixel width of axis titles.
951    #[serde(rename = "titleLimit")]
952    pub title_limit: Option<f64>,
953    /// Max length for axis title if the title is automatically generated from the field's
954    /// description.
955    #[serde(rename = "titleMaxLength")]
956    pub title_max_length: Option<f64>,
957    /// The padding, in pixels, between title and axis.
958    #[serde(rename = "titlePadding")]
959    pub title_padding: Option<f64>,
960    /// X-coordinate of the axis title relative to the axis group.
961    #[serde(rename = "titleX")]
962    pub title_x: Option<f64>,
963    /// Y-coordinate of the axis title relative to the axis group.
964    #[serde(rename = "titleY")]
965    pub title_y: Option<f64>,
966}
967
968/// Specific axis config for axes with "band" scales.
969///
970/// Specific axis config for x-axis along the bottom edge of the chart.
971///
972/// Specific axis config for y-axis along the left edge of the chart.
973///
974/// Specific axis config for y-axis along the right edge of the chart.
975///
976/// Specific axis config for x-axis along the top edge of the chart.
977///
978/// X-axis specific config.
979///
980/// Y-axis specific config.
981#[derive(Debug, Serialize, Deserialize)]
982pub struct VgAxisConfig {
983    /// An interpolation fraction indicating where, for `band` scales, axis ticks should be
984    /// positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5`
985    /// places ticks in the middle of their bands.
986    #[serde(rename = "bandPosition")]
987    pub band_position: Option<f64>,
988    /// A boolean flag indicating if the domain (the axis baseline) should be included as part of
989    /// the axis.
990    ///
991    /// __Default value:__ `true`
992    pub domain: Option<bool>,
993    /// Color of axis domain line.
994    ///
995    /// __Default value:__  (none, using Vega default).
996    #[serde(rename = "domainColor")]
997    pub domain_color: Option<String>,
998    /// Stroke width of axis domain line
999    ///
1000    /// __Default value:__  (none, using Vega default).
1001    #[serde(rename = "domainWidth")]
1002    pub domain_width: Option<f64>,
1003    /// A boolean flag indicating if grid lines should be included as part of the axis
1004    ///
1005    /// __Default value:__ `true` for [continuous
1006    /// scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned;
1007    /// otherwise, `false`.
1008    pub grid: Option<bool>,
1009    /// Color of gridlines.
1010    #[serde(rename = "gridColor")]
1011    pub grid_color: Option<String>,
1012    /// The offset (in pixels) into which to begin drawing with the grid dash array.
1013    #[serde(rename = "gridDash")]
1014    pub grid_dash: Option<Vec<f64>>,
1015    /// The stroke opacity of grid (value between [0,1])
1016    ///
1017    /// __Default value:__ (`1` by default)
1018    #[serde(rename = "gridOpacity")]
1019    pub grid_opacity: Option<f64>,
1020    /// The grid width, in pixels.
1021    #[serde(rename = "gridWidth")]
1022    pub grid_width: Option<f64>,
1023    /// The rotation angle of the axis labels.
1024    ///
1025    /// __Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.
1026    #[serde(rename = "labelAngle")]
1027    pub label_angle: Option<f64>,
1028    /// Indicates if labels should be hidden if they exceed the axis range. If `false `(the
1029    /// default) no bounds overlap analysis is performed. If `true`, labels will be hidden if
1030    /// they exceed the axis range by more than 1 pixel. If this property is a number, it
1031    /// specifies the pixel tolerance: the maximum amount by which a label bounding box may
1032    /// exceed the axis range.
1033    ///
1034    /// __Default value:__ `false`.
1035    #[serde(rename = "labelBound")]
1036    pub label_bound: Option<Label>,
1037    /// The color of the tick label, can be in hex color code or regular color name.
1038    #[serde(rename = "labelColor")]
1039    pub label_color: Option<String>,
1040    /// Indicates if the first and last axis labels should be aligned flush with the scale range.
1041    /// Flush alignment for a horizontal axis will left-align the first label and right-align the
1042    /// last label. For vertical axes, bottom and top text baselines are applied instead. If this
1043    /// property is a number, it also indicates the number of pixels by which to offset the first
1044    /// and last labels; for example, a value of 2 will flush-align the first and last labels and
1045    /// also push them 2 pixels outward from the center of the axis. The additional adjustment
1046    /// can sometimes help the labels better visually group with corresponding axis ticks.
1047    ///
1048    /// __Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.
1049    #[serde(rename = "labelFlush")]
1050    pub label_flush: Option<Label>,
1051    /// The font of the tick label.
1052    #[serde(rename = "labelFont")]
1053    pub label_font: Option<String>,
1054    /// The font size of the label, in pixels.
1055    #[serde(rename = "labelFontSize")]
1056    pub label_font_size: Option<f64>,
1057    /// Maximum allowed pixel width of axis tick labels.
1058    #[serde(rename = "labelLimit")]
1059    pub label_limit: Option<f64>,
1060    /// The strategy to use for resolving overlap of axis labels. If `false` (the default), no
1061    /// overlap reduction is attempted. If set to `true` or `"parity"`, a strategy of removing
1062    /// every other label is used (this works well for standard linear axes). If set to
1063    /// `"greedy"`, a linear scan of the labels is performed, removing any labels that overlaps
1064    /// with the last visible label (this often works better for log-scaled axes).
1065    ///
1066    /// __Default value:__ `true` for non-nominal fields with non-log scales; `"greedy"` for log
1067    /// scales; otherwise `false`.
1068    #[serde(rename = "labelOverlap")]
1069    pub label_overlap: Option<LabelOverlapUnion>,
1070    /// The padding, in pixels, between axis and text labels.
1071    #[serde(rename = "labelPadding")]
1072    pub label_padding: Option<f64>,
1073    /// A boolean flag indicating if labels should be included as part of the axis.
1074    ///
1075    /// __Default value:__  `true`.
1076    pub labels: Option<bool>,
1077    /// The maximum extent in pixels that axis ticks and labels should use. This determines a
1078    /// maximum offset value for axis titles.
1079    ///
1080    /// __Default value:__ `undefined`.
1081    #[serde(rename = "maxExtent")]
1082    pub max_extent: Option<f64>,
1083    /// The minimum extent in pixels that axis ticks and labels should use. This determines a
1084    /// minimum offset value for axis titles.
1085    ///
1086    /// __Default value:__ `30` for y-axis; `undefined` for x-axis.
1087    #[serde(rename = "minExtent")]
1088    pub min_extent: Option<f64>,
1089    /// The color of the axis's tick.
1090    #[serde(rename = "tickColor")]
1091    pub tick_color: Option<String>,
1092    /// Boolean flag indicating if pixel position values should be rounded to the nearest integer.
1093    #[serde(rename = "tickRound")]
1094    pub tick_round: Option<bool>,
1095    /// Boolean value that determines whether the axis should include ticks.
1096    pub ticks: Option<bool>,
1097    /// The size in pixels of axis ticks.
1098    #[serde(rename = "tickSize")]
1099    pub tick_size: Option<f64>,
1100    /// The width, in pixels, of ticks.
1101    #[serde(rename = "tickWidth")]
1102    pub tick_width: Option<f64>,
1103    /// Horizontal text alignment of axis titles.
1104    #[serde(rename = "titleAlign")]
1105    pub title_align: Option<String>,
1106    /// Angle in degrees of axis titles.
1107    #[serde(rename = "titleAngle")]
1108    pub title_angle: Option<f64>,
1109    /// Vertical text baseline for axis titles.
1110    #[serde(rename = "titleBaseline")]
1111    pub title_baseline: Option<String>,
1112    /// Color of the title, can be in hex color code or regular color name.
1113    #[serde(rename = "titleColor")]
1114    pub title_color: Option<String>,
1115    /// Font of the title. (e.g., `"Helvetica Neue"`).
1116    #[serde(rename = "titleFont")]
1117    pub title_font: Option<String>,
1118    /// Font size of the title.
1119    #[serde(rename = "titleFontSize")]
1120    pub title_font_size: Option<f64>,
1121    /// Font weight of the title.
1122    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
1123    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
1124    #[serde(rename = "titleFontWeight")]
1125    pub title_font_weight: Option<FontWeight>,
1126    /// Maximum allowed pixel width of axis titles.
1127    #[serde(rename = "titleLimit")]
1128    pub title_limit: Option<f64>,
1129    /// Max length for axis title if the title is automatically generated from the field's
1130    /// description.
1131    #[serde(rename = "titleMaxLength")]
1132    pub title_max_length: Option<f64>,
1133    /// The padding, in pixels, between title and axis.
1134    #[serde(rename = "titlePadding")]
1135    pub title_padding: Option<f64>,
1136    /// X-coordinate of the axis title relative to the axis group.
1137    #[serde(rename = "titleX")]
1138    pub title_x: Option<f64>,
1139    /// Y-coordinate of the axis title relative to the axis group.
1140    #[serde(rename = "titleY")]
1141    pub title_y: Option<f64>,
1142}
1143
1144/// Bar-Specific Config
1145#[derive(Debug, Serialize, Deserialize)]
1146pub struct BarConfig {
1147    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
1148    pub align: Option<HorizontalAlign>,
1149    /// The rotation angle of the text, in degrees.
1150    pub angle: Option<f64>,
1151    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
1152    ///
1153    /// __Default value:__ `"middle"`
1154    pub baseline: Option<VerticalAlign>,
1155    /// Offset between bars for binned field.  Ideal value for this is either 0 (Preferred by
1156    /// statisticians) or 1 (Vega-Lite Default, D3 example style).
1157    ///
1158    /// __Default value:__ `1`
1159    #[serde(rename = "binSpacing")]
1160    pub bin_spacing: Option<f64>,
1161    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
1162    /// will override `color`.
1163    ///
1164    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
1165    ///
1166    /// __Note:__ This property cannot be used in a [style
1167    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
1168    pub color: Option<String>,
1169    /// The default size of the bars on continuous scales.
1170    ///
1171    /// __Default value:__ `5`
1172    #[serde(rename = "continuousBandSize")]
1173    pub continuous_band_size: Option<f64>,
1174    /// The radius in pixels of rounded rectangle corners.
1175    ///
1176    /// __Default value:__ `0`
1177    #[serde(rename = "cornerRadius")]
1178    pub corner_radius: Option<f64>,
1179    /// The mouse cursor used over the mark. Any valid [CSS cursor
1180    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
1181    pub cursor: Option<Cursor>,
1182    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
1183    /// This property determines on which side is truncated in response to the limit parameter.
1184    ///
1185    /// __Default value:__ `"ltr"`
1186    pub dir: Option<Dir>,
1187    /// The size of the bars.  If unspecified, the default size is  `bandSize-1`,
1188    /// which provides 1 pixel offset between bars.
1189    #[serde(rename = "discreteBandSize")]
1190    pub discrete_band_size: Option<f64>,
1191    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
1192    /// is applied after rotation by the _angle_ property.
1193    pub dx: Option<f64>,
1194    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
1195    /// is applied after rotation by the _angle_ property.
1196    pub dy: Option<f64>,
1197    /// The ellipsis string for text truncated in response to the limit parameter.
1198    ///
1199    /// __Default value:__ `"…"`
1200    pub ellipsis: Option<String>,
1201    /// Default Fill Color.  This has higher precedence than `config.color`
1202    ///
1203    /// __Default value:__ (None)
1204    pub fill: Option<String>,
1205    /// Whether the mark's color should be used as fill color instead of stroke color.
1206    ///
1207    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
1208    ///
1209    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
1210    ///
1211    /// __Note:__ This property cannot be used in a [style
1212    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
1213    pub filled: Option<bool>,
1214    /// The fill opacity (value between [0,1]).
1215    ///
1216    /// __Default value:__ `1`
1217    #[serde(rename = "fillOpacity")]
1218    pub fill_opacity: Option<f64>,
1219    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
1220    pub font: Option<String>,
1221    /// The font size, in pixels.
1222    #[serde(rename = "fontSize")]
1223    pub font_size: Option<f64>,
1224    /// The font style (e.g., `"italic"`).
1225    #[serde(rename = "fontStyle")]
1226    pub font_style: Option<FontStyle>,
1227    /// The font weight.
1228    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
1229    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
1230    #[serde(rename = "fontWeight")]
1231    pub font_weight: Option<FontWeight>,
1232    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
1233    pub href: Option<String>,
1234    /// The line interpolation method to use for line and area marks. One of the following:
1235    /// - `"linear"`: piecewise linear segments, as in a polyline.
1236    /// - `"linear-closed"`: close the linear segments to form a polygon.
1237    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
1238    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
1239    /// function.
1240    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
1241    /// function.
1242    /// - `"basis"`: a B-spline, with control point duplication on the ends.
1243    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
1244    /// - `"basis-closed"`: a closed B-spline, as in a loop.
1245    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
1246    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
1247    /// will intersect other control points.
1248    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
1249    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
1250    /// spline.
1251    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
1252    pub interpolate: Option<Interpolate>,
1253    /// The maximum length of the text mark in pixels. The text value will be automatically
1254    /// truncated if the rendered size exceeds the limit.
1255    ///
1256    /// __Default value:__ `0`, indicating no limit
1257    pub limit: Option<f64>,
1258    /// The overall opacity (value between [0,1]).
1259    ///
1260    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
1261    /// `square` marks or layered `bar` charts and `1` otherwise.
1262    pub opacity: Option<f64>,
1263    /// The orientation of a non-stacked bar, tick, area, and line charts.
1264    /// The value is either horizontal (default) or vertical.
1265    /// - For bar, rule and tick, this determines whether the size of the bar and tick
1266    /// should be applied to x or y dimension.
1267    /// - For area, this property determines the orient property of the Vega output.
1268    /// - For line and trail marks, this property determines the sort order of the points in the
1269    /// line
1270    /// if `config.sortLineBy` is not specified.
1271    /// For stacked charts, this is always determined by the orientation of the stack;
1272    /// therefore explicitly specified value will be ignored.
1273    pub orient: Option<Orient>,
1274    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
1275    /// by the `x` and `y` properties.
1276    pub radius: Option<f64>,
1277    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
1278    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
1279    ///
1280    /// __Default value:__ `"circle"`
1281    pub shape: Option<String>,
1282    /// The pixel area each the point/circle/square.
1283    /// For example: in the case of circles, the radius is determined in part by the square root
1284    /// of the size value.
1285    ///
1286    /// __Default value:__ `30`
1287    pub size: Option<f64>,
1288    /// Default Stroke Color.  This has higher precedence than `config.color`
1289    ///
1290    /// __Default value:__ (None)
1291    pub stroke: Option<String>,
1292    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
1293    ///
1294    /// __Default value:__ `"square"`
1295    #[serde(rename = "strokeCap")]
1296    pub stroke_cap: Option<StrokeCap>,
1297    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
1298    #[serde(rename = "strokeDash")]
1299    pub stroke_dash: Option<Vec<f64>>,
1300    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
1301    #[serde(rename = "strokeDashOffset")]
1302    pub stroke_dash_offset: Option<f64>,
1303    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
1304    ///
1305    /// __Default value:__ `"miter"`
1306    #[serde(rename = "strokeJoin")]
1307    pub stroke_join: Option<StrokeJoin>,
1308    /// The miter limit at which to bevel a line join.
1309    #[serde(rename = "strokeMiterLimit")]
1310    pub stroke_miter_limit: Option<f64>,
1311    /// The stroke opacity (value between [0,1]).
1312    ///
1313    /// __Default value:__ `1`
1314    #[serde(rename = "strokeOpacity")]
1315    pub stroke_opacity: Option<f64>,
1316    /// The stroke width, in pixels.
1317    #[serde(rename = "strokeWidth")]
1318    pub stroke_width: Option<f64>,
1319    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
1320    pub tension: Option<f64>,
1321    /// Placeholder text if the `text` channel is not specified
1322    pub text: Option<String>,
1323    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
1324    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
1325    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
1326    /// indicating "north".
1327    pub theta: Option<f64>,
1328    /// The tooltip text to show upon mouse hover.
1329    pub tooltip: Option<serde_json::Value>,
1330}
1331
1332/// Circle-Specific Config
1333///
1334/// Geoshape-Specific Config
1335///
1336/// Mark Config
1337///
1338/// Point-Specific Config
1339///
1340/// Rect-Specific Config
1341///
1342/// Rule-Specific Config
1343///
1344/// Square-Specific Config
1345#[derive(Debug, Serialize, Deserialize)]
1346pub struct MarkConfig {
1347    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
1348    pub align: Option<HorizontalAlign>,
1349    /// The rotation angle of the text, in degrees.
1350    pub angle: Option<f64>,
1351    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
1352    ///
1353    /// __Default value:__ `"middle"`
1354    pub baseline: Option<VerticalAlign>,
1355    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
1356    /// will override `color`.
1357    ///
1358    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
1359    ///
1360    /// __Note:__ This property cannot be used in a [style
1361    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
1362    pub color: Option<String>,
1363    /// The radius in pixels of rounded rectangle corners.
1364    ///
1365    /// __Default value:__ `0`
1366    #[serde(rename = "cornerRadius")]
1367    pub corner_radius: Option<f64>,
1368    /// The mouse cursor used over the mark. Any valid [CSS cursor
1369    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
1370    pub cursor: Option<Cursor>,
1371    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
1372    /// This property determines on which side is truncated in response to the limit parameter.
1373    ///
1374    /// __Default value:__ `"ltr"`
1375    pub dir: Option<Dir>,
1376    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
1377    /// is applied after rotation by the _angle_ property.
1378    pub dx: Option<f64>,
1379    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
1380    /// is applied after rotation by the _angle_ property.
1381    pub dy: Option<f64>,
1382    /// The ellipsis string for text truncated in response to the limit parameter.
1383    ///
1384    /// __Default value:__ `"…"`
1385    pub ellipsis: Option<String>,
1386    /// Default Fill Color.  This has higher precedence than `config.color`
1387    ///
1388    /// __Default value:__ (None)
1389    pub fill: Option<String>,
1390    /// Whether the mark's color should be used as fill color instead of stroke color.
1391    ///
1392    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
1393    ///
1394    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
1395    ///
1396    /// __Note:__ This property cannot be used in a [style
1397    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
1398    pub filled: Option<bool>,
1399    /// The fill opacity (value between [0,1]).
1400    ///
1401    /// __Default value:__ `1`
1402    #[serde(rename = "fillOpacity")]
1403    pub fill_opacity: Option<f64>,
1404    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
1405    pub font: Option<String>,
1406    /// The font size, in pixels.
1407    #[serde(rename = "fontSize")]
1408    pub font_size: Option<f64>,
1409    /// The font style (e.g., `"italic"`).
1410    #[serde(rename = "fontStyle")]
1411    pub font_style: Option<FontStyle>,
1412    /// The font weight.
1413    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
1414    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
1415    #[serde(rename = "fontWeight")]
1416    pub font_weight: Option<FontWeight>,
1417    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
1418    pub href: Option<String>,
1419    /// The line interpolation method to use for line and area marks. One of the following:
1420    /// - `"linear"`: piecewise linear segments, as in a polyline.
1421    /// - `"linear-closed"`: close the linear segments to form a polygon.
1422    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
1423    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
1424    /// function.
1425    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
1426    /// function.
1427    /// - `"basis"`: a B-spline, with control point duplication on the ends.
1428    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
1429    /// - `"basis-closed"`: a closed B-spline, as in a loop.
1430    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
1431    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
1432    /// will intersect other control points.
1433    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
1434    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
1435    /// spline.
1436    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
1437    pub interpolate: Option<Interpolate>,
1438    /// The maximum length of the text mark in pixels. The text value will be automatically
1439    /// truncated if the rendered size exceeds the limit.
1440    ///
1441    /// __Default value:__ `0`, indicating no limit
1442    pub limit: Option<f64>,
1443    /// The overall opacity (value between [0,1]).
1444    ///
1445    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
1446    /// `square` marks or layered `bar` charts and `1` otherwise.
1447    pub opacity: Option<f64>,
1448    /// The orientation of a non-stacked bar, tick, area, and line charts.
1449    /// The value is either horizontal (default) or vertical.
1450    /// - For bar, rule and tick, this determines whether the size of the bar and tick
1451    /// should be applied to x or y dimension.
1452    /// - For area, this property determines the orient property of the Vega output.
1453    /// - For line and trail marks, this property determines the sort order of the points in the
1454    /// line
1455    /// if `config.sortLineBy` is not specified.
1456    /// For stacked charts, this is always determined by the orientation of the stack;
1457    /// therefore explicitly specified value will be ignored.
1458    pub orient: Option<Orient>,
1459    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
1460    /// by the `x` and `y` properties.
1461    pub radius: Option<f64>,
1462    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
1463    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
1464    ///
1465    /// __Default value:__ `"circle"`
1466    pub shape: Option<String>,
1467    /// The pixel area each the point/circle/square.
1468    /// For example: in the case of circles, the radius is determined in part by the square root
1469    /// of the size value.
1470    ///
1471    /// __Default value:__ `30`
1472    pub size: Option<f64>,
1473    /// Default Stroke Color.  This has higher precedence than `config.color`
1474    ///
1475    /// __Default value:__ (None)
1476    pub stroke: Option<String>,
1477    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
1478    ///
1479    /// __Default value:__ `"square"`
1480    #[serde(rename = "strokeCap")]
1481    pub stroke_cap: Option<StrokeCap>,
1482    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
1483    #[serde(rename = "strokeDash")]
1484    pub stroke_dash: Option<Vec<f64>>,
1485    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
1486    #[serde(rename = "strokeDashOffset")]
1487    pub stroke_dash_offset: Option<f64>,
1488    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
1489    ///
1490    /// __Default value:__ `"miter"`
1491    #[serde(rename = "strokeJoin")]
1492    pub stroke_join: Option<StrokeJoin>,
1493    /// The miter limit at which to bevel a line join.
1494    #[serde(rename = "strokeMiterLimit")]
1495    pub stroke_miter_limit: Option<f64>,
1496    /// The stroke opacity (value between [0,1]).
1497    ///
1498    /// __Default value:__ `1`
1499    #[serde(rename = "strokeOpacity")]
1500    pub stroke_opacity: Option<f64>,
1501    /// The stroke width, in pixels.
1502    #[serde(rename = "strokeWidth")]
1503    pub stroke_width: Option<f64>,
1504    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
1505    pub tension: Option<f64>,
1506    /// Placeholder text if the `text` channel is not specified
1507    pub text: Option<String>,
1508    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
1509    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
1510    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
1511    /// indicating "north".
1512    pub theta: Option<f64>,
1513    /// The tooltip text to show upon mouse hover.
1514    pub tooltip: Option<serde_json::Value>,
1515}
1516
1517/// Header configuration, which determines default properties for all
1518/// [header](https://vega.github.io/vega-lite/docs/header.html). For a full list of header
1519/// configuration options, please see the [corresponding section of in the header
1520/// documentation](https://vega.github.io/vega-lite/docs/header.html#config).
1521#[derive(Debug, Serialize, Deserialize)]
1522pub struct HeaderConfig {
1523    /// The rotation angle of the header labels.
1524    ///
1525    /// __Default value:__ `0`.
1526    #[serde(rename = "labelAngle")]
1527    pub label_angle: Option<f64>,
1528    /// The color of the header label, can be in hex color code or regular color name.
1529    #[serde(rename = "labelColor")]
1530    pub label_color: Option<String>,
1531    /// The font of the header label.
1532    #[serde(rename = "labelFont")]
1533    pub label_font: Option<String>,
1534    /// The font size of the header label, in pixels.
1535    #[serde(rename = "labelFontSize")]
1536    pub label_font_size: Option<f64>,
1537    /// The maximum length of the header label in pixels. The text value will be automatically
1538    /// truncated if the rendered size exceeds the limit.
1539    ///
1540    /// __Default value:__ `0`, indicating no limit
1541    #[serde(rename = "labelLimit")]
1542    pub label_limit: Option<f64>,
1543    /// The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
1544    /// example, with an orientation of top these anchor positions map to a left-, center-, or
1545    /// right-aligned title.
1546    ///
1547    /// __Default value:__ `"middle"` for
1548    /// [single](https://vega.github.io/vega-lite/docs/spec.html) and
1549    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.
1550    /// `"start"` for other composite views.
1551    ///
1552    /// __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
1553    /// customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and
1554    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.  For other composite
1555    /// views, `anchor` is always `"start"`.
1556    #[serde(rename = "titleAnchor")]
1557    pub title_anchor: Option<String>,
1558    /// The rotation angle of the header title.
1559    ///
1560    /// __Default value:__ `0`.
1561    #[serde(rename = "titleAngle")]
1562    pub title_angle: Option<f64>,
1563    /// Vertical text baseline for the header title. One of `"top"`, `"bottom"`, `"middle"`.
1564    ///
1565    /// __Default value:__ `"middle"`
1566    #[serde(rename = "titleBaseline")]
1567    pub title_baseline: Option<TextBaseline>,
1568    /// Color of the header title, can be in hex color code or regular color name.
1569    #[serde(rename = "titleColor")]
1570    pub title_color: Option<String>,
1571    /// Font of the header title. (e.g., `"Helvetica Neue"`).
1572    #[serde(rename = "titleFont")]
1573    pub title_font: Option<String>,
1574    /// Font size of the header title.
1575    #[serde(rename = "titleFontSize")]
1576    pub title_font_size: Option<f64>,
1577    /// Font weight of the header title.
1578    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
1579    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
1580    #[serde(rename = "titleFontWeight")]
1581    pub title_font_weight: Option<FontWeight>,
1582    /// The maximum length of the header title in pixels. The text value will be automatically
1583    /// truncated if the rendered size exceeds the limit.
1584    ///
1585    /// __Default value:__ `0`, indicating no limit
1586    #[serde(rename = "titleLimit")]
1587    pub title_limit: Option<f64>,
1588}
1589
1590/// Legend configuration, which determines default properties for all
1591/// [legends](https://vega.github.io/vega-lite/docs/legend.html). For a full list of legend
1592/// configuration options, please see the [corresponding section of in the legend
1593/// documentation](https://vega.github.io/vega-lite/docs/legend.html#config).
1594#[derive(Debug, Serialize, Deserialize)]
1595pub struct LegendConfig {
1596    /// Corner radius for the full legend.
1597    #[serde(rename = "cornerRadius")]
1598    pub corner_radius: Option<f64>,
1599    /// Padding (in pixels) between legend entries in a symbol legend.
1600    #[serde(rename = "entryPadding")]
1601    pub entry_padding: Option<f64>,
1602    /// Background fill color for the full legend.
1603    #[serde(rename = "fillColor")]
1604    pub fill_color: Option<String>,
1605    /// The height of the gradient, in pixels.
1606    #[serde(rename = "gradientHeight")]
1607    pub gradient_height: Option<f64>,
1608    /// Text baseline for color ramp gradient labels.
1609    #[serde(rename = "gradientLabelBaseline")]
1610    pub gradient_label_baseline: Option<String>,
1611    /// The maximum allowed length in pixels of color ramp gradient labels.
1612    #[serde(rename = "gradientLabelLimit")]
1613    pub gradient_label_limit: Option<f64>,
1614    /// Vertical offset in pixels for color ramp gradient labels.
1615    #[serde(rename = "gradientLabelOffset")]
1616    pub gradient_label_offset: Option<f64>,
1617    /// The color of the gradient stroke, can be in hex color code or regular color name.
1618    #[serde(rename = "gradientStrokeColor")]
1619    pub gradient_stroke_color: Option<String>,
1620    /// The width of the gradient stroke, in pixels.
1621    #[serde(rename = "gradientStrokeWidth")]
1622    pub gradient_stroke_width: Option<f64>,
1623    /// The width of the gradient, in pixels.
1624    #[serde(rename = "gradientWidth")]
1625    pub gradient_width: Option<f64>,
1626    /// The alignment of the legend label, can be left, middle or right.
1627    #[serde(rename = "labelAlign")]
1628    pub label_align: Option<String>,
1629    /// The position of the baseline of legend label, can be top, middle or bottom.
1630    #[serde(rename = "labelBaseline")]
1631    pub label_baseline: Option<String>,
1632    /// The color of the legend label, can be in hex color code or regular color name.
1633    #[serde(rename = "labelColor")]
1634    pub label_color: Option<String>,
1635    /// The font of the legend label.
1636    #[serde(rename = "labelFont")]
1637    pub label_font: Option<String>,
1638    /// The font size of legend label.
1639    ///
1640    /// __Default value:__ `10`.
1641    #[serde(rename = "labelFontSize")]
1642    pub label_font_size: Option<f64>,
1643    /// Maximum allowed pixel width of axis tick labels.
1644    #[serde(rename = "labelLimit")]
1645    pub label_limit: Option<f64>,
1646    /// The offset of the legend label.
1647    #[serde(rename = "labelOffset")]
1648    pub label_offset: Option<f64>,
1649    /// The offset, in pixels, by which to displace the legend from the edge of the enclosing
1650    /// group or data rectangle.
1651    ///
1652    /// __Default value:__  `0`
1653    pub offset: Option<f64>,
1654    /// The orientation of the legend, which determines how the legend is positioned within the
1655    /// scene. One of "left", "right", "top-left", "top-right", "bottom-left", "bottom-right",
1656    /// "none".
1657    ///
1658    /// __Default value:__ `"right"`
1659    pub orient: Option<LegendOrient>,
1660    /// The padding, in pixels, between the legend and axis.
1661    pub padding: Option<f64>,
1662    /// Whether month names and weekday names should be abbreviated.
1663    ///
1664    /// __Default value:__  `false`
1665    #[serde(rename = "shortTimeLabels")]
1666    pub short_time_labels: Option<bool>,
1667    /// Border stroke color for the full legend.
1668    #[serde(rename = "strokeColor")]
1669    pub stroke_color: Option<String>,
1670    /// Border stroke dash pattern for the full legend.
1671    #[serde(rename = "strokeDash")]
1672    pub stroke_dash: Option<Vec<f64>>,
1673    /// Border stroke width for the full legend.
1674    #[serde(rename = "strokeWidth")]
1675    pub stroke_width: Option<f64>,
1676    /// The color of the legend symbol,
1677    #[serde(rename = "symbolColor")]
1678    pub symbol_color: Option<String>,
1679    /// The size of the legend symbol, in pixels.
1680    #[serde(rename = "symbolSize")]
1681    pub symbol_size: Option<f64>,
1682    /// The width of the symbol's stroke.
1683    #[serde(rename = "symbolStrokeWidth")]
1684    pub symbol_stroke_width: Option<f64>,
1685    /// Default shape type (such as "circle") for legend symbols.
1686    #[serde(rename = "symbolType")]
1687    pub symbol_type: Option<String>,
1688    /// Horizontal text alignment for legend titles.
1689    #[serde(rename = "titleAlign")]
1690    pub title_align: Option<String>,
1691    /// Vertical text baseline for legend titles.
1692    #[serde(rename = "titleBaseline")]
1693    pub title_baseline: Option<String>,
1694    /// The color of the legend title, can be in hex color code or regular color name.
1695    #[serde(rename = "titleColor")]
1696    pub title_color: Option<String>,
1697    /// The font of the legend title.
1698    #[serde(rename = "titleFont")]
1699    pub title_font: Option<String>,
1700    /// The font size of the legend title.
1701    #[serde(rename = "titleFontSize")]
1702    pub title_font_size: Option<f64>,
1703    /// The font weight of the legend title.
1704    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
1705    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
1706    #[serde(rename = "titleFontWeight")]
1707    pub title_font_weight: Option<FontWeight>,
1708    /// Maximum allowed pixel width of axis titles.
1709    #[serde(rename = "titleLimit")]
1710    pub title_limit: Option<f64>,
1711    /// The padding, in pixels, between title and legend.
1712    #[serde(rename = "titlePadding")]
1713    pub title_padding: Option<f64>,
1714}
1715
1716/// Line-Specific Config
1717///
1718/// Trail-Specific Config
1719#[derive(Debug, Serialize, Deserialize)]
1720pub struct LineConfig {
1721    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
1722    pub align: Option<HorizontalAlign>,
1723    /// The rotation angle of the text, in degrees.
1724    pub angle: Option<f64>,
1725    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
1726    ///
1727    /// __Default value:__ `"middle"`
1728    pub baseline: Option<VerticalAlign>,
1729    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
1730    /// will override `color`.
1731    ///
1732    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
1733    ///
1734    /// __Note:__ This property cannot be used in a [style
1735    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
1736    pub color: Option<String>,
1737    /// The radius in pixels of rounded rectangle corners.
1738    ///
1739    /// __Default value:__ `0`
1740    #[serde(rename = "cornerRadius")]
1741    pub corner_radius: Option<f64>,
1742    /// The mouse cursor used over the mark. Any valid [CSS cursor
1743    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
1744    pub cursor: Option<Cursor>,
1745    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
1746    /// This property determines on which side is truncated in response to the limit parameter.
1747    ///
1748    /// __Default value:__ `"ltr"`
1749    pub dir: Option<Dir>,
1750    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
1751    /// is applied after rotation by the _angle_ property.
1752    pub dx: Option<f64>,
1753    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
1754    /// is applied after rotation by the _angle_ property.
1755    pub dy: Option<f64>,
1756    /// The ellipsis string for text truncated in response to the limit parameter.
1757    ///
1758    /// __Default value:__ `"…"`
1759    pub ellipsis: Option<String>,
1760    /// Default Fill Color.  This has higher precedence than `config.color`
1761    ///
1762    /// __Default value:__ (None)
1763    pub fill: Option<String>,
1764    /// Whether the mark's color should be used as fill color instead of stroke color.
1765    ///
1766    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
1767    ///
1768    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
1769    ///
1770    /// __Note:__ This property cannot be used in a [style
1771    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
1772    pub filled: Option<bool>,
1773    /// The fill opacity (value between [0,1]).
1774    ///
1775    /// __Default value:__ `1`
1776    #[serde(rename = "fillOpacity")]
1777    pub fill_opacity: Option<f64>,
1778    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
1779    pub font: Option<String>,
1780    /// The font size, in pixels.
1781    #[serde(rename = "fontSize")]
1782    pub font_size: Option<f64>,
1783    /// The font style (e.g., `"italic"`).
1784    #[serde(rename = "fontStyle")]
1785    pub font_style: Option<FontStyle>,
1786    /// The font weight.
1787    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
1788    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
1789    #[serde(rename = "fontWeight")]
1790    pub font_weight: Option<FontWeight>,
1791    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
1792    pub href: Option<String>,
1793    /// The line interpolation method to use for line and area marks. One of the following:
1794    /// - `"linear"`: piecewise linear segments, as in a polyline.
1795    /// - `"linear-closed"`: close the linear segments to form a polygon.
1796    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
1797    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
1798    /// function.
1799    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
1800    /// function.
1801    /// - `"basis"`: a B-spline, with control point duplication on the ends.
1802    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
1803    /// - `"basis-closed"`: a closed B-spline, as in a loop.
1804    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
1805    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
1806    /// will intersect other control points.
1807    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
1808    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
1809    /// spline.
1810    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
1811    pub interpolate: Option<Interpolate>,
1812    /// The maximum length of the text mark in pixels. The text value will be automatically
1813    /// truncated if the rendered size exceeds the limit.
1814    ///
1815    /// __Default value:__ `0`, indicating no limit
1816    pub limit: Option<f64>,
1817    /// The overall opacity (value between [0,1]).
1818    ///
1819    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
1820    /// `square` marks or layered `bar` charts and `1` otherwise.
1821    pub opacity: Option<f64>,
1822    /// The orientation of a non-stacked bar, tick, area, and line charts.
1823    /// The value is either horizontal (default) or vertical.
1824    /// - For bar, rule and tick, this determines whether the size of the bar and tick
1825    /// should be applied to x or y dimension.
1826    /// - For area, this property determines the orient property of the Vega output.
1827    /// - For line and trail marks, this property determines the sort order of the points in the
1828    /// line
1829    /// if `config.sortLineBy` is not specified.
1830    /// For stacked charts, this is always determined by the orientation of the stack;
1831    /// therefore explicitly specified value will be ignored.
1832    pub orient: Option<Orient>,
1833    /// A flag for overlaying points on top of line or area marks, or an object defining the
1834    /// properties of the overlayed points.
1835    ///
1836    /// - If this property is `"transparent"`, transparent points will be used (for enhancing
1837    /// tooltips and selections).
1838    ///
1839    /// - If this property is an empty object (`{}`) or `true`, filled points with default
1840    /// properties will be used.
1841    ///
1842    /// - If this property is `false`, no points would be automatically added to line or area
1843    /// marks.
1844    ///
1845    /// __Default value:__ `false`.
1846    pub point: Option<PointUnion>,
1847    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
1848    /// by the `x` and `y` properties.
1849    pub radius: Option<f64>,
1850    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
1851    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
1852    ///
1853    /// __Default value:__ `"circle"`
1854    pub shape: Option<String>,
1855    /// The pixel area each the point/circle/square.
1856    /// For example: in the case of circles, the radius is determined in part by the square root
1857    /// of the size value.
1858    ///
1859    /// __Default value:__ `30`
1860    pub size: Option<f64>,
1861    /// Default Stroke Color.  This has higher precedence than `config.color`
1862    ///
1863    /// __Default value:__ (None)
1864    pub stroke: Option<String>,
1865    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
1866    ///
1867    /// __Default value:__ `"square"`
1868    #[serde(rename = "strokeCap")]
1869    pub stroke_cap: Option<StrokeCap>,
1870    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
1871    #[serde(rename = "strokeDash")]
1872    pub stroke_dash: Option<Vec<f64>>,
1873    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
1874    #[serde(rename = "strokeDashOffset")]
1875    pub stroke_dash_offset: Option<f64>,
1876    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
1877    ///
1878    /// __Default value:__ `"miter"`
1879    #[serde(rename = "strokeJoin")]
1880    pub stroke_join: Option<StrokeJoin>,
1881    /// The miter limit at which to bevel a line join.
1882    #[serde(rename = "strokeMiterLimit")]
1883    pub stroke_miter_limit: Option<f64>,
1884    /// The stroke opacity (value between [0,1]).
1885    ///
1886    /// __Default value:__ `1`
1887    #[serde(rename = "strokeOpacity")]
1888    pub stroke_opacity: Option<f64>,
1889    /// The stroke width, in pixels.
1890    #[serde(rename = "strokeWidth")]
1891    pub stroke_width: Option<f64>,
1892    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
1893    pub tension: Option<f64>,
1894    /// Placeholder text if the `text` channel is not specified
1895    pub text: Option<String>,
1896    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
1897    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
1898    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
1899    /// indicating "north".
1900    pub theta: Option<f64>,
1901    /// The tooltip text to show upon mouse hover.
1902    pub tooltip: Option<serde_json::Value>,
1903}
1904
1905#[derive(Debug, Serialize, Deserialize)]
1906pub struct PaddingClass {
1907    pub bottom: Option<f64>,
1908    pub left: Option<f64>,
1909    pub right: Option<f64>,
1910    pub top: Option<f64>,
1911}
1912
1913/// Projection configuration, which determines default properties for all
1914/// [projections](https://vega.github.io/vega-lite/docs/projection.html). For a full list of
1915/// projection configuration options, please see the [corresponding section of the projection
1916/// documentation](https://vega.github.io/vega-lite/docs/projection.html#config).
1917///
1918/// Any property of Projection can be in config
1919#[derive(Debug, Serialize, Deserialize)]
1920pub struct ProjectionConfig {
1921    /// Sets the projection’s center to the specified center, a two-element array of longitude
1922    /// and latitude in degrees.
1923    ///
1924    /// __Default value:__ `[0, 0]`
1925    pub center: Option<Vec<f64>>,
1926    /// Sets the projection’s clipping circle radius to the specified angle in degrees. If
1927    /// `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
1928    /// than small-circle clipping.
1929    #[serde(rename = "clipAngle")]
1930    pub clip_angle: Option<f64>,
1931    /// Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
1932    /// bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
1933    /// the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
1934    /// viewport clipping is performed.
1935    #[serde(rename = "clipExtent")]
1936    pub clip_extent: Option<Vec<Vec<f64>>>,
1937    pub coefficient: Option<f64>,
1938    pub distance: Option<f64>,
1939    pub fraction: Option<f64>,
1940    pub lobes: Option<f64>,
1941    pub parallel: Option<f64>,
1942    /// Sets the threshold for the projection’s [adaptive
1943    /// resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
1944    /// value corresponds to the [Douglas–Peucker
1945    /// distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
1946    /// If precision is not specified, returns the projection’s current resampling precision
1947    /// which defaults to `√0.5 ≅ 0.70710…`.
1948    pub precision: Option<HashMap<String, PrecisionValue>>,
1949    pub radius: Option<f64>,
1950    pub ratio: Option<f64>,
1951    /// Sets the projection’s three-axis rotation to the specified angles, which must be a two-
1952    /// or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
1953    /// angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
1954    ///
1955    /// __Default value:__ `[0, 0, 0]`
1956    pub rotate: Option<Vec<f64>>,
1957    pub spacing: Option<f64>,
1958    pub tilt: Option<f64>,
1959    /// The cartographic projection to use. This value is case-insensitive, for example
1960    /// `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
1961    /// projection types [in the
1962    /// documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
1963    ///
1964    /// __Default value:__ `mercator`
1965    #[serde(rename = "type")]
1966    pub projection_config_type: Option<VgProjectionType>,
1967}
1968
1969#[derive(Debug, Serialize, Deserialize)]
1970pub struct VgScheme {
1971    pub count: Option<f64>,
1972    pub extent: Option<Vec<f64>>,
1973    pub scheme: Option<String>,
1974    pub step: Option<f64>,
1975}
1976
1977/// Scale configuration determines default properties for all
1978/// [scales](https://vega.github.io/vega-lite/docs/scale.html). For a full list of scale
1979/// configuration options, please see the [corresponding section of the scale
1980/// documentation](https://vega.github.io/vega-lite/docs/scale.html#config).
1981#[derive(Debug, Serialize, Deserialize)]
1982pub struct ScaleConfig {
1983    /// Default inner padding for `x` and `y` band-ordinal scales.
1984    ///
1985    /// __Default value:__ `0.1`
1986    #[serde(rename = "bandPaddingInner")]
1987    pub band_padding_inner: Option<f64>,
1988    /// Default outer padding for `x` and `y` band-ordinal scales.
1989    /// If not specified, by default, band scale's paddingOuter is paddingInner/2.
1990    #[serde(rename = "bandPaddingOuter")]
1991    pub band_padding_outer: Option<f64>,
1992    /// If true, values that exceed the data domain are clamped to either the minimum or maximum
1993    /// range value
1994    pub clamp: Option<bool>,
1995    /// Default padding for continuous scales.
1996    ///
1997    /// __Default:__ `5` for continuous x-scale of a vertical bar and continuous y-scale of a
1998    /// horizontal bar.; `0` otherwise.
1999    #[serde(rename = "continuousPadding")]
2000    pub continuous_padding: Option<f64>,
2001    /// The default max value for mapping quantitative fields to bar's size/bandSize.
2002    ///
2003    /// If undefined (default), we will use the scale's `rangeStep` - 1.
2004    #[serde(rename = "maxBandSize")]
2005    pub max_band_size: Option<f64>,
2006    /// The default max value for mapping quantitative fields to text's size/fontSize.
2007    ///
2008    /// __Default value:__ `40`
2009    #[serde(rename = "maxFontSize")]
2010    pub max_font_size: Option<f64>,
2011    /// Default max opacity for mapping a field to opacity.
2012    ///
2013    /// __Default value:__ `0.8`
2014    #[serde(rename = "maxOpacity")]
2015    pub max_opacity: Option<f64>,
2016    /// Default max value for point size scale.
2017    #[serde(rename = "maxSize")]
2018    pub max_size: Option<f64>,
2019    /// Default max strokeWidth for the scale of strokeWidth for rule and line marks and of size
2020    /// for trail marks.
2021    ///
2022    /// __Default value:__ `4`
2023    #[serde(rename = "maxStrokeWidth")]
2024    pub max_stroke_width: Option<f64>,
2025    /// The default min value for mapping quantitative fields to bar and tick's size/bandSize
2026    /// scale with zero=false.
2027    ///
2028    /// __Default value:__ `2`
2029    #[serde(rename = "minBandSize")]
2030    pub min_band_size: Option<f64>,
2031    /// The default min value for mapping quantitative fields to tick's size/fontSize scale with
2032    /// zero=false
2033    ///
2034    /// __Default value:__ `8`
2035    #[serde(rename = "minFontSize")]
2036    pub min_font_size: Option<f64>,
2037    /// Default minimum opacity for mapping a field to opacity.
2038    ///
2039    /// __Default value:__ `0.3`
2040    #[serde(rename = "minOpacity")]
2041    pub min_opacity: Option<f64>,
2042    /// Default minimum value for point size scale with zero=false.
2043    ///
2044    /// __Default value:__ `9`
2045    #[serde(rename = "minSize")]
2046    pub min_size: Option<f64>,
2047    /// Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and of
2048    /// size for trail marks with zero=false.
2049    ///
2050    /// __Default value:__ `1`
2051    #[serde(rename = "minStrokeWidth")]
2052    pub min_stroke_width: Option<f64>,
2053    /// Default outer padding for `x` and `y` point-ordinal scales.
2054    ///
2055    /// __Default value:__ `0.5`
2056    #[serde(rename = "pointPadding")]
2057    pub point_padding: Option<f64>,
2058    /// Default range step for band and point scales of (1) the `y` channel
2059    /// and (2) the `x` channel when the mark is not `text`.
2060    ///
2061    /// __Default value:__ `21`
2062    #[serde(rename = "rangeStep")]
2063    pub range_step: Option<f64>,
2064    /// If true, rounds numeric output values to integers.
2065    /// This can be helpful for snapping to the pixel grid.
2066    /// (Only available for `x`, `y`, and `size` scales.)
2067    pub round: Option<bool>,
2068    /// Default range step for `x` band and point scales of text marks.
2069    ///
2070    /// __Default value:__ `90`
2071    #[serde(rename = "textXRangeStep")]
2072    pub text_x_range_step: Option<f64>,
2073    /// Use the source data range before aggregation as scale domain instead of aggregated data
2074    /// for aggregate axis.
2075    ///
2076    /// This is equivalent to setting `domain` to `"unaggregate"` for aggregated _quantitative_
2077    /// fields by default.
2078    ///
2079    /// This property only works with aggregate functions that produce values within the raw data
2080    /// domain (`"mean"`, `"average"`, `"median"`, `"q1"`, `"q3"`, `"min"`, `"max"`). For other
2081    /// aggregations that produce values outside of the raw data domain (e.g. `"count"`,
2082    /// `"sum"`), this property is ignored.
2083    ///
2084    /// __Default value:__ `false`
2085    #[serde(rename = "useUnaggregatedDomain")]
2086    pub use_unaggregated_domain: Option<bool>,
2087}
2088
2089/// An object hash for defining default properties for each type of selections.
2090#[derive(Debug, Serialize, Deserialize)]
2091pub struct SelectionConfig {
2092    /// The default definition for an
2093    /// [`interval`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All
2094    /// properties and transformations
2095    /// for an interval selection definition (except `type`) may be specified here.
2096    ///
2097    /// For instance, setting `interval` to `{"translate": false}` disables the ability to move
2098    /// interval selections by default.
2099    pub interval: Option<IntervalSelectionConfig>,
2100    /// The default definition for a
2101    /// [`multi`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All
2102    /// properties and transformations
2103    /// for a multi selection definition (except `type`) may be specified here.
2104    ///
2105    /// For instance, setting `multi` to `{"toggle": "event.altKey"}` adds additional values to
2106    /// multi selections when clicking with the alt-key pressed by default.
2107    pub multi: Option<MultiSelectionConfig>,
2108    /// The default definition for a
2109    /// [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All
2110    /// properties and transformations
2111    /// for a single selection definition (except `type`) may be specified here.
2112    ///
2113    /// For instance, setting `single` to `{"on": "dblclick"}` populates single selections on
2114    /// double-click by default.
2115    pub single: Option<SingleSelectionConfig>,
2116}
2117
2118/// The default definition for an
2119/// [`interval`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All
2120/// properties and transformations
2121/// for an interval selection definition (except `type`) may be specified here.
2122///
2123/// For instance, setting `interval` to `{"translate": false}` disables the ability to move
2124/// interval selections by default.
2125#[derive(Debug, Serialize, Deserialize)]
2126pub struct IntervalSelectionConfig {
2127    /// Establishes a two-way binding between the interval selection and the scales
2128    /// used within the same view. This allows a user to interactively pan and
2129    /// zoom the view.
2130    pub bind: Option<BindEnum>,
2131    /// By default, all data values are considered to lie within an empty selection.
2132    /// When set to `none`, empty selections contain no data values.
2133    pub empty: Option<VgLayoutAlign>,
2134    /// An array of encoding channels. The corresponding data field values
2135    /// must match for a data tuple to fall within the selection.
2136    pub encodings: Option<Vec<SingleDefChannel>>,
2137    /// An array of field names whose values must match for a data tuple to
2138    /// fall within the selection.
2139    pub fields: Option<Vec<String>>,
2140    /// An interval selection also adds a rectangle mark to depict the
2141    /// extents of the interval. The `mark` property can be used to customize the
2142    /// appearance of the mark.
2143    pub mark: Option<BrushConfig>,
2144    /// A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
2145    /// selector) that triggers the selection.
2146    /// For interval selections, the event stream must specify a [start and
2147    /// end](https://vega.github.io/vega/docs/event-streams/#between-filters).
2148    pub on: Option<serde_json::Value>,
2149    /// With layered and multi-view displays, a strategy that determines how
2150    /// selections' data queries are resolved when applied in a filter transform,
2151    /// conditional encoding rule, or scale domain.
2152    pub resolve: Option<SelectionResolution>,
2153    /// When truthy, allows a user to interactively move an interval selection
2154    /// back-and-forth. Can be `true`, `false` (to disable panning), or a
2155    /// [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)
2156    /// which must include a start and end event to trigger continuous panning.
2157    ///
2158    /// __Default value:__ `true`, which corresponds to
2159    /// `[mousedown, window:mouseup] > window:mousemove!` which corresponds to
2160    /// clicks and dragging within an interval selection to reposition it.
2161    pub translate: Option<Translate>,
2162    /// When truthy, allows a user to interactively resize an interval selection.
2163    /// Can be `true`, `false` (to disable zooming), or a [Vega event stream
2164    /// definition](https://vega.github.io/vega/docs/event-streams/). Currently,
2165    /// only `wheel` events are supported.
2166    ///
2167    ///
2168    /// __Default value:__ `true`, which corresponds to `wheel!`.
2169    pub zoom: Option<Translate>,
2170}
2171
2172/// An interval selection also adds a rectangle mark to depict the
2173/// extents of the interval. The `mark` property can be used to customize the
2174/// appearance of the mark.
2175#[derive(Debug, Serialize, Deserialize)]
2176pub struct BrushConfig {
2177    /// The fill color of the interval mark.
2178    ///
2179    /// __Default value:__ `#333333`
2180    pub fill: Option<String>,
2181    /// The fill opacity of the interval mark (a value between 0 and 1).
2182    ///
2183    /// __Default value:__ `0.125`
2184    #[serde(rename = "fillOpacity")]
2185    pub fill_opacity: Option<f64>,
2186    /// The stroke color of the interval mark.
2187    ///
2188    /// __Default value:__ `#ffffff`
2189    pub stroke: Option<String>,
2190    /// An array of alternating stroke and space lengths,
2191    /// for creating dashed or dotted lines.
2192    #[serde(rename = "strokeDash")]
2193    pub stroke_dash: Option<Vec<f64>>,
2194    /// The offset (in pixels) with which to begin drawing the stroke dash array.
2195    #[serde(rename = "strokeDashOffset")]
2196    pub stroke_dash_offset: Option<f64>,
2197    /// The stroke opacity of the interval mark (a value between 0 and 1).
2198    #[serde(rename = "strokeOpacity")]
2199    pub stroke_opacity: Option<f64>,
2200    /// The stroke width of the interval mark.
2201    #[serde(rename = "strokeWidth")]
2202    pub stroke_width: Option<f64>,
2203}
2204
2205/// The default definition for a
2206/// [`multi`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All
2207/// properties and transformations
2208/// for a multi selection definition (except `type`) may be specified here.
2209///
2210/// For instance, setting `multi` to `{"toggle": "event.altKey"}` adds additional values to
2211/// multi selections when clicking with the alt-key pressed by default.
2212#[derive(Debug, Serialize, Deserialize)]
2213pub struct MultiSelectionConfig {
2214    /// By default, all data values are considered to lie within an empty selection.
2215    /// When set to `none`, empty selections contain no data values.
2216    pub empty: Option<VgLayoutAlign>,
2217    /// An array of encoding channels. The corresponding data field values
2218    /// must match for a data tuple to fall within the selection.
2219    pub encodings: Option<Vec<SingleDefChannel>>,
2220    /// An array of field names whose values must match for a data tuple to
2221    /// fall within the selection.
2222    pub fields: Option<Vec<String>>,
2223    /// When true, an invisible voronoi diagram is computed to accelerate discrete
2224    /// selection. The data value _nearest_ the mouse cursor is added to the selection.
2225    ///
2226    /// See the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html)
2227    /// documentation for more information.
2228    pub nearest: Option<bool>,
2229    /// A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
2230    /// selector) that triggers the selection.
2231    /// For interval selections, the event stream must specify a [start and
2232    /// end](https://vega.github.io/vega/docs/event-streams/#between-filters).
2233    pub on: Option<serde_json::Value>,
2234    /// With layered and multi-view displays, a strategy that determines how
2235    /// selections' data queries are resolved when applied in a filter transform,
2236    /// conditional encoding rule, or scale domain.
2237    pub resolve: Option<SelectionResolution>,
2238    /// Controls whether data values should be toggled or only ever inserted into
2239    /// multi selections. Can be `true`, `false` (for insertion only), or a
2240    /// [Vega expression](https://vega.github.io/vega/docs/expressions/).
2241    ///
2242    /// __Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,
2243    /// data values are toggled when a user interacts with the shift-key pressed).
2244    ///
2245    /// See the [toggle transform](https://vega.github.io/vega-lite/docs/toggle.html)
2246    /// documentation for more information.
2247    pub toggle: Option<Translate>,
2248}
2249
2250/// The default definition for a
2251/// [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All
2252/// properties and transformations
2253/// for a single selection definition (except `type`) may be specified here.
2254///
2255/// For instance, setting `single` to `{"on": "dblclick"}` populates single selections on
2256/// double-click by default.
2257#[derive(Debug, Serialize, Deserialize)]
2258pub struct SingleSelectionConfig {
2259    /// Establish a two-way binding between a single selection and input elements
2260    /// (also known as dynamic query widgets). A binding takes the form of
2261    /// Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)
2262    /// or can be a mapping between projected field/encodings and binding definitions.
2263    ///
2264    /// See the [bind transform](https://vega.github.io/vega-lite/docs/bind.html) documentation
2265    /// for more information.
2266    pub bind: Option<HashMap<String, BindValue>>,
2267    /// By default, all data values are considered to lie within an empty selection.
2268    /// When set to `none`, empty selections contain no data values.
2269    pub empty: Option<VgLayoutAlign>,
2270    /// An array of encoding channels. The corresponding data field values
2271    /// must match for a data tuple to fall within the selection.
2272    pub encodings: Option<Vec<SingleDefChannel>>,
2273    /// An array of field names whose values must match for a data tuple to
2274    /// fall within the selection.
2275    pub fields: Option<Vec<String>>,
2276    /// When true, an invisible voronoi diagram is computed to accelerate discrete
2277    /// selection. The data value _nearest_ the mouse cursor is added to the selection.
2278    ///
2279    /// See the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html)
2280    /// documentation for more information.
2281    pub nearest: Option<bool>,
2282    /// A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
2283    /// selector) that triggers the selection.
2284    /// For interval selections, the event stream must specify a [start and
2285    /// end](https://vega.github.io/vega/docs/event-streams/#between-filters).
2286    pub on: Option<serde_json::Value>,
2287    /// With layered and multi-view displays, a strategy that determines how
2288    /// selections' data queries are resolved when applied in a filter transform,
2289    /// conditional encoding rule, or scale domain.
2290    pub resolve: Option<SelectionResolution>,
2291}
2292
2293#[derive(Debug, Serialize, Deserialize)]
2294pub struct VgBinding {
2295    pub element: Option<String>,
2296    pub input: String,
2297    pub options: Option<Vec<String>>,
2298    pub max: Option<f64>,
2299    pub min: Option<f64>,
2300    pub step: Option<f64>,
2301}
2302
2303#[derive(Debug, Serialize, Deserialize)]
2304pub struct VgMarkConfig {
2305    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
2306    pub align: Option<HorizontalAlign>,
2307    /// The rotation angle of the text, in degrees.
2308    pub angle: Option<f64>,
2309    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
2310    ///
2311    /// __Default value:__ `"middle"`
2312    pub baseline: Option<VerticalAlign>,
2313    /// The radius in pixels of rounded rectangle corners.
2314    ///
2315    /// __Default value:__ `0`
2316    #[serde(rename = "cornerRadius")]
2317    pub corner_radius: Option<f64>,
2318    /// The mouse cursor used over the mark. Any valid [CSS cursor
2319    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
2320    pub cursor: Option<Cursor>,
2321    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
2322    /// This property determines on which side is truncated in response to the limit parameter.
2323    ///
2324    /// __Default value:__ `"ltr"`
2325    pub dir: Option<Dir>,
2326    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
2327    /// is applied after rotation by the _angle_ property.
2328    pub dx: Option<f64>,
2329    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
2330    /// is applied after rotation by the _angle_ property.
2331    pub dy: Option<f64>,
2332    /// The ellipsis string for text truncated in response to the limit parameter.
2333    ///
2334    /// __Default value:__ `"…"`
2335    pub ellipsis: Option<String>,
2336    /// Default Fill Color.  This has higher precedence than `config.color`
2337    ///
2338    /// __Default value:__ (None)
2339    pub fill: Option<String>,
2340    /// The fill opacity (value between [0,1]).
2341    ///
2342    /// __Default value:__ `1`
2343    #[serde(rename = "fillOpacity")]
2344    pub fill_opacity: Option<f64>,
2345    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
2346    pub font: Option<String>,
2347    /// The font size, in pixels.
2348    #[serde(rename = "fontSize")]
2349    pub font_size: Option<f64>,
2350    /// The font style (e.g., `"italic"`).
2351    #[serde(rename = "fontStyle")]
2352    pub font_style: Option<FontStyle>,
2353    /// The font weight.
2354    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
2355    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
2356    #[serde(rename = "fontWeight")]
2357    pub font_weight: Option<FontWeight>,
2358    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
2359    pub href: Option<String>,
2360    /// The line interpolation method to use for line and area marks. One of the following:
2361    /// - `"linear"`: piecewise linear segments, as in a polyline.
2362    /// - `"linear-closed"`: close the linear segments to form a polygon.
2363    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
2364    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
2365    /// function.
2366    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
2367    /// function.
2368    /// - `"basis"`: a B-spline, with control point duplication on the ends.
2369    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
2370    /// - `"basis-closed"`: a closed B-spline, as in a loop.
2371    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
2372    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
2373    /// will intersect other control points.
2374    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
2375    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
2376    /// spline.
2377    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
2378    pub interpolate: Option<Interpolate>,
2379    /// The maximum length of the text mark in pixels. The text value will be automatically
2380    /// truncated if the rendered size exceeds the limit.
2381    ///
2382    /// __Default value:__ `0`, indicating no limit
2383    pub limit: Option<f64>,
2384    /// The overall opacity (value between [0,1]).
2385    ///
2386    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
2387    /// `square` marks or layered `bar` charts and `1` otherwise.
2388    pub opacity: Option<f64>,
2389    /// The orientation of a non-stacked bar, tick, area, and line charts.
2390    /// The value is either horizontal (default) or vertical.
2391    /// - For bar, rule and tick, this determines whether the size of the bar and tick
2392    /// should be applied to x or y dimension.
2393    /// - For area, this property determines the orient property of the Vega output.
2394    /// - For line and trail marks, this property determines the sort order of the points in the
2395    /// line
2396    /// if `config.sortLineBy` is not specified.
2397    /// For stacked charts, this is always determined by the orientation of the stack;
2398    /// therefore explicitly specified value will be ignored.
2399    pub orient: Option<Orient>,
2400    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
2401    /// by the `x` and `y` properties.
2402    pub radius: Option<f64>,
2403    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
2404    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
2405    ///
2406    /// __Default value:__ `"circle"`
2407    pub shape: Option<String>,
2408    /// The pixel area each the point/circle/square.
2409    /// For example: in the case of circles, the radius is determined in part by the square root
2410    /// of the size value.
2411    ///
2412    /// __Default value:__ `30`
2413    pub size: Option<f64>,
2414    /// Default Stroke Color.  This has higher precedence than `config.color`
2415    ///
2416    /// __Default value:__ (None)
2417    pub stroke: Option<String>,
2418    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
2419    ///
2420    /// __Default value:__ `"square"`
2421    #[serde(rename = "strokeCap")]
2422    pub stroke_cap: Option<StrokeCap>,
2423    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
2424    #[serde(rename = "strokeDash")]
2425    pub stroke_dash: Option<Vec<f64>>,
2426    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
2427    #[serde(rename = "strokeDashOffset")]
2428    pub stroke_dash_offset: Option<f64>,
2429    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
2430    ///
2431    /// __Default value:__ `"miter"`
2432    #[serde(rename = "strokeJoin")]
2433    pub stroke_join: Option<StrokeJoin>,
2434    /// The miter limit at which to bevel a line join.
2435    #[serde(rename = "strokeMiterLimit")]
2436    pub stroke_miter_limit: Option<f64>,
2437    /// The stroke opacity (value between [0,1]).
2438    ///
2439    /// __Default value:__ `1`
2440    #[serde(rename = "strokeOpacity")]
2441    pub stroke_opacity: Option<f64>,
2442    /// The stroke width, in pixels.
2443    #[serde(rename = "strokeWidth")]
2444    pub stroke_width: Option<f64>,
2445    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
2446    pub tension: Option<f64>,
2447    /// Placeholder text if the `text` channel is not specified
2448    pub text: Option<String>,
2449    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
2450    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
2451    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
2452    /// indicating "north".
2453    pub theta: Option<f64>,
2454    /// The tooltip text to show upon mouse hover.
2455    pub tooltip: Option<serde_json::Value>,
2456}
2457
2458/// Text-Specific Config
2459#[derive(Debug, Serialize, Deserialize)]
2460pub struct TextConfig {
2461    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
2462    pub align: Option<HorizontalAlign>,
2463    /// The rotation angle of the text, in degrees.
2464    pub angle: Option<f64>,
2465    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
2466    ///
2467    /// __Default value:__ `"middle"`
2468    pub baseline: Option<VerticalAlign>,
2469    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
2470    /// will override `color`.
2471    ///
2472    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
2473    ///
2474    /// __Note:__ This property cannot be used in a [style
2475    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
2476    pub color: Option<String>,
2477    /// The radius in pixels of rounded rectangle corners.
2478    ///
2479    /// __Default value:__ `0`
2480    #[serde(rename = "cornerRadius")]
2481    pub corner_radius: Option<f64>,
2482    /// The mouse cursor used over the mark. Any valid [CSS cursor
2483    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
2484    pub cursor: Option<Cursor>,
2485    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
2486    /// This property determines on which side is truncated in response to the limit parameter.
2487    ///
2488    /// __Default value:__ `"ltr"`
2489    pub dir: Option<Dir>,
2490    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
2491    /// is applied after rotation by the _angle_ property.
2492    pub dx: Option<f64>,
2493    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
2494    /// is applied after rotation by the _angle_ property.
2495    pub dy: Option<f64>,
2496    /// The ellipsis string for text truncated in response to the limit parameter.
2497    ///
2498    /// __Default value:__ `"…"`
2499    pub ellipsis: Option<String>,
2500    /// Default Fill Color.  This has higher precedence than `config.color`
2501    ///
2502    /// __Default value:__ (None)
2503    pub fill: Option<String>,
2504    /// Whether the mark's color should be used as fill color instead of stroke color.
2505    ///
2506    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
2507    ///
2508    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
2509    ///
2510    /// __Note:__ This property cannot be used in a [style
2511    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
2512    pub filled: Option<bool>,
2513    /// The fill opacity (value between [0,1]).
2514    ///
2515    /// __Default value:__ `1`
2516    #[serde(rename = "fillOpacity")]
2517    pub fill_opacity: Option<f64>,
2518    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
2519    pub font: Option<String>,
2520    /// The font size, in pixels.
2521    #[serde(rename = "fontSize")]
2522    pub font_size: Option<f64>,
2523    /// The font style (e.g., `"italic"`).
2524    #[serde(rename = "fontStyle")]
2525    pub font_style: Option<FontStyle>,
2526    /// The font weight.
2527    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
2528    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
2529    #[serde(rename = "fontWeight")]
2530    pub font_weight: Option<FontWeight>,
2531    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
2532    pub href: Option<String>,
2533    /// The line interpolation method to use for line and area marks. One of the following:
2534    /// - `"linear"`: piecewise linear segments, as in a polyline.
2535    /// - `"linear-closed"`: close the linear segments to form a polygon.
2536    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
2537    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
2538    /// function.
2539    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
2540    /// function.
2541    /// - `"basis"`: a B-spline, with control point duplication on the ends.
2542    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
2543    /// - `"basis-closed"`: a closed B-spline, as in a loop.
2544    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
2545    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
2546    /// will intersect other control points.
2547    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
2548    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
2549    /// spline.
2550    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
2551    pub interpolate: Option<Interpolate>,
2552    /// The maximum length of the text mark in pixels. The text value will be automatically
2553    /// truncated if the rendered size exceeds the limit.
2554    ///
2555    /// __Default value:__ `0`, indicating no limit
2556    pub limit: Option<f64>,
2557    /// The overall opacity (value between [0,1]).
2558    ///
2559    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
2560    /// `square` marks or layered `bar` charts and `1` otherwise.
2561    pub opacity: Option<f64>,
2562    /// The orientation of a non-stacked bar, tick, area, and line charts.
2563    /// The value is either horizontal (default) or vertical.
2564    /// - For bar, rule and tick, this determines whether the size of the bar and tick
2565    /// should be applied to x or y dimension.
2566    /// - For area, this property determines the orient property of the Vega output.
2567    /// - For line and trail marks, this property determines the sort order of the points in the
2568    /// line
2569    /// if `config.sortLineBy` is not specified.
2570    /// For stacked charts, this is always determined by the orientation of the stack;
2571    /// therefore explicitly specified value will be ignored.
2572    pub orient: Option<Orient>,
2573    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
2574    /// by the `x` and `y` properties.
2575    pub radius: Option<f64>,
2576    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
2577    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
2578    ///
2579    /// __Default value:__ `"circle"`
2580    pub shape: Option<String>,
2581    /// Whether month names and weekday names should be abbreviated.
2582    #[serde(rename = "shortTimeLabels")]
2583    pub short_time_labels: Option<bool>,
2584    /// The pixel area each the point/circle/square.
2585    /// For example: in the case of circles, the radius is determined in part by the square root
2586    /// of the size value.
2587    ///
2588    /// __Default value:__ `30`
2589    pub size: Option<f64>,
2590    /// Default Stroke Color.  This has higher precedence than `config.color`
2591    ///
2592    /// __Default value:__ (None)
2593    pub stroke: Option<String>,
2594    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
2595    ///
2596    /// __Default value:__ `"square"`
2597    #[serde(rename = "strokeCap")]
2598    pub stroke_cap: Option<StrokeCap>,
2599    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
2600    #[serde(rename = "strokeDash")]
2601    pub stroke_dash: Option<Vec<f64>>,
2602    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
2603    #[serde(rename = "strokeDashOffset")]
2604    pub stroke_dash_offset: Option<f64>,
2605    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
2606    ///
2607    /// __Default value:__ `"miter"`
2608    #[serde(rename = "strokeJoin")]
2609    pub stroke_join: Option<StrokeJoin>,
2610    /// The miter limit at which to bevel a line join.
2611    #[serde(rename = "strokeMiterLimit")]
2612    pub stroke_miter_limit: Option<f64>,
2613    /// The stroke opacity (value between [0,1]).
2614    ///
2615    /// __Default value:__ `1`
2616    #[serde(rename = "strokeOpacity")]
2617    pub stroke_opacity: Option<f64>,
2618    /// The stroke width, in pixels.
2619    #[serde(rename = "strokeWidth")]
2620    pub stroke_width: Option<f64>,
2621    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
2622    pub tension: Option<f64>,
2623    /// Placeholder text if the `text` channel is not specified
2624    pub text: Option<String>,
2625    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
2626    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
2627    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
2628    /// indicating "north".
2629    pub theta: Option<f64>,
2630    /// The tooltip text to show upon mouse hover.
2631    pub tooltip: Option<serde_json::Value>,
2632}
2633
2634/// Tick-Specific Config
2635#[derive(Debug, Serialize, Deserialize)]
2636pub struct TickConfig {
2637    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
2638    pub align: Option<HorizontalAlign>,
2639    /// The rotation angle of the text, in degrees.
2640    pub angle: Option<f64>,
2641    /// The width of the ticks.
2642    ///
2643    /// __Default value:__  2/3 of rangeStep.
2644    #[serde(rename = "bandSize")]
2645    pub band_size: Option<f64>,
2646    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
2647    ///
2648    /// __Default value:__ `"middle"`
2649    pub baseline: Option<VerticalAlign>,
2650    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
2651    /// will override `color`.
2652    ///
2653    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
2654    ///
2655    /// __Note:__ This property cannot be used in a [style
2656    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
2657    pub color: Option<String>,
2658    /// The radius in pixels of rounded rectangle corners.
2659    ///
2660    /// __Default value:__ `0`
2661    #[serde(rename = "cornerRadius")]
2662    pub corner_radius: Option<f64>,
2663    /// The mouse cursor used over the mark. Any valid [CSS cursor
2664    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
2665    pub cursor: Option<Cursor>,
2666    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
2667    /// This property determines on which side is truncated in response to the limit parameter.
2668    ///
2669    /// __Default value:__ `"ltr"`
2670    pub dir: Option<Dir>,
2671    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
2672    /// is applied after rotation by the _angle_ property.
2673    pub dx: Option<f64>,
2674    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
2675    /// is applied after rotation by the _angle_ property.
2676    pub dy: Option<f64>,
2677    /// The ellipsis string for text truncated in response to the limit parameter.
2678    ///
2679    /// __Default value:__ `"…"`
2680    pub ellipsis: Option<String>,
2681    /// Default Fill Color.  This has higher precedence than `config.color`
2682    ///
2683    /// __Default value:__ (None)
2684    pub fill: Option<String>,
2685    /// Whether the mark's color should be used as fill color instead of stroke color.
2686    ///
2687    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
2688    ///
2689    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
2690    ///
2691    /// __Note:__ This property cannot be used in a [style
2692    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
2693    pub filled: Option<bool>,
2694    /// The fill opacity (value between [0,1]).
2695    ///
2696    /// __Default value:__ `1`
2697    #[serde(rename = "fillOpacity")]
2698    pub fill_opacity: Option<f64>,
2699    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
2700    pub font: Option<String>,
2701    /// The font size, in pixels.
2702    #[serde(rename = "fontSize")]
2703    pub font_size: Option<f64>,
2704    /// The font style (e.g., `"italic"`).
2705    #[serde(rename = "fontStyle")]
2706    pub font_style: Option<FontStyle>,
2707    /// The font weight.
2708    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
2709    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
2710    #[serde(rename = "fontWeight")]
2711    pub font_weight: Option<FontWeight>,
2712    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
2713    pub href: Option<String>,
2714    /// The line interpolation method to use for line and area marks. One of the following:
2715    /// - `"linear"`: piecewise linear segments, as in a polyline.
2716    /// - `"linear-closed"`: close the linear segments to form a polygon.
2717    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
2718    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
2719    /// function.
2720    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
2721    /// function.
2722    /// - `"basis"`: a B-spline, with control point duplication on the ends.
2723    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
2724    /// - `"basis-closed"`: a closed B-spline, as in a loop.
2725    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
2726    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
2727    /// will intersect other control points.
2728    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
2729    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
2730    /// spline.
2731    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
2732    pub interpolate: Option<Interpolate>,
2733    /// The maximum length of the text mark in pixels. The text value will be automatically
2734    /// truncated if the rendered size exceeds the limit.
2735    ///
2736    /// __Default value:__ `0`, indicating no limit
2737    pub limit: Option<f64>,
2738    /// The overall opacity (value between [0,1]).
2739    ///
2740    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
2741    /// `square` marks or layered `bar` charts and `1` otherwise.
2742    pub opacity: Option<f64>,
2743    /// The orientation of a non-stacked bar, tick, area, and line charts.
2744    /// The value is either horizontal (default) or vertical.
2745    /// - For bar, rule and tick, this determines whether the size of the bar and tick
2746    /// should be applied to x or y dimension.
2747    /// - For area, this property determines the orient property of the Vega output.
2748    /// - For line and trail marks, this property determines the sort order of the points in the
2749    /// line
2750    /// if `config.sortLineBy` is not specified.
2751    /// For stacked charts, this is always determined by the orientation of the stack;
2752    /// therefore explicitly specified value will be ignored.
2753    pub orient: Option<Orient>,
2754    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
2755    /// by the `x` and `y` properties.
2756    pub radius: Option<f64>,
2757    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
2758    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
2759    ///
2760    /// __Default value:__ `"circle"`
2761    pub shape: Option<String>,
2762    /// The pixel area each the point/circle/square.
2763    /// For example: in the case of circles, the radius is determined in part by the square root
2764    /// of the size value.
2765    ///
2766    /// __Default value:__ `30`
2767    pub size: Option<f64>,
2768    /// Default Stroke Color.  This has higher precedence than `config.color`
2769    ///
2770    /// __Default value:__ (None)
2771    pub stroke: Option<String>,
2772    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
2773    ///
2774    /// __Default value:__ `"square"`
2775    #[serde(rename = "strokeCap")]
2776    pub stroke_cap: Option<StrokeCap>,
2777    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
2778    #[serde(rename = "strokeDash")]
2779    pub stroke_dash: Option<Vec<f64>>,
2780    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
2781    #[serde(rename = "strokeDashOffset")]
2782    pub stroke_dash_offset: Option<f64>,
2783    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
2784    ///
2785    /// __Default value:__ `"miter"`
2786    #[serde(rename = "strokeJoin")]
2787    pub stroke_join: Option<StrokeJoin>,
2788    /// The miter limit at which to bevel a line join.
2789    #[serde(rename = "strokeMiterLimit")]
2790    pub stroke_miter_limit: Option<f64>,
2791    /// The stroke opacity (value between [0,1]).
2792    ///
2793    /// __Default value:__ `1`
2794    #[serde(rename = "strokeOpacity")]
2795    pub stroke_opacity: Option<f64>,
2796    /// The stroke width, in pixels.
2797    #[serde(rename = "strokeWidth")]
2798    pub stroke_width: Option<f64>,
2799    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
2800    pub tension: Option<f64>,
2801    /// Placeholder text if the `text` channel is not specified
2802    pub text: Option<String>,
2803    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
2804    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
2805    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
2806    /// indicating "north".
2807    pub theta: Option<f64>,
2808    /// Thickness of the tick mark.
2809    ///
2810    /// __Default value:__  `1`
2811    pub thickness: Option<f64>,
2812    /// The tooltip text to show upon mouse hover.
2813    pub tooltip: Option<serde_json::Value>,
2814}
2815
2816/// Title configuration, which determines default properties for all
2817/// [titles](https://vega.github.io/vega-lite/docs/title.html). For a full list of title
2818/// configuration options, please see the [corresponding section of the title
2819/// documentation](https://vega.github.io/vega-lite/docs/title.html#config).
2820#[derive(Debug, Serialize, Deserialize)]
2821pub struct VgTitleConfig {
2822    /// The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
2823    /// example, with an orientation of top these anchor positions map to a left-, center-, or
2824    /// right-aligned title.
2825    ///
2826    /// __Default value:__ `"middle"` for
2827    /// [single](https://vega.github.io/vega-lite/docs/spec.html) and
2828    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.
2829    /// `"start"` for other composite views.
2830    ///
2831    /// __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
2832    /// customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and
2833    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.  For other composite
2834    /// views, `anchor` is always `"start"`.
2835    pub anchor: Option<Anchor>,
2836    /// Angle in degrees of title text.
2837    pub angle: Option<f64>,
2838    /// Vertical text baseline for title text.
2839    pub baseline: Option<VerticalAlign>,
2840    /// Text color for title text.
2841    pub color: Option<String>,
2842    /// Font name for title text.
2843    pub font: Option<String>,
2844    /// Font size in pixels for title text.
2845    ///
2846    /// __Default value:__ `10`.
2847    #[serde(rename = "fontSize")]
2848    pub font_size: Option<f64>,
2849    /// Font weight for title text.
2850    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
2851    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
2852    #[serde(rename = "fontWeight")]
2853    pub font_weight: Option<FontWeight>,
2854    /// The maximum allowed length in pixels of legend labels.
2855    pub limit: Option<f64>,
2856    /// Offset in pixels of the title from the chart body and axes.
2857    pub offset: Option<f64>,
2858    /// Default title orientation ("top", "bottom", "left", or "right")
2859    pub orient: Option<TitleOrient>,
2860}
2861
2862/// Default properties for [single view
2863/// plots](https://vega.github.io/vega-lite/docs/spec.html#single).
2864#[derive(Debug, Serialize, Deserialize)]
2865pub struct ViewConfig {
2866    /// Whether the view should be clipped.
2867    pub clip: Option<bool>,
2868    /// The fill color.
2869    ///
2870    /// __Default value:__ (none)
2871    pub fill: Option<String>,
2872    /// The fill opacity (value between [0,1]).
2873    ///
2874    /// __Default value:__ (none)
2875    #[serde(rename = "fillOpacity")]
2876    pub fill_opacity: Option<f64>,
2877    /// The default height of the single plot or each plot in a trellis plot when the
2878    /// visualization has a continuous (non-ordinal) y-scale with `rangeStep` = `null`.
2879    ///
2880    /// __Default value:__ `200`
2881    pub height: Option<f64>,
2882    /// The stroke color.
2883    ///
2884    /// __Default value:__ (none)
2885    pub stroke: Option<String>,
2886    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
2887    ///
2888    /// __Default value:__ (none)
2889    #[serde(rename = "strokeDash")]
2890    pub stroke_dash: Option<Vec<f64>>,
2891    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
2892    ///
2893    /// __Default value:__ (none)
2894    #[serde(rename = "strokeDashOffset")]
2895    pub stroke_dash_offset: Option<f64>,
2896    /// The stroke line join method. One of miter (default), round or bevel.
2897    ///
2898    /// __Default value:__ 'miter'
2899    #[serde(rename = "strokeJoin")]
2900    pub stroke_join: Option<StrokeJoin>,
2901    /// The stroke line join method. One of miter (default), round or bevel.
2902    ///
2903    /// __Default value:__ 'miter'
2904    #[serde(rename = "strokeMiterLimit")]
2905    pub stroke_miter_limit: Option<f64>,
2906    /// The stroke opacity (value between [0,1]).
2907    ///
2908    /// __Default value:__ (none)
2909    #[serde(rename = "strokeOpacity")]
2910    pub stroke_opacity: Option<f64>,
2911    /// The stroke width, in pixels.
2912    ///
2913    /// __Default value:__ (none)
2914    #[serde(rename = "strokeWidth")]
2915    pub stroke_width: Option<f64>,
2916    /// The default width of the single plot or each plot in a trellis plot when the
2917    /// visualization has a continuous (non-ordinal) x-scale or ordinal x-scale with `rangeStep`
2918    /// = `null`.
2919    ///
2920    /// __Default value:__ `200`
2921    pub width: Option<f64>,
2922}
2923
2924/// An object describing the data source
2925///
2926/// Secondary data source to lookup in.
2927#[derive(Debug, Serialize, Deserialize)]
2928pub struct Data {
2929    /// An object that specifies the format for parsing the data.
2930    pub format: Option<DataFormat>,
2931    /// Provide a placeholder name and bind data at runtime.
2932    pub name: Option<String>,
2933    /// An URL from which to load the data set. Use the `format.type` property
2934    /// to ensure the loaded data is correctly parsed.
2935    pub url: Option<String>,
2936    /// The full data set, included inline. This can be an array of objects or primitive values,
2937    /// an object, or a string.
2938    /// Arrays of primitive values are ingested as objects with a `data` property. Strings are
2939    /// parsed according to the specified format type.
2940    pub values: Option<DataInlineDataset>,
2941}
2942
2943/// An object that specifies the format for parsing the data.
2944#[derive(Debug, Serialize, Deserialize)]
2945pub struct DataFormat {
2946    /// If set to `"auto"` (the default), perform automatic type inference to determine the
2947    /// desired data types.
2948    /// If set to `null`, disable type inference based on the spec and only use type inference
2949    /// based on the data.
2950    /// Alternatively, a parsing directive object can be provided for explicit data types. Each
2951    /// property of the object corresponds to a field name, and the value to the desired data
2952    /// type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)).
2953    /// For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each
2954    /// input record a Date value.
2955    ///
2956    /// For `"date"`, we parse data based using Javascript's
2957    /// [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
2958    /// For Specific date formats can be provided (e.g., `{foo: 'date:"%m%d%Y"'}`), using the
2959    /// [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date
2960    /// format parsing is supported similarly (e.g., `{foo: 'utc:"%m%d%Y"'}`). See more about
2961    /// [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)
2962    pub parse: Option<Parse>,
2963    /// Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.
2964    /// The default format type is determined by the extension of the file URL.
2965    /// If no extension is detected, `"json"` will be used by default.
2966    #[serde(rename = "type")]
2967    pub data_format_type: Option<DataFormatType>,
2968    /// The delimiter between records. The delimiter must be a single character (i.e., a single
2969    /// 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.
2970    pub delimiter: Option<String>,
2971    /// The JSON property containing the desired data.
2972    /// This parameter can be used when the loaded JSON file may have surrounding structure or
2973    /// meta-data.
2974    /// For example `"property": "values.features"` is equivalent to retrieving
2975    /// `json.values.features`
2976    /// from the loaded JSON object.
2977    pub property: Option<String>,
2978    /// The name of the TopoJSON object set to convert to a GeoJSON feature collection.
2979    /// For example, in a map of the world, there may be an object set named `"countries"`.
2980    /// Using the feature property, we can extract this set and generate a GeoJSON feature object
2981    /// for each country.
2982    pub feature: Option<String>,
2983    /// The name of the TopoJSON object set to convert to mesh.
2984    /// Similar to the `feature` option, `mesh` extracts a named TopoJSON object set.
2985    /// Unlike the `feature` option, the corresponding geo data is returned as a single, unified
2986    /// mesh instance, not as individual GeoJSON features.
2987    /// Extracting a mesh is useful for more efficiently drawing borders or other geographic
2988    /// elements that you do not need to associate with specific regions such as individual
2989    /// countries, states or counties.
2990    pub mesh: Option<String>,
2991}
2992
2993/// A key-value mapping between encoding channels and definition of fields.
2994///
2995/// A shared key-value mapping between encoding channels and definition of fields in the
2996/// underlying layers.
2997#[derive(Debug, Serialize, Deserialize)]
2998pub struct Encoding {
2999    /// Color of the marks – either fill or stroke color based on  the `filled` property of mark
3000    /// definition.
3001    /// By default, `color` represents fill color for `"area"`, `"bar"`, `"tick"`,
3002    /// `"text"`, `"trail"`, `"circle"`, and `"square"` / stroke color for `"line"` and
3003    /// `"point"`.
3004    ///
3005    /// __Default value:__ If undefined, the default color depends on [mark
3006    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
3007    ///
3008    /// _Note:_
3009    /// 1) For fine-grained control over both fill and stroke colors of the marks, please use the
3010    /// `fill` and `stroke` channels.  If either `fill` or `stroke` channel is specified, `color`
3011    /// channel will be ignored.
3012    /// 2) See the scale documentation for more information about customizing [color
3013    /// scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme).
3014    pub color: Option<MarkPropDefWithCondition>,
3015    /// Horizontal facets for trellis plots.
3016    pub column: Option<FacetFieldDef>,
3017    /// Additional levels of detail for grouping data in aggregate views and
3018    /// in line, trail, and area marks without mapping data to a specific visual channel.
3019    pub detail: Option<Detail>,
3020    /// Fill color of the marks.
3021    /// __Default value:__ If undefined, the default color depends on [mark
3022    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
3023    ///
3024    /// _Note:_ When using `fill` channel, `color ` channel will be ignored. To customize both
3025    /// fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`).
3026    pub fill: Option<MarkPropDefWithCondition>,
3027    /// A URL to load upon mouse click.
3028    pub href: Option<DefWithCondition>,
3029    /// A data field to use as a unique key for data binding. When a visualization’s data is
3030    /// updated, the key value will be used to match data elements to existing mark instances.
3031    /// Use a key channel to enable object constancy for transitions over dynamic data.
3032    pub key: Option<FieldDef>,
3033    /// Latitude position of geographically projected marks.
3034    pub latitude: Option<FieldDef>,
3035    /// Latitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`, and
3036    /// `"rule"`.
3037    pub latitude2: Option<FieldDef>,
3038    /// Longitude position of geographically projected marks.
3039    pub longitude: Option<FieldDef>,
3040    /// Longitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`,
3041    /// and  `"rule"`.
3042    pub longitude2: Option<FieldDef>,
3043    /// Opacity of the marks – either can be a value or a range.
3044    ///
3045    /// __Default value:__ If undefined, the default opacity depends on [mark
3046    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property.
3047    pub opacity: Option<MarkPropDefWithCondition>,
3048    /// Order of the marks.
3049    /// - For stacked marks, this `order` channel encodes [stack
3050    /// order](https://vega.github.io/vega-lite/docs/stack.html#order).
3051    /// - For line and trail marks, this `order` channel encodes order of data points in the
3052    /// lines. This can be useful for creating [a connected
3053    /// scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html).
3054    /// Setting `order` to `{"value": null}` makes the line marks use the original order in the
3055    /// data sources.
3056    /// - Otherwise, this `order` channel encodes layer order of the marks.
3057    ///
3058    /// __Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating
3059    /// additional aggregation grouping.
3060    pub order: Option<Order>,
3061    /// Vertical facets for trellis plots.
3062    pub row: Option<FacetFieldDef>,
3063    /// For `point` marks the supported values are
3064    /// `"circle"` (default), `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`,
3065    /// or `"triangle-down"`, or else a custom SVG path string.
3066    /// For `geoshape` marks it should be a field definition of the geojson data
3067    ///
3068    /// __Default value:__ If undefined, the default shape depends on [mark
3069    /// config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape`
3070    /// property.
3071    pub shape: Option<MarkPropDefWithCondition>,
3072    /// Size of the mark.
3073    /// - For `"point"`, `"square"` and `"circle"`, – the symbol size, or pixel area of the mark.
3074    /// - For `"bar"` and `"tick"` – the bar and tick's size.
3075    /// - For `"text"` – the text's font size.
3076    /// - Size is unsupported for `"line"`, `"area"`, and `"rect"`. (Use `"trail"` instead of
3077    /// line with varying size)
3078    pub size: Option<MarkPropDefWithCondition>,
3079    /// Stroke color of the marks.
3080    /// __Default value:__ If undefined, the default color depends on [mark
3081    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
3082    ///
3083    /// _Note:_ When using `stroke` channel, `color ` channel will be ignored. To customize both
3084    /// stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`).
3085    pub stroke: Option<MarkPropDefWithCondition>,
3086    /// Text of the `text` mark.
3087    pub text: Option<TextClass>,
3088    /// The tooltip text to show upon mouse hover.
3089    pub tooltip: Option<Tooltip>,
3090    /// X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
3091    pub x: Option<XClass>,
3092    /// X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and  `"rule"`.
3093    pub x2: Option<X2Class>,
3094    /// Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
3095    pub y: Option<XClass>,
3096    /// Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and  `"rule"`.
3097    pub y2: Option<X2Class>,
3098}
3099
3100/// Color of the marks – either fill or stroke color based on  the `filled` property of mark
3101/// definition.
3102/// By default, `color` represents fill color for `"area"`, `"bar"`, `"tick"`,
3103/// `"text"`, `"trail"`, `"circle"`, and `"square"` / stroke color for `"line"` and
3104/// `"point"`.
3105///
3106/// __Default value:__ If undefined, the default color depends on [mark
3107/// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
3108///
3109/// _Note:_
3110/// 1) For fine-grained control over both fill and stroke colors of the marks, please use the
3111/// `fill` and `stroke` channels.  If either `fill` or `stroke` channel is specified, `color`
3112/// channel will be ignored.
3113/// 2) See the scale documentation for more information about customizing [color
3114/// scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme).
3115///
3116/// Fill color of the marks.
3117/// __Default value:__ If undefined, the default color depends on [mark
3118/// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
3119///
3120/// _Note:_ When using `fill` channel, `color ` channel will be ignored. To customize both
3121/// fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`).
3122///
3123/// Opacity of the marks – either can be a value or a range.
3124///
3125/// __Default value:__ If undefined, the default opacity depends on [mark
3126/// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property.
3127///
3128/// For `point` marks the supported values are
3129/// `"circle"` (default), `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`,
3130/// or `"triangle-down"`, or else a custom SVG path string.
3131/// For `geoshape` marks it should be a field definition of the geojson data
3132///
3133/// __Default value:__ If undefined, the default shape depends on [mark
3134/// config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape`
3135/// property.
3136///
3137/// Size of the mark.
3138/// - For `"point"`, `"square"` and `"circle"`, – the symbol size, or pixel area of the mark.
3139/// - For `"bar"` and `"tick"` – the bar and tick's size.
3140/// - For `"text"` – the text's font size.
3141/// - Size is unsupported for `"line"`, `"area"`, and `"rect"`. (Use `"trail"` instead of
3142/// line with varying size)
3143///
3144/// Stroke color of the marks.
3145/// __Default value:__ If undefined, the default color depends on [mark
3146/// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
3147///
3148/// _Note:_ When using `stroke` channel, `color ` channel will be ignored. To customize both
3149/// stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`).
3150///
3151/// A FieldDef with Condition<ValueDef>
3152/// {
3153/// condition: {value: ...},
3154/// field: ...,
3155/// ...
3156/// }
3157///
3158/// A ValueDef with Condition<ValueDef | FieldDef>
3159/// {
3160/// condition: {field: ...} | {value: ...},
3161/// value: ...,
3162/// }
3163#[derive(Debug, Serialize, Deserialize)]
3164pub struct MarkPropDefWithCondition {
3165    /// Aggregation function for the field
3166    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
3167    ///
3168    /// __Default value:__ `undefined` (None)
3169    pub aggregate: Option<AggregateOp>,
3170    /// A flag for binning a `quantitative` field, or [an object defining binning
3171    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
3172    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
3173    /// will be applied.
3174    ///
3175    /// __Default value:__ `false`
3176    pub bin: Option<Bin>,
3177    /// One or more value definition(s) with a selection predicate.
3178    ///
3179    /// __Note:__ A field definition's `condition` property can only contain [value
3180    /// definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)
3181    /// since Vega-Lite only allows at most one encoded field per encoding channel.
3182    ///
3183    /// A field definition or one or more value definition(s) with a selection predicate.
3184    pub condition: Option<ColorCondition>,
3185    /// __Required.__ A string defining the name of the field from which to pull a data value
3186    /// or an object defining iterated values from the
3187    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
3188    ///
3189    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
3190    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
3191    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
3192    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
3193    /// See more details about escaping in the [field
3194    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
3195    ///
3196    /// __Note:__ `field` is not required if `aggregate` is `count`.
3197    pub field: Option<Field>,
3198    /// An object defining properties of the legend.
3199    /// If `null`, the legend for the encoding channel will be removed.
3200    ///
3201    /// __Default value:__ If undefined, default [legend
3202    /// properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.
3203    pub legend: Option<Legend>,
3204    /// An object defining properties of the channel's scale, which is the function that
3205    /// transforms values in the data domain (numbers, dates, strings, etc) to visual values
3206    /// (pixels, colors, sizes) of the encoding channels.
3207    ///
3208    /// If `null`, the scale will be [disabled and the data value will be directly
3209    /// encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).
3210    ///
3211    /// __Default value:__ If undefined, default [scale
3212    /// properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.
3213    pub scale: Option<Scale>,
3214    /// Sort order for the encoded field.
3215    ///
3216    /// For continuous fields (quantitative or temporal), `sort` can be either `"ascending"` or
3217    /// `"descending"`.
3218    ///
3219    /// For discrete fields, `sort` can be one of the following:
3220    /// - `"ascending"` or `"descending"` -- for sorting by the values' natural order in
3221    /// Javascript.
3222    /// - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field)
3223    /// for sorting by another field.
3224    /// - [An array specifying the field values in preferred
3225    /// order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the
3226    /// sort order will obey the values in the array, followed by any unspecified values in their
3227    /// original order.  For discrete time field, values in the sort array can be [date-time
3228    /// definition objects](types#datetime). In addition, for time units `"month"` and `"day"`,
3229    /// the values can be the month or day names (case insensitive) or their 3-letter initials
3230    /// (e.g., `"Mon"`, `"Tue"`).
3231    /// - `null` indicating no sort.
3232    ///
3233    /// __Default value:__ `"ascending"`
3234    ///
3235    /// __Note:__ `null` is not supported for `row` and `column`.
3236    pub sort: Option<Sort>,
3237    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
3238    /// or [a temporal field that gets casted as
3239    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
3240    ///
3241    /// __Default value:__ `undefined` (None)
3242    #[serde(rename = "timeUnit")]
3243    pub time_unit: Option<TimeUnit>,
3244    /// A title for the field. If `null`, the title will be removed.
3245    ///
3246    /// __Default value:__  derived from the field's name and transformation function
3247    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
3248    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
3249    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
3250    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
3251    /// the field name.
3252    ///
3253    /// __Notes__:
3254    ///
3255    /// 1) You can customize the default field title format by providing the [`fieldTitle`
3256    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
3257    /// [`fieldTitle` function via the `compile` function's
3258    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
3259    ///
3260    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
3261    /// axis/header/legend title will be used.
3262    pub title: Option<String>,
3263    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
3264    /// `"nominal"`).
3265    /// It can also be a `"geojson"` type for encoding
3266    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
3267    #[serde(rename = "type")]
3268    pub mark_prop_def_with_condition_type: Option<Type>,
3269    /// A constant value in visual domain.
3270    pub value: Option<PurpleValue>,
3271}
3272
3273/// Binning properties or boolean flag for determining whether to bin data or not.
3274#[derive(Debug, Serialize, Deserialize)]
3275pub struct BinParams {
3276    /// A value in the binned domain at which to anchor the bins, shifting the bin boundaries if
3277    /// necessary to ensure that a boundary aligns with the anchor value.
3278    ///
3279    /// __Default Value:__ the minimum bin extent value
3280    pub anchor: Option<f64>,
3281    /// The number base to use for automatic bin determination (default is base 10).
3282    ///
3283    /// __Default value:__ `10`
3284    pub base: Option<f64>,
3285    /// Scale factors indicating allowable subdivisions. The default value is [5, 2], which
3286    /// indicates that for base 10 numbers (the default base), the method may consider dividing
3287    /// bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can
3288    /// check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the
3289    /// given constraints.
3290    ///
3291    /// __Default value:__ `[5, 2]`
3292    pub divide: Option<Vec<f64>>,
3293    /// A two-element (`[min, max]`) array indicating the range of desired bin values.
3294    pub extent: Option<Vec<f64>>,
3295    /// Maximum number of bins.
3296    ///
3297    /// __Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels
3298    pub maxbins: Option<f64>,
3299    /// A minimum allowable step size (particularly useful for integer values).
3300    pub minstep: Option<f64>,
3301    /// If true (the default), attempts to make the bin boundaries use human-friendly boundaries,
3302    /// such as multiples of ten.
3303    pub nice: Option<bool>,
3304    /// An exact step size to use between bins.
3305    ///
3306    /// __Note:__ If provided, options such as maxbins will be ignored.
3307    pub step: Option<f64>,
3308    /// An array of allowable step sizes to choose from.
3309    pub steps: Option<Vec<f64>>,
3310}
3311
3312#[derive(Debug, Serialize, Deserialize)]
3313pub struct ConditionalValueDef {
3314    pub test: Box<Option<Box<PurpleLogicalOperandPredicate>>>,
3315    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
3316    /// `0` to `1` for opacity).
3317    pub value: ConditionalValueDefValue,
3318    /// A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of
3319    /// [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose).
3320    pub selection: Box<Option<Box<PurpleSelectionOperand>>>,
3321}
3322
3323#[derive(Debug, Serialize, Deserialize)]
3324pub struct Selection {
3325    pub not: Box<Option<Box<PurpleSelectionOperand>>>,
3326    pub and: Option<Vec<SelectionOperandElement>>,
3327    pub or: Option<Vec<SelectionOperandElement>>,
3328}
3329
3330#[derive(Debug, Serialize, Deserialize)]
3331pub struct Predicate {
3332    pub not: Box<Option<Box<PurpleLogicalOperandPredicate>>>,
3333    pub and: Option<Vec<LogicalOperandPredicateElement>>,
3334    pub or: Option<Vec<LogicalOperandPredicateElement>>,
3335    /// The value that the field should be equal to.
3336    pub equal: Option<EqualUnion>,
3337    /// Field to be filtered.
3338    pub field: Option<String>,
3339    /// Time unit for the field to be filtered.
3340    #[serde(rename = "timeUnit")]
3341    pub time_unit: Option<TimeUnit>,
3342    /// An array of inclusive minimum and maximum values
3343    /// for a field value of a data item to be included in the filtered data.
3344    pub range: Option<Vec<Option<RangeElement>>>,
3345    /// A set of values that the `field`'s value should be a member of,
3346    /// for a data item included in the filtered data.
3347    #[serde(rename = "oneOf")]
3348    pub one_of: Option<Vec<SortElement>>,
3349    /// The value that the field should be less than.
3350    pub lt: Option<Lt>,
3351    /// The value that the field should be greater than.
3352    pub gt: Option<Lt>,
3353    /// The value that the field should be less than or equals to.
3354    pub lte: Option<Lt>,
3355    /// The value that the field should be greater than or equals to.
3356    pub gte: Option<Lt>,
3357    /// Filter using a selection name.
3358    pub selection: Box<Option<Box<PurpleSelectionOperand>>>,
3359}
3360
3361/// Object for defining datetime in Vega-Lite Filter.
3362/// If both month and quarter are provided, month has higher precedence.
3363/// `day` cannot be combined with other date.
3364/// We accept string for month and day names.
3365#[derive(Debug, Serialize, Deserialize)]
3366pub struct DateTime {
3367    /// Integer value representing the date from 1-31.
3368    pub date: Option<f64>,
3369    /// Value representing the day of a week.  This can be one of: (1) integer value -- `1`
3370    /// represents Monday; (2) case-insensitive day name (e.g., `"Monday"`);  (3)
3371    /// case-insensitive, 3-character short day name (e.g., `"Mon"`).   <br/> **Warning:** A
3372    /// DateTime definition object with `day`** should not be combined with `year`, `quarter`,
3373    /// `month`, or `date`.
3374    pub day: Option<Day>,
3375    /// Integer value representing the hour of a day from 0-23.
3376    pub hours: Option<f64>,
3377    /// Integer value representing the millisecond segment of time.
3378    pub milliseconds: Option<f64>,
3379    /// Integer value representing the minute segment of time from 0-59.
3380    pub minutes: Option<f64>,
3381    /// One of: (1) integer value representing the month from `1`-`12`. `1` represents January;
3382    /// (2) case-insensitive month name (e.g., `"January"`);  (3) case-insensitive, 3-character
3383    /// short month name (e.g., `"Jan"`).
3384    pub month: Option<Month>,
3385    /// Integer value representing the quarter of the year (from 1-4).
3386    pub quarter: Option<f64>,
3387    /// Integer value representing the second segment (0-59) of a time value
3388    pub seconds: Option<f64>,
3389    /// A boolean flag indicating if date time is in utc time. If false, the date time is in
3390    /// local time
3391    pub utc: Option<bool>,
3392    /// Integer value representing the year.
3393    pub year: Option<f64>,
3394}
3395
3396#[derive(Debug, Serialize, Deserialize)]
3397pub struct ConditionalPredicateMarkPropFieldDefClass {
3398    pub test: Box<Option<Box<PurpleLogicalOperandPredicate>>>,
3399    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
3400    /// `0` to `1` for opacity).
3401    pub value: Option<PurpleValue>,
3402    /// A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of
3403    /// [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose).
3404    pub selection: Box<Option<Box<PurpleSelectionOperand>>>,
3405    /// Aggregation function for the field
3406    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
3407    ///
3408    /// __Default value:__ `undefined` (None)
3409    pub aggregate: Option<AggregateOp>,
3410    /// A flag for binning a `quantitative` field, or [an object defining binning
3411    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
3412    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
3413    /// will be applied.
3414    ///
3415    /// __Default value:__ `false`
3416    pub bin: Option<Bin>,
3417    /// __Required.__ A string defining the name of the field from which to pull a data value
3418    /// or an object defining iterated values from the
3419    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
3420    ///
3421    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
3422    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
3423    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
3424    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
3425    /// See more details about escaping in the [field
3426    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
3427    ///
3428    /// __Note:__ `field` is not required if `aggregate` is `count`.
3429    pub field: Option<Field>,
3430    /// An object defining properties of the legend.
3431    /// If `null`, the legend for the encoding channel will be removed.
3432    ///
3433    /// __Default value:__ If undefined, default [legend
3434    /// properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.
3435    pub legend: Option<Legend>,
3436    /// An object defining properties of the channel's scale, which is the function that
3437    /// transforms values in the data domain (numbers, dates, strings, etc) to visual values
3438    /// (pixels, colors, sizes) of the encoding channels.
3439    ///
3440    /// If `null`, the scale will be [disabled and the data value will be directly
3441    /// encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).
3442    ///
3443    /// __Default value:__ If undefined, default [scale
3444    /// properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.
3445    pub scale: Option<Scale>,
3446    /// Sort order for the encoded field.
3447    ///
3448    /// For continuous fields (quantitative or temporal), `sort` can be either `"ascending"` or
3449    /// `"descending"`.
3450    ///
3451    /// For discrete fields, `sort` can be one of the following:
3452    /// - `"ascending"` or `"descending"` -- for sorting by the values' natural order in
3453    /// Javascript.
3454    /// - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field)
3455    /// for sorting by another field.
3456    /// - [An array specifying the field values in preferred
3457    /// order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the
3458    /// sort order will obey the values in the array, followed by any unspecified values in their
3459    /// original order.  For discrete time field, values in the sort array can be [date-time
3460    /// definition objects](types#datetime). In addition, for time units `"month"` and `"day"`,
3461    /// the values can be the month or day names (case insensitive) or their 3-letter initials
3462    /// (e.g., `"Mon"`, `"Tue"`).
3463    /// - `null` indicating no sort.
3464    ///
3465    /// __Default value:__ `"ascending"`
3466    ///
3467    /// __Note:__ `null` is not supported for `row` and `column`.
3468    pub sort: Option<Sort>,
3469    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
3470    /// or [a temporal field that gets casted as
3471    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
3472    ///
3473    /// __Default value:__ `undefined` (None)
3474    #[serde(rename = "timeUnit")]
3475    pub time_unit: Option<TimeUnit>,
3476    /// A title for the field. If `null`, the title will be removed.
3477    ///
3478    /// __Default value:__  derived from the field's name and transformation function
3479    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
3480    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
3481    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
3482    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
3483    /// the field name.
3484    ///
3485    /// __Notes__:
3486    ///
3487    /// 1) You can customize the default field title format by providing the [`fieldTitle`
3488    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
3489    /// [`fieldTitle` function via the `compile` function's
3490    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
3491    ///
3492    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
3493    /// axis/header/legend title will be used.
3494    pub title: Option<String>,
3495    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
3496    /// `"nominal"`).
3497    /// It can also be a `"geojson"` type for encoding
3498    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
3499    #[serde(rename = "type")]
3500    pub conditional_def_type: Option<Type>,
3501}
3502
3503/// Reference to a repeated value.
3504#[derive(Debug, Serialize, Deserialize)]
3505pub struct RepeatRef {
3506    pub repeat: SingleDefChannel,
3507}
3508
3509/// Properties of a legend or boolean flag for determining whether to show it.
3510#[derive(Debug, Serialize, Deserialize)]
3511pub struct Legend {
3512    /// Padding (in pixels) between legend entries in a symbol legend.
3513    #[serde(rename = "entryPadding")]
3514    pub entry_padding: Option<f64>,
3515    /// The formatting pattern for labels. This is D3's [number format
3516    /// pattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's
3517    /// [time format pattern](https://github.com/d3/d3-time-format#locale_format) for time
3518    /// field.
3519    ///
3520    /// See the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for
3521    /// more information.
3522    ///
3523    /// __Default value:__  derived from
3524    /// [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for
3525    /// quantitative fields and from
3526    /// [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for
3527    /// temporal fields.
3528    pub format: Option<String>,
3529    /// The offset, in pixels, by which to displace the legend from the edge of the enclosing
3530    /// group or data rectangle.
3531    ///
3532    /// __Default value:__  `0`
3533    pub offset: Option<f64>,
3534    /// The orientation of the legend, which determines how the legend is positioned within the
3535    /// scene. One of "left", "right", "top-left", "top-right", "bottom-left", "bottom-right",
3536    /// "none".
3537    ///
3538    /// __Default value:__ `"right"`
3539    pub orient: Option<LegendOrient>,
3540    /// The padding, in pixels, between the legend and axis.
3541    pub padding: Option<f64>,
3542    /// The desired number of tick values for quantitative legends.
3543    #[serde(rename = "tickCount")]
3544    pub tick_count: Option<f64>,
3545    /// A title for the field. If `null`, the title will be removed.
3546    ///
3547    /// __Default value:__  derived from the field's name and transformation function
3548    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
3549    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
3550    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
3551    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
3552    /// the field name.
3553    ///
3554    /// __Notes__:
3555    ///
3556    /// 1) You can customize the default field title format by providing the [`fieldTitle`
3557    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
3558    /// [`fieldTitle` function via the `compile` function's
3559    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
3560    ///
3561    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
3562    /// axis/header/legend title will be used.
3563    pub title: Option<String>,
3564    /// The type of the legend. Use `"symbol"` to create a discrete legend and `"gradient"` for a
3565    /// continuous color gradient.
3566    ///
3567    /// __Default value:__ `"gradient"` for non-binned quantitative fields and temporal fields;
3568    /// `"symbol"` otherwise.
3569    #[serde(rename = "type")]
3570    pub legend_type: Option<LegendType>,
3571    /// Explicitly set the visible legend values.
3572    pub values: Option<Vec<SortElement>>,
3573    /// A non-positive integer indicating z-index of the legend.
3574    /// If zindex is 0, legend should be drawn behind all chart elements.
3575    /// To put them in front, use zindex = 1.
3576    pub zindex: Option<f64>,
3577}
3578
3579#[derive(Debug, Serialize, Deserialize)]
3580pub struct Scale {
3581    /// The logarithm base of the `log` scale (default `10`).
3582    pub base: Option<f64>,
3583    /// If `true`, values that exceed the data domain are clamped to either the minimum or
3584    /// maximum range value
3585    ///
3586    /// __Default value:__ derived from the [scale
3587    /// config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `clamp` (`true`
3588    /// by default).
3589    pub clamp: Option<bool>,
3590    /// Customized domain values.
3591    ///
3592    /// For _quantitative_ fields, `domain` can take the form of a two-element array with minimum
3593    /// and maximum values.  [Piecewise
3594    /// scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise) can be created by
3595    /// providing a `domain` with more than two entries.
3596    /// If the input field is aggregated, `domain` can also be a string value `"unaggregated"`,
3597    /// indicating that the domain should include the raw data values prior to the aggregation.
3598    ///
3599    /// For _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in
3600    /// the form of either timestamps or the [DateTime definition
3601    /// objects](https://vega.github.io/vega-lite/docs/types.html#datetime).
3602    ///
3603    /// For _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input
3604    /// values.
3605    ///
3606    /// The `selection` property can be used to [interactively
3607    /// determine](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale
3608    /// domain.
3609    pub domain: Option<DomainUnion>,
3610    /// The exponent of the `pow` scale.
3611    pub exponent: Option<f64>,
3612    /// The interpolation method for range values. By default, a general interpolator for
3613    /// numbers, dates, strings and colors (in RGB space) is used. For color ranges, this
3614    /// property allows interpolation in alternative color spaces. Legal values include `rgb`,
3615    /// `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long'
3616    /// variants use longer paths in polar coordinate spaces). If object-valued, this property
3617    /// accepts an object with a string-valued _type_ property and an optional numeric _gamma_
3618    /// property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate
3619    /// documentation](https://github.com/d3/d3-interpolate).
3620    ///
3621    /// __Note:__ Sequential scales do not support `interpolate` as they have a fixed
3622    /// interpolator.  Since Vega-Lite uses sequential scales for quantitative fields by default,
3623    /// you have to set the scale `type` to other quantitative scale type such as `"linear"` to
3624    /// customize `interpolate`.
3625    pub interpolate: Option<InterpolateUnion>,
3626    /// Extending the domain so that it starts and ends on nice round values. This method
3627    /// typically modifies the scale’s domain, and may only extend the bounds to the nearest
3628    /// round value. Nicing is useful if the domain is computed from data and may be irregular.
3629    /// For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2,
3630    /// 1.0]_.
3631    ///
3632    /// For quantitative scales such as linear, `nice` can be either a boolean flag or a number.
3633    /// If `nice` is a number, it will represent a desired tick count. This allows greater
3634    /// control over the step size used to extend the bounds, guaranteeing that the returned
3635    /// ticks will exactly cover the domain.
3636    ///
3637    /// For temporal fields with time and utc scales, the `nice` value can be a string indicating
3638    /// the desired time interval. Legal values are `"millisecond"`, `"second"`, `"minute"`,
3639    /// `"hour"`, `"day"`, `"week"`, `"month"`, and `"year"`. Alternatively, `time` and `utc`
3640    /// scales can accept an object-valued interval specifier of the form `{"interval": "month",
3641    /// "step": 3}`, which includes a desired number of interval steps. Here, the domain would
3642    /// snap to quarter (Jan, Apr, Jul, Oct) boundaries.
3643    ///
3644    /// __Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise.
3645    pub nice: Option<NiceUnion>,
3646    /// For _[continuous](https://vega.github.io/vega-lite/docs/scale.html#continuous)_ scales,
3647    /// expands the scale domain to accommodate the specified number of pixels on each of the
3648    /// scale range. The scale range must represent pixels for this parameter to function as
3649    /// intended. Padding adjustment is performed prior to all other adjustments, including the
3650    /// effects of the zero, nice, domainMin, and domainMax properties.
3651    ///
3652    /// For _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for
3653    /// setting `paddingInner` and `paddingOuter` to the same value.
3654    ///
3655    /// For _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for
3656    /// `paddingOuter`.
3657    ///
3658    /// __Default value:__ For _continuous_ scales, derived from the [scale
3659    /// config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `continuousPadding`.
3660    /// For _band and point_ scales, see `paddingInner` and `paddingOuter`.
3661    pub padding: Option<f64>,
3662    /// The inner padding (spacing) within each band step of band scales, as a fraction of the
3663    /// step size. This value must lie in the range [0,1].
3664    ///
3665    /// For point scale, this property is invalid as point scales do not have internal band
3666    /// widths (only step sizes between bands).
3667    ///
3668    /// __Default value:__ derived from the [scale
3669    /// config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingInner`.
3670    #[serde(rename = "paddingInner")]
3671    pub padding_inner: Option<f64>,
3672    /// The outer padding (spacing) at the ends of the range of band and point scales,
3673    /// as a fraction of the step size. This value must lie in the range [0,1].
3674    ///
3675    /// __Default value:__ derived from the [scale
3676    /// config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingOuter` for
3677    /// band scales and `pointPadding` for point scales.
3678    #[serde(rename = "paddingOuter")]
3679    pub padding_outer: Option<f64>,
3680    /// The range of the scale. One of:
3681    ///
3682    /// - A string indicating a [pre-defined named scale
3683    /// range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example,
3684    /// `"symbol"`, or `"diverging"`).
3685    ///
3686    /// - For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous),
3687    /// two-element array indicating  minimum and maximum values, or an array with more than two
3688    /// entries for specifying a [piecewise
3689    /// scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).
3690    ///
3691    /// - For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and
3692    /// [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an
3693    /// array of desired output values.
3694    ///
3695    /// __Notes:__
3696    ///
3697    /// 1) For [sequential](https://vega.github.io/vega-lite/docs/scale.html#sequential),
3698    /// [ordinal](https://vega.github.io/vega-lite/docs/scale.html#ordinal), and discretizing
3699    /// color scales, you can also specify a color
3700    /// [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.
3701    ///
3702    /// 2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be
3703    /// customized via the view's corresponding
3704    /// [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`) or via
3705    /// [range steps and paddings properties](#range-step) for [band](#band) and [point](#point)
3706    /// scales.
3707    pub range: Option<ScaleRange>,
3708    /// The distance between the starts of adjacent bands or points in
3709    /// [band](https://vega.github.io/vega-lite/docs/scale.html#band) and
3710    /// [point](https://vega.github.io/vega-lite/docs/scale.html#point) scales.
3711    ///
3712    /// If `rangeStep` is `null` or if the view contains the scale's corresponding
3713    /// [size](https://vega.github.io/vega-lite/docs/size.html) (`width` for `x` scales and
3714    /// `height` for `y` scales), `rangeStep` will be automatically determined to fit the size of
3715    /// the view.
3716    ///
3717    /// __Default value:__  derived the [scale
3718    /// config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s
3719    /// `textXRangeStep` (`90` by default) for x-scales of `text` marks and `rangeStep` (`21` by
3720    /// default) for x-scales of other marks and y-scales.
3721    ///
3722    /// __Warning__: If `rangeStep` is `null` and the cardinality of the scale's domain is higher
3723    /// than `width` or `height`, the rangeStep might become less than one pixel and the mark
3724    /// might not appear correctly.
3725    #[serde(rename = "rangeStep")]
3726    pub range_step: Option<f64>,
3727    /// If `true`, rounds numeric output values to integers. This can be helpful for snapping to
3728    /// the pixel grid.
3729    ///
3730    /// __Default value:__ `false`.
3731    pub round: Option<bool>,
3732    /// A string indicating a color
3733    /// [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g.,
3734    /// `"category10"` or `"viridis"`) or a [scheme parameter
3735    /// object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).
3736    ///
3737    /// Discrete color schemes may be used with
3738    /// [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or
3739    /// [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales.
3740    /// Continuous color schemes are intended for use with
3741    /// [sequential](https://vega.github.io/vega-lite/docs/scales.html#sequential) scales.
3742    ///
3743    /// For the full list of supported schemes, please refer to the [Vega
3744    /// Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.
3745    pub scheme: Option<Scheme>,
3746    /// The type of scale.  Vega-Lite supports the following categories of scale types:
3747    ///
3748    /// 1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous)
3749    /// -- mapping continuous domains to continuous output ranges
3750    /// ([`"linear"`](https://vega.github.io/vega-lite/docs/scale.html#linear),
3751    /// [`"pow"`](https://vega.github.io/vega-lite/docs/scale.html#pow),
3752    /// [`"sqrt"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt),
3753    /// [`"log"`](https://vega.github.io/vega-lite/docs/scale.html#log),
3754    /// [`"time"`](https://vega.github.io/vega-lite/docs/scale.html#time),
3755    /// [`"utc"`](https://vega.github.io/vega-lite/docs/scale.html#utc),
3756    /// [`"sequential"`](https://vega.github.io/vega-lite/docs/scale.html#sequential)).
3757    ///
3758    /// 2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) --
3759    /// mapping discrete domains to discrete
3760    /// ([`"ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous
3761    /// ([`"band"`](https://vega.github.io/vega-lite/docs/scale.html#band) and
3762    /// [`"point"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.
3763    ///
3764    /// 3) [**Discretizing
3765    /// Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping
3766    /// continuous domains to discrete output ranges
3767    /// ([`"bin-linear"`](https://vega.github.io/vega-lite/docs/scale.html#bin-linear) and
3768    /// [`"bin-ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal)).
3769    ///
3770    /// __Default value:__ please see the [scale type
3771    /// table](https://vega.github.io/vega-lite/docs/scale.html#type).
3772    #[serde(rename = "type")]
3773    pub scale_type: Option<ScaleType>,
3774    /// If `true`, ensures that a zero baseline value is included in the scale domain.
3775    ///
3776    /// __Default value:__ `true` for x and y channels if the quantitative field is not binned
3777    /// and no custom `domain` is provided; `false` otherwise.
3778    ///
3779    /// __Note:__ Log, time, and utc scales do not support `zero`.
3780    pub zero: Option<bool>,
3781}
3782
3783#[derive(Debug, Serialize, Deserialize)]
3784pub struct DomainClass {
3785    /// The field name to extract selected values for, when a selection is
3786    /// [projected](https://vega.github.io/vega-lite/docs/project.html)
3787    /// over multiple fields or encodings.
3788    pub field: Option<String>,
3789    /// The name of a selection.
3790    pub selection: String,
3791    /// The encoding channel to extract selected values for, when a selection is
3792    /// [projected](https://vega.github.io/vega-lite/docs/project.html)
3793    /// over multiple fields or encodings.
3794    pub encoding: Option<String>,
3795}
3796
3797#[derive(Debug, Serialize, Deserialize)]
3798pub struct ScaleInterpolateParams {
3799    pub gamma: Option<f64>,
3800    #[serde(rename = "type")]
3801    pub scale_interpolate_params_type: ScaleInterpolateParamsType,
3802}
3803
3804#[derive(Debug, Serialize, Deserialize)]
3805pub struct NiceClass {
3806    pub interval: String,
3807    pub step: f64,
3808}
3809
3810#[derive(Debug, Serialize, Deserialize)]
3811pub struct SchemeParams {
3812    /// For sequential and diverging schemes only, determines the extent of the color range to
3813    /// use. For example `[0.2, 1]` will rescale the color scheme such that color values in the
3814    /// range _[0, 0.2)_ are excluded from the scheme.
3815    pub extent: Option<Vec<f64>>,
3816    /// A color scheme name for sequential/ordinal scales (e.g., `"category10"` or `"viridis"`).
3817    ///
3818    /// For the full list of supported schemes, please refer to the [Vega
3819    /// Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.
3820    pub name: String,
3821}
3822
3823/// A sort definition for sorting a discrete scale in an encoding field definition.
3824#[derive(Debug, Serialize, Deserialize)]
3825pub struct EncodingSortField {
3826    /// The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.
3827    ///
3828    /// __Default value:__ If unspecified, defaults to the field specified in the outer data
3829    /// reference.
3830    pub field: Option<Field>,
3831    /// An [aggregate operation](https://vega.github.io/vega-lite/docs/aggregate.html#ops) to
3832    /// perform on the field prior to sorting (e.g., `"count"`, `"mean"` and `"median"`).
3833    /// This property is required in cases where the sort field and the data reference field do
3834    /// not match.
3835    /// The input data objects will be aggregated, grouped by the encoded data field.
3836    ///
3837    /// For a full list of operations, please see the documentation for
3838    /// [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).
3839    pub op: AggregateOp,
3840    /// The sort order. One of `"ascending"` (default), `"descending"`, or `null` (no not sort).
3841    pub order: Option<VgComparatorOrder>,
3842}
3843
3844/// Horizontal facets for trellis plots.
3845///
3846/// Vertical facets for trellis plots.
3847#[derive(Debug, Serialize, Deserialize)]
3848pub struct FacetFieldDef {
3849    /// Aggregation function for the field
3850    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
3851    ///
3852    /// __Default value:__ `undefined` (None)
3853    pub aggregate: Option<AggregateOp>,
3854    /// A flag for binning a `quantitative` field, or [an object defining binning
3855    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
3856    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
3857    /// will be applied.
3858    ///
3859    /// __Default value:__ `false`
3860    pub bin: Option<Bin>,
3861    /// __Required.__ A string defining the name of the field from which to pull a data value
3862    /// or an object defining iterated values from the
3863    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
3864    ///
3865    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
3866    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
3867    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
3868    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
3869    /// See more details about escaping in the [field
3870    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
3871    ///
3872    /// __Note:__ `field` is not required if `aggregate` is `count`.
3873    pub field: Option<Field>,
3874    /// An object defining properties of a facet's header.
3875    pub header: Option<Header>,
3876    /// Sort order for the encoded field.
3877    ///
3878    /// For continuous fields (quantitative or temporal), `sort` can be either `"ascending"` or
3879    /// `"descending"`.
3880    ///
3881    /// For discrete fields, `sort` can be one of the following:
3882    /// - `"ascending"` or `"descending"` -- for sorting by the values' natural order in
3883    /// Javascript.
3884    /// - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field)
3885    /// for sorting by another field.
3886    /// - [An array specifying the field values in preferred
3887    /// order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the
3888    /// sort order will obey the values in the array, followed by any unspecified values in their
3889    /// original order.  For discrete time field, values in the sort array can be [date-time
3890    /// definition objects](types#datetime). In addition, for time units `"month"` and `"day"`,
3891    /// the values can be the month or day names (case insensitive) or their 3-letter initials
3892    /// (e.g., `"Mon"`, `"Tue"`).
3893    /// - `null` indicating no sort.
3894    ///
3895    /// __Default value:__ `"ascending"`
3896    ///
3897    /// __Note:__ `null` is not supported for `row` and `column`.
3898    pub sort: Option<Sort>,
3899    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
3900    /// or [a temporal field that gets casted as
3901    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
3902    ///
3903    /// __Default value:__ `undefined` (None)
3904    #[serde(rename = "timeUnit")]
3905    pub time_unit: Option<TimeUnit>,
3906    /// A title for the field. If `null`, the title will be removed.
3907    ///
3908    /// __Default value:__  derived from the field's name and transformation function
3909    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
3910    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
3911    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
3912    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
3913    /// the field name.
3914    ///
3915    /// __Notes__:
3916    ///
3917    /// 1) You can customize the default field title format by providing the [`fieldTitle`
3918    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
3919    /// [`fieldTitle` function via the `compile` function's
3920    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
3921    ///
3922    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
3923    /// axis/header/legend title will be used.
3924    pub title: Option<String>,
3925    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
3926    /// `"nominal"`).
3927    /// It can also be a `"geojson"` type for encoding
3928    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
3929    #[serde(rename = "type")]
3930    pub facet_field_def_type: Type,
3931}
3932
3933/// An object defining properties of a facet's header.
3934///
3935/// Headers of row / column channels for faceted plots.
3936#[derive(Debug, Serialize, Deserialize)]
3937pub struct Header {
3938    /// The formatting pattern for labels. This is D3's [number format
3939    /// pattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's
3940    /// [time format pattern](https://github.com/d3/d3-time-format#locale_format) for time
3941    /// field.
3942    ///
3943    /// See the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for
3944    /// more information.
3945    ///
3946    /// __Default value:__  derived from
3947    /// [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for
3948    /// quantitative fields and from
3949    /// [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for
3950    /// temporal fields.
3951    pub format: Option<String>,
3952    /// The rotation angle of the header labels.
3953    ///
3954    /// __Default value:__ `0`.
3955    #[serde(rename = "labelAngle")]
3956    pub label_angle: Option<f64>,
3957    /// The color of the header label, can be in hex color code or regular color name.
3958    #[serde(rename = "labelColor")]
3959    pub label_color: Option<String>,
3960    /// The font of the header label.
3961    #[serde(rename = "labelFont")]
3962    pub label_font: Option<String>,
3963    /// The font size of the header label, in pixels.
3964    #[serde(rename = "labelFontSize")]
3965    pub label_font_size: Option<f64>,
3966    /// The maximum length of the header label in pixels. The text value will be automatically
3967    /// truncated if the rendered size exceeds the limit.
3968    ///
3969    /// __Default value:__ `0`, indicating no limit
3970    #[serde(rename = "labelLimit")]
3971    pub label_limit: Option<f64>,
3972    /// A title for the field. If `null`, the title will be removed.
3973    ///
3974    /// __Default value:__  derived from the field's name and transformation function
3975    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
3976    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
3977    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
3978    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
3979    /// the field name.
3980    ///
3981    /// __Notes__:
3982    ///
3983    /// 1) You can customize the default field title format by providing the [`fieldTitle`
3984    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
3985    /// [`fieldTitle` function via the `compile` function's
3986    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
3987    ///
3988    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
3989    /// axis/header/legend title will be used.
3990    pub title: Option<String>,
3991    /// The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
3992    /// example, with an orientation of top these anchor positions map to a left-, center-, or
3993    /// right-aligned title.
3994    ///
3995    /// __Default value:__ `"middle"` for
3996    /// [single](https://vega.github.io/vega-lite/docs/spec.html) and
3997    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.
3998    /// `"start"` for other composite views.
3999    ///
4000    /// __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
4001    /// customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and
4002    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.  For other composite
4003    /// views, `anchor` is always `"start"`.
4004    #[serde(rename = "titleAnchor")]
4005    pub title_anchor: Option<String>,
4006    /// The rotation angle of the header title.
4007    ///
4008    /// __Default value:__ `0`.
4009    #[serde(rename = "titleAngle")]
4010    pub title_angle: Option<f64>,
4011    /// Vertical text baseline for the header title. One of `"top"`, `"bottom"`, `"middle"`.
4012    ///
4013    /// __Default value:__ `"middle"`
4014    #[serde(rename = "titleBaseline")]
4015    pub title_baseline: Option<TextBaseline>,
4016    /// Color of the header title, can be in hex color code or regular color name.
4017    #[serde(rename = "titleColor")]
4018    pub title_color: Option<String>,
4019    /// Font of the header title. (e.g., `"Helvetica Neue"`).
4020    #[serde(rename = "titleFont")]
4021    pub title_font: Option<String>,
4022    /// Font size of the header title.
4023    #[serde(rename = "titleFontSize")]
4024    pub title_font_size: Option<f64>,
4025    /// Font weight of the header title.
4026    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
4027    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
4028    #[serde(rename = "titleFontWeight")]
4029    pub title_font_weight: Option<FontWeight>,
4030    /// The maximum length of the header title in pixels. The text value will be automatically
4031    /// truncated if the rendered size exceeds the limit.
4032    ///
4033    /// __Default value:__ `0`, indicating no limit
4034    #[serde(rename = "titleLimit")]
4035    pub title_limit: Option<f64>,
4036}
4037
4038/// Definition object for a data field, its type and transformation of an encoding channel.
4039///
4040/// A data field to use as a unique key for data binding. When a visualization’s data is
4041/// updated, the key value will be used to match data elements to existing mark instances.
4042/// Use a key channel to enable object constancy for transitions over dynamic data.
4043///
4044/// Latitude position of geographically projected marks.
4045///
4046/// Latitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`, and
4047/// `"rule"`.
4048///
4049/// Longitude position of geographically projected marks.
4050///
4051/// Longitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`,
4052/// and  `"rule"`.
4053#[derive(Debug, Serialize, Deserialize)]
4054pub struct FieldDef {
4055    /// Aggregation function for the field
4056    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4057    ///
4058    /// __Default value:__ `undefined` (None)
4059    pub aggregate: Option<AggregateOp>,
4060    /// A flag for binning a `quantitative` field, or [an object defining binning
4061    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4062    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4063    /// will be applied.
4064    ///
4065    /// __Default value:__ `false`
4066    pub bin: Option<Bin>,
4067    /// __Required.__ A string defining the name of the field from which to pull a data value
4068    /// or an object defining iterated values from the
4069    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4070    ///
4071    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4072    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4073    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4074    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4075    /// See more details about escaping in the [field
4076    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4077    ///
4078    /// __Note:__ `field` is not required if `aggregate` is `count`.
4079    pub field: Option<Field>,
4080    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4081    /// or [a temporal field that gets casted as
4082    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4083    ///
4084    /// __Default value:__ `undefined` (None)
4085    #[serde(rename = "timeUnit")]
4086    pub time_unit: Option<TimeUnit>,
4087    /// A title for the field. If `null`, the title will be removed.
4088    ///
4089    /// __Default value:__  derived from the field's name and transformation function
4090    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4091    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4092    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4093    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4094    /// the field name.
4095    ///
4096    /// __Notes__:
4097    ///
4098    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4099    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4100    /// [`fieldTitle` function via the `compile` function's
4101    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4102    ///
4103    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4104    /// axis/header/legend title will be used.
4105    pub title: Option<String>,
4106    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4107    /// `"nominal"`).
4108    /// It can also be a `"geojson"` type for encoding
4109    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4110    #[serde(rename = "type")]
4111    pub field_def_type: Type,
4112}
4113
4114/// A URL to load upon mouse click.
4115///
4116/// A FieldDef with Condition<ValueDef>
4117/// {
4118/// condition: {value: ...},
4119/// field: ...,
4120/// ...
4121/// }
4122///
4123/// A ValueDef with Condition<ValueDef | FieldDef>
4124/// {
4125/// condition: {field: ...} | {value: ...},
4126/// value: ...,
4127/// }
4128#[derive(Debug, Serialize, Deserialize)]
4129pub struct DefWithCondition {
4130    /// Aggregation function for the field
4131    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4132    ///
4133    /// __Default value:__ `undefined` (None)
4134    pub aggregate: Option<AggregateOp>,
4135    /// A flag for binning a `quantitative` field, or [an object defining binning
4136    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4137    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4138    /// will be applied.
4139    ///
4140    /// __Default value:__ `false`
4141    pub bin: Option<Bin>,
4142    /// One or more value definition(s) with a selection predicate.
4143    ///
4144    /// __Note:__ A field definition's `condition` property can only contain [value
4145    /// definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)
4146    /// since Vega-Lite only allows at most one encoded field per encoding channel.
4147    ///
4148    /// A field definition or one or more value definition(s) with a selection predicate.
4149    pub condition: Option<HrefCondition>,
4150    /// __Required.__ A string defining the name of the field from which to pull a data value
4151    /// or an object defining iterated values from the
4152    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4153    ///
4154    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4155    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4156    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4157    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4158    /// See more details about escaping in the [field
4159    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4160    ///
4161    /// __Note:__ `field` is not required if `aggregate` is `count`.
4162    pub field: Option<Field>,
4163    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4164    /// or [a temporal field that gets casted as
4165    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4166    ///
4167    /// __Default value:__ `undefined` (None)
4168    #[serde(rename = "timeUnit")]
4169    pub time_unit: Option<TimeUnit>,
4170    /// A title for the field. If `null`, the title will be removed.
4171    ///
4172    /// __Default value:__  derived from the field's name and transformation function
4173    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4174    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4175    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4176    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4177    /// the field name.
4178    ///
4179    /// __Notes__:
4180    ///
4181    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4182    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4183    /// [`fieldTitle` function via the `compile` function's
4184    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4185    ///
4186    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4187    /// axis/header/legend title will be used.
4188    pub title: Option<String>,
4189    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4190    /// `"nominal"`).
4191    /// It can also be a `"geojson"` type for encoding
4192    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4193    #[serde(rename = "type")]
4194    pub def_with_condition_type: Option<Type>,
4195    /// A constant value in visual domain.
4196    pub value: Option<PurpleValue>,
4197}
4198
4199#[derive(Debug, Serialize, Deserialize)]
4200pub struct ConditionalPredicateFieldDefClass {
4201    pub test: Box<Option<Box<PurpleLogicalOperandPredicate>>>,
4202    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4203    /// `0` to `1` for opacity).
4204    pub value: Option<PurpleValue>,
4205    /// A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of
4206    /// [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose).
4207    pub selection: Box<Option<Box<PurpleSelectionOperand>>>,
4208    /// Aggregation function for the field
4209    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4210    ///
4211    /// __Default value:__ `undefined` (None)
4212    pub aggregate: Option<AggregateOp>,
4213    /// A flag for binning a `quantitative` field, or [an object defining binning
4214    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4215    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4216    /// will be applied.
4217    ///
4218    /// __Default value:__ `false`
4219    pub bin: Option<Bin>,
4220    /// __Required.__ A string defining the name of the field from which to pull a data value
4221    /// or an object defining iterated values from the
4222    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4223    ///
4224    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4225    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4226    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4227    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4228    /// See more details about escaping in the [field
4229    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4230    ///
4231    /// __Note:__ `field` is not required if `aggregate` is `count`.
4232    pub field: Option<Field>,
4233    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4234    /// or [a temporal field that gets casted as
4235    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4236    ///
4237    /// __Default value:__ `undefined` (None)
4238    #[serde(rename = "timeUnit")]
4239    pub time_unit: Option<TimeUnit>,
4240    /// A title for the field. If `null`, the title will be removed.
4241    ///
4242    /// __Default value:__  derived from the field's name and transformation function
4243    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4244    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4245    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4246    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4247    /// the field name.
4248    ///
4249    /// __Notes__:
4250    ///
4251    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4252    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4253    /// [`fieldTitle` function via the `compile` function's
4254    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4255    ///
4256    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4257    /// axis/header/legend title will be used.
4258    pub title: Option<String>,
4259    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4260    /// `"nominal"`).
4261    /// It can also be a `"geojson"` type for encoding
4262    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4263    #[serde(rename = "type")]
4264    pub conditional_def_type: Option<Type>,
4265}
4266
4267#[derive(Debug, Serialize, Deserialize)]
4268pub struct OrderFieldDef {
4269    /// Aggregation function for the field
4270    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4271    ///
4272    /// __Default value:__ `undefined` (None)
4273    pub aggregate: Option<AggregateOp>,
4274    /// A flag for binning a `quantitative` field, or [an object defining binning
4275    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4276    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4277    /// will be applied.
4278    ///
4279    /// __Default value:__ `false`
4280    pub bin: Option<Bin>,
4281    /// __Required.__ A string defining the name of the field from which to pull a data value
4282    /// or an object defining iterated values from the
4283    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4284    ///
4285    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4286    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4287    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4288    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4289    /// See more details about escaping in the [field
4290    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4291    ///
4292    /// __Note:__ `field` is not required if `aggregate` is `count`.
4293    pub field: Option<Field>,
4294    /// The sort order. One of `"ascending"` (default) or `"descending"`.
4295    pub sort: Option<VgComparatorOrder>,
4296    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4297    /// or [a temporal field that gets casted as
4298    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4299    ///
4300    /// __Default value:__ `undefined` (None)
4301    #[serde(rename = "timeUnit")]
4302    pub time_unit: Option<TimeUnit>,
4303    /// A title for the field. If `null`, the title will be removed.
4304    ///
4305    /// __Default value:__  derived from the field's name and transformation function
4306    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4307    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4308    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4309    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4310    /// the field name.
4311    ///
4312    /// __Notes__:
4313    ///
4314    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4315    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4316    /// [`fieldTitle` function via the `compile` function's
4317    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4318    ///
4319    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4320    /// axis/header/legend title will be used.
4321    pub title: Option<String>,
4322    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4323    /// `"nominal"`).
4324    /// It can also be a `"geojson"` type for encoding
4325    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4326    #[serde(rename = "type")]
4327    pub order_field_def_type: Type,
4328}
4329
4330/// Definition object for a constant value of an encoding channel.
4331#[derive(Debug, Serialize, Deserialize)]
4332pub struct Def {
4333    /// Aggregation function for the field
4334    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4335    ///
4336    /// __Default value:__ `undefined` (None)
4337    pub aggregate: Option<AggregateOp>,
4338    /// A flag for binning a `quantitative` field, or [an object defining binning
4339    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4340    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4341    /// will be applied.
4342    ///
4343    /// __Default value:__ `false`
4344    pub bin: Option<Bin>,
4345    /// __Required.__ A string defining the name of the field from which to pull a data value
4346    /// or an object defining iterated values from the
4347    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4348    ///
4349    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4350    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4351    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4352    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4353    /// See more details about escaping in the [field
4354    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4355    ///
4356    /// __Note:__ `field` is not required if `aggregate` is `count`.
4357    pub field: Option<Field>,
4358    /// The sort order. One of `"ascending"` (default) or `"descending"`.
4359    pub sort: Option<VgComparatorOrder>,
4360    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4361    /// or [a temporal field that gets casted as
4362    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4363    ///
4364    /// __Default value:__ `undefined` (None)
4365    #[serde(rename = "timeUnit")]
4366    pub time_unit: Option<TimeUnit>,
4367    /// A title for the field. If `null`, the title will be removed.
4368    ///
4369    /// __Default value:__  derived from the field's name and transformation function
4370    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4371    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4372    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4373    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4374    /// the field name.
4375    ///
4376    /// __Notes__:
4377    ///
4378    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4379    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4380    /// [`fieldTitle` function via the `compile` function's
4381    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4382    ///
4383    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4384    /// axis/header/legend title will be used.
4385    pub title: Option<String>,
4386    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4387    /// `"nominal"`).
4388    /// It can also be a `"geojson"` type for encoding
4389    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4390    #[serde(rename = "type")]
4391    pub def_type: Option<Type>,
4392    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4393    /// `0` to `1` for opacity).
4394    pub value: Option<PurpleValue>,
4395}
4396
4397/// Text of the `text` mark.
4398///
4399/// A FieldDef with Condition<ValueDef>
4400/// {
4401/// condition: {value: ...},
4402/// field: ...,
4403/// ...
4404/// }
4405///
4406/// A ValueDef with Condition<ValueDef | FieldDef>
4407/// {
4408/// condition: {field: ...} | {value: ...},
4409/// value: ...,
4410/// }
4411#[derive(Debug, Serialize, Deserialize)]
4412pub struct TextClass {
4413    /// Aggregation function for the field
4414    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4415    ///
4416    /// __Default value:__ `undefined` (None)
4417    pub aggregate: Option<AggregateOp>,
4418    /// A flag for binning a `quantitative` field, or [an object defining binning
4419    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4420    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4421    /// will be applied.
4422    ///
4423    /// __Default value:__ `false`
4424    pub bin: Option<Bin>,
4425    /// One or more value definition(s) with a selection predicate.
4426    ///
4427    /// __Note:__ A field definition's `condition` property can only contain [value
4428    /// definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)
4429    /// since Vega-Lite only allows at most one encoded field per encoding channel.
4430    ///
4431    /// A field definition or one or more value definition(s) with a selection predicate.
4432    pub condition: Option<TextCondition>,
4433    /// __Required.__ A string defining the name of the field from which to pull a data value
4434    /// or an object defining iterated values from the
4435    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4436    ///
4437    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4438    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4439    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4440    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4441    /// See more details about escaping in the [field
4442    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4443    ///
4444    /// __Note:__ `field` is not required if `aggregate` is `count`.
4445    pub field: Option<Field>,
4446    /// The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text
4447    /// field. If not defined, this will be determined automatically.
4448    pub format: Option<String>,
4449    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4450    /// or [a temporal field that gets casted as
4451    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4452    ///
4453    /// __Default value:__ `undefined` (None)
4454    #[serde(rename = "timeUnit")]
4455    pub time_unit: Option<TimeUnit>,
4456    /// A title for the field. If `null`, the title will be removed.
4457    ///
4458    /// __Default value:__  derived from the field's name and transformation function
4459    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4460    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4461    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4462    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4463    /// the field name.
4464    ///
4465    /// __Notes__:
4466    ///
4467    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4468    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4469    /// [`fieldTitle` function via the `compile` function's
4470    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4471    ///
4472    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4473    /// axis/header/legend title will be used.
4474    pub title: Option<String>,
4475    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4476    /// `"nominal"`).
4477    /// It can also be a `"geojson"` type for encoding
4478    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4479    #[serde(rename = "type")]
4480    pub text_def_with_condition_type: Option<Type>,
4481    /// A constant value in visual domain.
4482    pub value: Option<PurpleValue>,
4483}
4484
4485#[derive(Debug, Serialize, Deserialize)]
4486pub struct ConditionalPredicateTextFieldDefClass {
4487    pub test: Box<Option<Box<PurpleLogicalOperandPredicate>>>,
4488    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4489    /// `0` to `1` for opacity).
4490    pub value: Option<PurpleValue>,
4491    /// A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of
4492    /// [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose).
4493    pub selection: Box<Option<Box<PurpleSelectionOperand>>>,
4494    /// Aggregation function for the field
4495    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4496    ///
4497    /// __Default value:__ `undefined` (None)
4498    pub aggregate: Option<AggregateOp>,
4499    /// A flag for binning a `quantitative` field, or [an object defining binning
4500    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4501    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4502    /// will be applied.
4503    ///
4504    /// __Default value:__ `false`
4505    pub bin: Option<Bin>,
4506    /// __Required.__ A string defining the name of the field from which to pull a data value
4507    /// or an object defining iterated values from the
4508    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4509    ///
4510    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4511    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4512    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4513    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4514    /// See more details about escaping in the [field
4515    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4516    ///
4517    /// __Note:__ `field` is not required if `aggregate` is `count`.
4518    pub field: Option<Field>,
4519    /// The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text
4520    /// field. If not defined, this will be determined automatically.
4521    pub format: Option<String>,
4522    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4523    /// or [a temporal field that gets casted as
4524    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4525    ///
4526    /// __Default value:__ `undefined` (None)
4527    #[serde(rename = "timeUnit")]
4528    pub time_unit: Option<TimeUnit>,
4529    /// A title for the field. If `null`, the title will be removed.
4530    ///
4531    /// __Default value:__  derived from the field's name and transformation function
4532    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4533    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4534    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4535    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4536    /// the field name.
4537    ///
4538    /// __Notes__:
4539    ///
4540    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4541    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4542    /// [`fieldTitle` function via the `compile` function's
4543    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4544    ///
4545    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4546    /// axis/header/legend title will be used.
4547    pub title: Option<String>,
4548    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4549    /// `"nominal"`).
4550    /// It can also be a `"geojson"` type for encoding
4551    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4552    #[serde(rename = "type")]
4553    pub conditional_def_type: Option<Type>,
4554}
4555
4556#[derive(Debug, Serialize, Deserialize)]
4557pub struct TextFieldDef {
4558    /// Aggregation function for the field
4559    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4560    ///
4561    /// __Default value:__ `undefined` (None)
4562    pub aggregate: Option<AggregateOp>,
4563    /// A flag for binning a `quantitative` field, or [an object defining binning
4564    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4565    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4566    /// will be applied.
4567    ///
4568    /// __Default value:__ `false`
4569    pub bin: Option<Bin>,
4570    /// __Required.__ A string defining the name of the field from which to pull a data value
4571    /// or an object defining iterated values from the
4572    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4573    ///
4574    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4575    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4576    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4577    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4578    /// See more details about escaping in the [field
4579    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4580    ///
4581    /// __Note:__ `field` is not required if `aggregate` is `count`.
4582    pub field: Option<Field>,
4583    /// The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text
4584    /// field. If not defined, this will be determined automatically.
4585    pub format: Option<String>,
4586    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4587    /// or [a temporal field that gets casted as
4588    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4589    ///
4590    /// __Default value:__ `undefined` (None)
4591    #[serde(rename = "timeUnit")]
4592    pub time_unit: Option<TimeUnit>,
4593    /// A title for the field. If `null`, the title will be removed.
4594    ///
4595    /// __Default value:__  derived from the field's name and transformation function
4596    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4597    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4598    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4599    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4600    /// the field name.
4601    ///
4602    /// __Notes__:
4603    ///
4604    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4605    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4606    /// [`fieldTitle` function via the `compile` function's
4607    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4608    ///
4609    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4610    /// axis/header/legend title will be used.
4611    pub title: Option<String>,
4612    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4613    /// `"nominal"`).
4614    /// It can also be a `"geojson"` type for encoding
4615    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4616    #[serde(rename = "type")]
4617    pub text_field_def_type: Type,
4618}
4619
4620/// A FieldDef with Condition<ValueDef>
4621/// {
4622/// condition: {value: ...},
4623/// field: ...,
4624/// ...
4625/// }
4626///
4627/// A ValueDef with Condition<ValueDef | FieldDef>
4628/// {
4629/// condition: {field: ...} | {value: ...},
4630/// value: ...,
4631/// }
4632#[derive(Debug, Serialize, Deserialize)]
4633pub struct TextDefWithCondition {
4634    /// Aggregation function for the field
4635    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4636    ///
4637    /// __Default value:__ `undefined` (None)
4638    pub aggregate: Option<AggregateOp>,
4639    /// A flag for binning a `quantitative` field, or [an object defining binning
4640    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4641    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4642    /// will be applied.
4643    ///
4644    /// __Default value:__ `false`
4645    pub bin: Option<Bin>,
4646    /// One or more value definition(s) with a selection predicate.
4647    ///
4648    /// __Note:__ A field definition's `condition` property can only contain [value
4649    /// definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)
4650    /// since Vega-Lite only allows at most one encoded field per encoding channel.
4651    ///
4652    /// A field definition or one or more value definition(s) with a selection predicate.
4653    pub condition: Option<TextCondition>,
4654    /// __Required.__ A string defining the name of the field from which to pull a data value
4655    /// or an object defining iterated values from the
4656    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4657    ///
4658    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4659    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4660    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4661    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4662    /// See more details about escaping in the [field
4663    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4664    ///
4665    /// __Note:__ `field` is not required if `aggregate` is `count`.
4666    pub field: Option<Field>,
4667    /// The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text
4668    /// field. If not defined, this will be determined automatically.
4669    pub format: Option<String>,
4670    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4671    /// or [a temporal field that gets casted as
4672    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4673    ///
4674    /// __Default value:__ `undefined` (None)
4675    #[serde(rename = "timeUnit")]
4676    pub time_unit: Option<TimeUnit>,
4677    /// A title for the field. If `null`, the title will be removed.
4678    ///
4679    /// __Default value:__  derived from the field's name and transformation function
4680    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4681    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4682    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4683    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4684    /// the field name.
4685    ///
4686    /// __Notes__:
4687    ///
4688    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4689    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4690    /// [`fieldTitle` function via the `compile` function's
4691    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4692    ///
4693    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4694    /// axis/header/legend title will be used.
4695    pub title: Option<String>,
4696    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4697    /// `"nominal"`).
4698    /// It can also be a `"geojson"` type for encoding
4699    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4700    #[serde(rename = "type")]
4701    pub text_def_with_condition_type: Option<Type>,
4702    /// A constant value in visual domain.
4703    pub value: Option<PurpleValue>,
4704}
4705
4706/// X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
4707///
4708/// Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
4709///
4710/// Definition object for a constant value of an encoding channel.
4711#[derive(Debug, Serialize, Deserialize)]
4712pub struct XClass {
4713    /// Aggregation function for the field
4714    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4715    ///
4716    /// __Default value:__ `undefined` (None)
4717    pub aggregate: Option<AggregateOp>,
4718    /// An object defining properties of axis's gridlines, ticks and labels.
4719    /// If `null`, the axis for the encoding channel will be removed.
4720    ///
4721    /// __Default value:__ If undefined, default [axis
4722    /// properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.
4723    pub axis: Option<Axis>,
4724    /// A flag for binning a `quantitative` field, or [an object defining binning
4725    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
4726    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
4727    /// will be applied.
4728    ///
4729    /// __Default value:__ `false`
4730    pub bin: Option<Bin>,
4731    /// __Required.__ A string defining the name of the field from which to pull a data value
4732    /// or an object defining iterated values from the
4733    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
4734    ///
4735    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4736    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4737    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
4738    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4739    /// See more details about escaping in the [field
4740    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
4741    ///
4742    /// __Note:__ `field` is not required if `aggregate` is `count`.
4743    pub field: Option<Field>,
4744    /// An object defining properties of the channel's scale, which is the function that
4745    /// transforms values in the data domain (numbers, dates, strings, etc) to visual values
4746    /// (pixels, colors, sizes) of the encoding channels.
4747    ///
4748    /// If `null`, the scale will be [disabled and the data value will be directly
4749    /// encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).
4750    ///
4751    /// __Default value:__ If undefined, default [scale
4752    /// properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.
4753    pub scale: Option<Scale>,
4754    /// Sort order for the encoded field.
4755    ///
4756    /// For continuous fields (quantitative or temporal), `sort` can be either `"ascending"` or
4757    /// `"descending"`.
4758    ///
4759    /// For discrete fields, `sort` can be one of the following:
4760    /// - `"ascending"` or `"descending"` -- for sorting by the values' natural order in
4761    /// Javascript.
4762    /// - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field)
4763    /// for sorting by another field.
4764    /// - [An array specifying the field values in preferred
4765    /// order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the
4766    /// sort order will obey the values in the array, followed by any unspecified values in their
4767    /// original order.  For discrete time field, values in the sort array can be [date-time
4768    /// definition objects](types#datetime). In addition, for time units `"month"` and `"day"`,
4769    /// the values can be the month or day names (case insensitive) or their 3-letter initials
4770    /// (e.g., `"Mon"`, `"Tue"`).
4771    /// - `null` indicating no sort.
4772    ///
4773    /// __Default value:__ `"ascending"`
4774    ///
4775    /// __Note:__ `null` is not supported for `row` and `column`.
4776    pub sort: Option<Sort>,
4777    /// Type of stacking offset if the field should be stacked.
4778    /// `stack` is only applicable for `x` and `y` channels with continuous domains.
4779    /// For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.
4780    ///
4781    /// `stack` can be one of the following values:
4782    /// - `"zero"`: stacking with baseline offset at zero value of the scale (for creating
4783    /// typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and
4784    /// [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).
4785    /// - `"normalize"` - stacking with normalized domain (for creating [normalized stacked bar
4786    /// and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized). <br/>
4787    /// -`"center"` - stacking with center baseline (for
4788    /// [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).
4789    /// - `null` - No-stacking. This will produce layered
4790    /// [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area
4791    /// chart.
4792    ///
4793    /// __Default value:__ `zero` for plots with all of the following conditions are true:
4794    /// (1) the mark is `bar` or `area`;
4795    /// (2) the stacked measure channel (x or y) has a linear scale;
4796    /// (3) At least one of non-position channels mapped to an unaggregated field that is
4797    /// different from x and y.  Otherwise, `null` by default.
4798    pub stack: Option<StackOffset>,
4799    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4800    /// or [a temporal field that gets casted as
4801    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
4802    ///
4803    /// __Default value:__ `undefined` (None)
4804    #[serde(rename = "timeUnit")]
4805    pub time_unit: Option<TimeUnit>,
4806    /// A title for the field. If `null`, the title will be removed.
4807    ///
4808    /// __Default value:__  derived from the field's name and transformation function
4809    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4810    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4811    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4812    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4813    /// the field name.
4814    ///
4815    /// __Notes__:
4816    ///
4817    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4818    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4819    /// [`fieldTitle` function via the `compile` function's
4820    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4821    ///
4822    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4823    /// axis/header/legend title will be used.
4824    pub title: Option<String>,
4825    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4826    /// `"nominal"`).
4827    /// It can also be a `"geojson"` type for encoding
4828    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
4829    #[serde(rename = "type")]
4830    pub def_type: Option<Type>,
4831    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4832    /// `0` to `1` for opacity).
4833    pub value: Option<PurpleValue>,
4834}
4835
4836#[derive(Debug, Serialize, Deserialize)]
4837pub struct Axis {
4838    /// A boolean flag indicating if the domain (the axis baseline) should be included as part of
4839    /// the axis.
4840    ///
4841    /// __Default value:__ `true`
4842    pub domain: Option<bool>,
4843    /// The formatting pattern for labels. This is D3's [number format
4844    /// pattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's
4845    /// [time format pattern](https://github.com/d3/d3-time-format#locale_format) for time
4846    /// field.
4847    ///
4848    /// See the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for
4849    /// more information.
4850    ///
4851    /// __Default value:__  derived from
4852    /// [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for
4853    /// quantitative fields and from
4854    /// [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for
4855    /// temporal fields.
4856    pub format: Option<String>,
4857    /// A boolean flag indicating if grid lines should be included as part of the axis
4858    ///
4859    /// __Default value:__ `true` for [continuous
4860    /// scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned;
4861    /// otherwise, `false`.
4862    pub grid: Option<bool>,
4863    /// The rotation angle of the axis labels.
4864    ///
4865    /// __Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.
4866    #[serde(rename = "labelAngle")]
4867    pub label_angle: Option<f64>,
4868    /// Indicates if labels should be hidden if they exceed the axis range. If `false `(the
4869    /// default) no bounds overlap analysis is performed. If `true`, labels will be hidden if
4870    /// they exceed the axis range by more than 1 pixel. If this property is a number, it
4871    /// specifies the pixel tolerance: the maximum amount by which a label bounding box may
4872    /// exceed the axis range.
4873    ///
4874    /// __Default value:__ `false`.
4875    #[serde(rename = "labelBound")]
4876    pub label_bound: Option<Label>,
4877    /// Indicates if the first and last axis labels should be aligned flush with the scale range.
4878    /// Flush alignment for a horizontal axis will left-align the first label and right-align the
4879    /// last label. For vertical axes, bottom and top text baselines are applied instead. If this
4880    /// property is a number, it also indicates the number of pixels by which to offset the first
4881    /// and last labels; for example, a value of 2 will flush-align the first and last labels and
4882    /// also push them 2 pixels outward from the center of the axis. The additional adjustment
4883    /// can sometimes help the labels better visually group with corresponding axis ticks.
4884    ///
4885    /// __Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.
4886    #[serde(rename = "labelFlush")]
4887    pub label_flush: Option<Label>,
4888    /// The strategy to use for resolving overlap of axis labels. If `false` (the default), no
4889    /// overlap reduction is attempted. If set to `true` or `"parity"`, a strategy of removing
4890    /// every other label is used (this works well for standard linear axes). If set to
4891    /// `"greedy"`, a linear scan of the labels is performed, removing any labels that overlaps
4892    /// with the last visible label (this often works better for log-scaled axes).
4893    ///
4894    /// __Default value:__ `true` for non-nominal fields with non-log scales; `"greedy"` for log
4895    /// scales; otherwise `false`.
4896    #[serde(rename = "labelOverlap")]
4897    pub label_overlap: Option<LabelOverlapUnion>,
4898    /// The padding, in pixels, between axis and text labels.
4899    #[serde(rename = "labelPadding")]
4900    pub label_padding: Option<f64>,
4901    /// A boolean flag indicating if labels should be included as part of the axis.
4902    ///
4903    /// __Default value:__  `true`.
4904    pub labels: Option<bool>,
4905    /// The maximum extent in pixels that axis ticks and labels should use. This determines a
4906    /// maximum offset value for axis titles.
4907    ///
4908    /// __Default value:__ `undefined`.
4909    #[serde(rename = "maxExtent")]
4910    pub max_extent: Option<f64>,
4911    /// The minimum extent in pixels that axis ticks and labels should use. This determines a
4912    /// minimum offset value for axis titles.
4913    ///
4914    /// __Default value:__ `30` for y-axis; `undefined` for x-axis.
4915    #[serde(rename = "minExtent")]
4916    pub min_extent: Option<f64>,
4917    /// The offset, in pixels, by which to displace the axis from the edge of the enclosing group
4918    /// or data rectangle.
4919    ///
4920    /// __Default value:__ derived from the [axis
4921    /// config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset`
4922    /// (`0` by default)
4923    pub offset: Option<f64>,
4924    /// The orientation of the axis. One of `"top"`, `"bottom"`, `"left"` or `"right"`. The
4925    /// orientation can be used to further specialize the axis type (e.g., a y axis oriented for
4926    /// the right edge of the chart).
4927    ///
4928    /// __Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.
4929    pub orient: Option<TitleOrient>,
4930    /// The anchor position of the axis in pixels. For x-axis with top or bottom orientation,
4931    /// this sets the axis group x coordinate. For y-axis with left or right orientation, this
4932    /// sets the axis group y coordinate.
4933    ///
4934    /// __Default value__: `0`
4935    pub position: Option<f64>,
4936    /// A desired number of ticks, for axes visualizing quantitative scales. The resulting number
4937    /// may be different so that values are "nice" (multiples of 2, 5, 10) and lie within the
4938    /// underlying scale's range.
4939    #[serde(rename = "tickCount")]
4940    pub tick_count: Option<f64>,
4941    /// Boolean value that determines whether the axis should include ticks.
4942    pub ticks: Option<bool>,
4943    /// The size in pixels of axis ticks.
4944    #[serde(rename = "tickSize")]
4945    pub tick_size: Option<f64>,
4946    /// A title for the field. If `null`, the title will be removed.
4947    ///
4948    /// __Default value:__  derived from the field's name and transformation function
4949    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
4950    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
4951    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
4952    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
4953    /// the field name.
4954    ///
4955    /// __Notes__:
4956    ///
4957    /// 1) You can customize the default field title format by providing the [`fieldTitle`
4958    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
4959    /// [`fieldTitle` function via the `compile` function's
4960    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
4961    ///
4962    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
4963    /// axis/header/legend title will be used.
4964    pub title: Option<String>,
4965    /// Max length for axis title if the title is automatically generated from the field's
4966    /// description.
4967    #[serde(rename = "titleMaxLength")]
4968    pub title_max_length: Option<f64>,
4969    /// The padding, in pixels, between title and axis.
4970    #[serde(rename = "titlePadding")]
4971    pub title_padding: Option<f64>,
4972    /// Explicitly set the visible axis tick values.
4973    pub values: Option<Vec<SortElement>>,
4974    /// A non-positive integer indicating z-index of the axis.
4975    /// If zindex is 0, axes should be drawn behind all chart elements.
4976    /// To put them in front, use `"zindex = 1"`.
4977    ///
4978    /// __Default value:__ `1` (in front of the marks) for actual axis and `0` (behind the marks)
4979    /// for grids.
4980    pub zindex: Option<f64>,
4981}
4982
4983/// X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and  `"rule"`.
4984///
4985/// Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and  `"rule"`.
4986///
4987/// Definition object for a data field, its type and transformation of an encoding channel.
4988///
4989/// A data field to use as a unique key for data binding. When a visualization’s data is
4990/// updated, the key value will be used to match data elements to existing mark instances.
4991/// Use a key channel to enable object constancy for transitions over dynamic data.
4992///
4993/// Latitude position of geographically projected marks.
4994///
4995/// Latitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`, and
4996/// `"rule"`.
4997///
4998/// Longitude position of geographically projected marks.
4999///
5000/// Longitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`,
5001/// and  `"rule"`.
5002///
5003/// Definition object for a constant value of an encoding channel.
5004#[derive(Debug, Serialize, Deserialize)]
5005pub struct X2Class {
5006    /// Aggregation function for the field
5007    /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
5008    ///
5009    /// __Default value:__ `undefined` (None)
5010    pub aggregate: Option<AggregateOp>,
5011    /// A flag for binning a `quantitative` field, or [an object defining binning
5012    /// parameters](https://vega.github.io/vega-lite/docs/bin.html#params).
5013    /// If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html)
5014    /// will be applied.
5015    ///
5016    /// __Default value:__ `false`
5017    pub bin: Option<Bin>,
5018    /// __Required.__ A string defining the name of the field from which to pull a data value
5019    /// or an object defining iterated values from the
5020    /// [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
5021    ///
5022    /// __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
5023    /// (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
5024    /// If field names contain dots or brackets but are not nested, you can use `\\` to escape
5025    /// dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
5026    /// See more details about escaping in the [field
5027    /// documentation](https://vega.github.io/vega-lite/docs/field.html).
5028    ///
5029    /// __Note:__ `field` is not required if `aggregate` is `count`.
5030    pub field: Option<Field>,
5031    /// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
5032    /// or [a temporal field that gets casted as
5033    /// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
5034    ///
5035    /// __Default value:__ `undefined` (None)
5036    #[serde(rename = "timeUnit")]
5037    pub time_unit: Option<TimeUnit>,
5038    /// A title for the field. If `null`, the title will be removed.
5039    ///
5040    /// __Default value:__  derived from the field's name and transformation function
5041    /// (`aggregate`, `bin` and `timeUnit`).  If the field has an aggregate function, the
5042    /// function is displayed as part of the title (e.g., `"Sum of Profit"`). If the field is
5043    /// binned or has a time unit applied, the applied function is shown in parentheses (e.g.,
5044    /// `"Profit (binned)"`, `"Transaction Date (year-month)"`).  Otherwise, the title is simply
5045    /// the field name.
5046    ///
5047    /// __Notes__:
5048    ///
5049    /// 1) You can customize the default field title format by providing the [`fieldTitle`
5050    /// property in the [config](https://vega.github.io/vega-lite/docs/config.html) or
5051    /// [`fieldTitle` function via the `compile` function's
5052    /// options](https://vega.github.io/vega-lite/docs/compile.html#field-title).
5053    ///
5054    /// 2) If both field definition's `title` and axis, header, or legend `title` are defined,
5055    /// axis/header/legend title will be used.
5056    pub title: Option<String>,
5057    /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5058    /// `"nominal"`).
5059    /// It can also be a `"geojson"` type for encoding
5060    /// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
5061    #[serde(rename = "type")]
5062    pub def_type: Option<Type>,
5063    /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5064    /// `0` to `1` for opacity).
5065    pub value: Option<PurpleValue>,
5066}
5067
5068/// An object that describes mappings between `row` and `column` channels and their field
5069/// definitions.
5070#[derive(Debug, Serialize, Deserialize)]
5071pub struct FacetMapping {
5072    /// Horizontal facets for trellis plots.
5073    pub column: Option<FacetFieldDef>,
5074    /// Vertical facets for trellis plots.
5075    pub row: Option<FacetFieldDef>,
5076}
5077
5078/// Layer Spec with encoding and projection
5079///
5080/// Unit spec that can have a composite mark.
5081#[derive(Debug, Serialize, Deserialize)]
5082pub struct SpecClass {
5083    /// An object describing the data source
5084    pub data: Option<Data>,
5085    /// Description of this mark for commenting purpose.
5086    pub description: Option<String>,
5087    /// A shared key-value mapping between encoding channels and definition of fields in the
5088    /// underlying layers.
5089    ///
5090    /// A key-value mapping between encoding channels and definition of fields.
5091    pub encoding: Option<SpecEncoding>,
5092    /// The height of a visualization.
5093    ///
5094    /// __Default value:__
5095    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
5096    /// is `"fit"` or its y-channel has a [continuous
5097    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be
5098    /// the value of
5099    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
5100    /// - For y-axis with a band or point scale: if
5101    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
5102    /// or unspecified, the height is [determined by the range step, paddings, and the
5103    /// cardinality of the field mapped to
5104    /// y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the
5105    /// `rangeStep` is `null`, the height will be the value of
5106    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
5107    /// - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
5108    ///
5109    /// __Note__: For plots with [`row` and `column`
5110    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
5111    /// height of a single view.
5112    ///
5113    /// __See also:__ The documentation for [width and
5114    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
5115    pub height: Option<f64>,
5116    /// Layer or single view specifications to be layered.
5117    ///
5118    /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
5119    /// layering facet specifications is not allowed.
5120    pub layer: Option<Vec<LayerSpec>>,
5121    /// Name of the visualization for later reference.
5122    pub name: Option<String>,
5123    /// An object defining properties of the geographic projection shared by underlying layers.
5124    ///
5125    /// An object defining properties of geographic projection, which will be applied to `shape`
5126    /// path for `"geoshape"` marks
5127    /// and to `latitude` and `"longitude"` channels for other marks.
5128    pub projection: Option<Projection>,
5129    /// Scale, axis, and legend resolutions for layers.
5130    ///
5131    /// Scale, axis, and legend resolutions for facets.
5132    ///
5133    /// Scale and legend resolutions for repeated charts.
5134    ///
5135    /// Scale, axis, and legend resolutions for vertically concatenated charts.
5136    ///
5137    /// Scale, axis, and legend resolutions for horizontally concatenated charts.
5138    pub resolve: Option<Resolve>,
5139    /// Title for the plot.
5140    pub title: Option<Title>,
5141    /// An array of data transformations such as filter and new field calculation.
5142    pub transform: Option<Vec<Transform>>,
5143    /// The width of a visualization.
5144    ///
5145    /// __Default value:__ This will be determined by the following rules:
5146    ///
5147    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
5148    /// is `"fit"` or its x-channel has a [continuous
5149    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be
5150    /// the value of
5151    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
5152    /// - For x-axis with a band or point scale: if
5153    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
5154    /// or unspecified, the width is [determined by the range step, paddings, and the cardinality
5155    /// of the field mapped to
5156    /// x-channel](https://vega.github.io/vega-lite/docs/scale.html#band).   Otherwise, if the
5157    /// `rangeStep` is `null`, the width will be the value of
5158    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
5159    /// - If no field is mapped to `x` channel, the `width` will be the value of
5160    /// [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height)
5161    /// for `text` mark and the value of `rangeStep` for other marks.
5162    ///
5163    /// __Note:__ For plots with [`row` and `column`
5164    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
5165    /// width of a single view.
5166    ///
5167    /// __See also:__ The documentation for [width and
5168    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
5169    pub width: Option<f64>,
5170    /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
5171    /// `"line"`,
5172    /// `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
5173    /// object](https://vega.github.io/vega-lite/docs/mark.html#mark-def).
5174    pub mark: Option<AnyMark>,
5175    /// A key-value mapping between selection names and definitions.
5176    pub selection: Option<HashMap<String, SelectionDef>>,
5177    /// The alignment to apply to grid rows and columns.
5178    /// The supported string values are `"all"`, `"each"`, and `"none"`.
5179    ///
5180    /// - For `"none"`, a flow layout will be used, in which adjacent subviews are simply placed
5181    /// one after the other.
5182    /// - For `"each"`, subviews will be aligned into a clean grid structure, but each row or
5183    /// column may be of variable size.
5184    /// - For `"all"`, subviews will be aligned and each row or column will be sized identically
5185    /// based on the maximum observed size. String values for this property will be applied to
5186    /// both grid rows and columns.
5187    ///
5188    /// Alternatively, an object value of the form `{"row": string, "column": string}` can be
5189    /// used to supply different alignments for rows and columns.
5190    ///
5191    /// __Default value:__ `"all"`.
5192    pub align: Option<Align>,
5193    /// The bounds calculation method to use for determining the extent of a sub-plot. One of
5194    /// `full` (the default) or `flush`.
5195    ///
5196    /// - If set to `full`, the entire calculated bounds (including axes, title, and legend) will
5197    /// be used.
5198    /// - If set to `flush`, only the specified width and height values for the sub-view will be
5199    /// used. The `flush` setting can be useful when attempting to place sub-plots without axes
5200    /// or legends into a uniform grid structure.
5201    ///
5202    /// __Default value:__ `"full"`
5203    pub bounds: Option<Bounds>,
5204    /// Boolean flag indicating if subviews should be centered relative to their respective rows
5205    /// or columns.
5206    ///
5207    /// An object value of the form `{"row": boolean, "column": boolean}` can be used to supply
5208    /// different centering values for rows and columns.
5209    ///
5210    /// __Default value:__ `false`
5211    ///
5212    /// Boolean flag indicating if subviews should be centered relative to their respective rows
5213    /// or columns.
5214    ///
5215    /// __Default value:__ `false`
5216    pub center: Option<Center>,
5217    /// An object that describes mappings between `row` and `column` channels and their field
5218    /// definitions.
5219    pub facet: Option<FacetMapping>,
5220    /// The spacing in pixels between sub-views of the composition operator.
5221    /// An object of the form `{"row": number, "column": number}` can be used to set
5222    /// different spacing values for rows and columns.
5223    ///
5224    /// __Default value__: `10`
5225    ///
5226    /// The spacing in pixels between sub-views of the concat operator.
5227    ///
5228    /// __Default value__: `10`
5229    pub spacing: Option<Spacing>,
5230    /// A specification of the view that gets faceted.
5231    pub spec: Box<Option<SpecClass>>,
5232    /// An object that describes what fields should be repeated into views that are laid out as a
5233    /// `row` or `column`.
5234    pub repeat: Option<Repeat>,
5235    /// A list of views that should be concatenated and put into a column.
5236    pub vconcat: Option<Vec<Spec>>,
5237    /// A list of views that should be concatenated and put into a row.
5238    pub hconcat: Option<Vec<Spec>>,
5239}
5240
5241/// Unit spec that can have a composite mark.
5242///
5243/// Layer Spec with encoding and projection
5244#[derive(Debug, Serialize, Deserialize)]
5245pub struct Spec {
5246    /// An object describing the data source
5247    pub data: Option<Data>,
5248    /// Description of this mark for commenting purpose.
5249    pub description: Option<String>,
5250    /// A key-value mapping between encoding channels and definition of fields.
5251    ///
5252    /// A shared key-value mapping between encoding channels and definition of fields in the
5253    /// underlying layers.
5254    pub encoding: Option<SpecEncoding>,
5255    /// The height of a visualization.
5256    ///
5257    /// __Default value:__
5258    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
5259    /// is `"fit"` or its y-channel has a [continuous
5260    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be
5261    /// the value of
5262    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
5263    /// - For y-axis with a band or point scale: if
5264    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
5265    /// or unspecified, the height is [determined by the range step, paddings, and the
5266    /// cardinality of the field mapped to
5267    /// y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the
5268    /// `rangeStep` is `null`, the height will be the value of
5269    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
5270    /// - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
5271    ///
5272    /// __Note__: For plots with [`row` and `column`
5273    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
5274    /// height of a single view.
5275    ///
5276    /// __See also:__ The documentation for [width and
5277    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
5278    pub height: Option<f64>,
5279    /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
5280    /// `"line"`,
5281    /// `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
5282    /// object](https://vega.github.io/vega-lite/docs/mark.html#mark-def).
5283    pub mark: Option<AnyMark>,
5284    /// Name of the visualization for later reference.
5285    pub name: Option<String>,
5286    /// An object defining properties of geographic projection, which will be applied to `shape`
5287    /// path for `"geoshape"` marks
5288    /// and to `latitude` and `"longitude"` channels for other marks.
5289    ///
5290    /// An object defining properties of the geographic projection shared by underlying layers.
5291    pub projection: Option<Projection>,
5292    /// A key-value mapping between selection names and definitions.
5293    pub selection: Option<HashMap<String, SelectionDef>>,
5294    /// Title for the plot.
5295    pub title: Option<Title>,
5296    /// An array of data transformations such as filter and new field calculation.
5297    pub transform: Option<Vec<Transform>>,
5298    /// The width of a visualization.
5299    ///
5300    /// __Default value:__ This will be determined by the following rules:
5301    ///
5302    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
5303    /// is `"fit"` or its x-channel has a [continuous
5304    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be
5305    /// the value of
5306    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
5307    /// - For x-axis with a band or point scale: if
5308    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
5309    /// or unspecified, the width is [determined by the range step, paddings, and the cardinality
5310    /// of the field mapped to
5311    /// x-channel](https://vega.github.io/vega-lite/docs/scale.html#band).   Otherwise, if the
5312    /// `rangeStep` is `null`, the width will be the value of
5313    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
5314    /// - If no field is mapped to `x` channel, the `width` will be the value of
5315    /// [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height)
5316    /// for `text` mark and the value of `rangeStep` for other marks.
5317    ///
5318    /// __Note:__ For plots with [`row` and `column`
5319    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
5320    /// width of a single view.
5321    ///
5322    /// __See also:__ The documentation for [width and
5323    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
5324    pub width: Option<f64>,
5325    /// Layer or single view specifications to be layered.
5326    ///
5327    /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
5328    /// layering facet specifications is not allowed.
5329    pub layer: Option<Vec<LayerSpec>>,
5330    /// Scale, axis, and legend resolutions for layers.
5331    ///
5332    /// Scale, axis, and legend resolutions for facets.
5333    ///
5334    /// Scale and legend resolutions for repeated charts.
5335    ///
5336    /// Scale, axis, and legend resolutions for vertically concatenated charts.
5337    ///
5338    /// Scale, axis, and legend resolutions for horizontally concatenated charts.
5339    pub resolve: Option<Resolve>,
5340    /// The alignment to apply to grid rows and columns.
5341    /// The supported string values are `"all"`, `"each"`, and `"none"`.
5342    ///
5343    /// - For `"none"`, a flow layout will be used, in which adjacent subviews are simply placed
5344    /// one after the other.
5345    /// - For `"each"`, subviews will be aligned into a clean grid structure, but each row or
5346    /// column may be of variable size.
5347    /// - For `"all"`, subviews will be aligned and each row or column will be sized identically
5348    /// based on the maximum observed size. String values for this property will be applied to
5349    /// both grid rows and columns.
5350    ///
5351    /// Alternatively, an object value of the form `{"row": string, "column": string}` can be
5352    /// used to supply different alignments for rows and columns.
5353    ///
5354    /// __Default value:__ `"all"`.
5355    pub align: Option<Align>,
5356    /// The bounds calculation method to use for determining the extent of a sub-plot. One of
5357    /// `full` (the default) or `flush`.
5358    ///
5359    /// - If set to `full`, the entire calculated bounds (including axes, title, and legend) will
5360    /// be used.
5361    /// - If set to `flush`, only the specified width and height values for the sub-view will be
5362    /// used. The `flush` setting can be useful when attempting to place sub-plots without axes
5363    /// or legends into a uniform grid structure.
5364    ///
5365    /// __Default value:__ `"full"`
5366    pub bounds: Option<Bounds>,
5367    /// Boolean flag indicating if subviews should be centered relative to their respective rows
5368    /// or columns.
5369    ///
5370    /// An object value of the form `{"row": boolean, "column": boolean}` can be used to supply
5371    /// different centering values for rows and columns.
5372    ///
5373    /// __Default value:__ `false`
5374    ///
5375    /// Boolean flag indicating if subviews should be centered relative to their respective rows
5376    /// or columns.
5377    ///
5378    /// __Default value:__ `false`
5379    pub center: Option<Center>,
5380    /// An object that describes mappings between `row` and `column` channels and their field
5381    /// definitions.
5382    pub facet: Option<FacetMapping>,
5383    /// The spacing in pixels between sub-views of the composition operator.
5384    /// An object of the form `{"row": number, "column": number}` can be used to set
5385    /// different spacing values for rows and columns.
5386    ///
5387    /// __Default value__: `10`
5388    ///
5389    /// The spacing in pixels between sub-views of the concat operator.
5390    ///
5391    /// __Default value__: `10`
5392    pub spacing: Option<Spacing>,
5393    /// A specification of the view that gets faceted.
5394    pub spec: Box<Option<SpecClass>>,
5395    /// An object that describes what fields should be repeated into views that are laid out as a
5396    /// `row` or `column`.
5397    pub repeat: Option<Repeat>,
5398    /// A list of views that should be concatenated and put into a column.
5399    pub vconcat: Option<Vec<Spec>>,
5400    /// A list of views that should be concatenated and put into a row.
5401    pub hconcat: Option<Vec<Spec>>,
5402}
5403
5404/// A shared key-value mapping between encoding channels and definition of fields in the
5405/// underlying layers.
5406///
5407/// A key-value mapping between encoding channels and definition of fields.
5408#[derive(Debug, Serialize, Deserialize)]
5409pub struct SpecEncoding {
5410    /// Color of the marks – either fill or stroke color based on  the `filled` property of mark
5411    /// definition.
5412    /// By default, `color` represents fill color for `"area"`, `"bar"`, `"tick"`,
5413    /// `"text"`, `"trail"`, `"circle"`, and `"square"` / stroke color for `"line"` and
5414    /// `"point"`.
5415    ///
5416    /// __Default value:__ If undefined, the default color depends on [mark
5417    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
5418    ///
5419    /// _Note:_
5420    /// 1) For fine-grained control over both fill and stroke colors of the marks, please use the
5421    /// `fill` and `stroke` channels.  If either `fill` or `stroke` channel is specified, `color`
5422    /// channel will be ignored.
5423    /// 2) See the scale documentation for more information about customizing [color
5424    /// scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme).
5425    pub color: Option<MarkPropDefWithCondition>,
5426    /// Additional levels of detail for grouping data in aggregate views and
5427    /// in line, trail, and area marks without mapping data to a specific visual channel.
5428    pub detail: Option<Detail>,
5429    /// Fill color of the marks.
5430    /// __Default value:__ If undefined, the default color depends on [mark
5431    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
5432    ///
5433    /// _Note:_ When using `fill` channel, `color ` channel will be ignored. To customize both
5434    /// fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`).
5435    pub fill: Option<MarkPropDefWithCondition>,
5436    /// A URL to load upon mouse click.
5437    pub href: Option<DefWithCondition>,
5438    /// A data field to use as a unique key for data binding. When a visualization’s data is
5439    /// updated, the key value will be used to match data elements to existing mark instances.
5440    /// Use a key channel to enable object constancy for transitions over dynamic data.
5441    pub key: Option<FieldDef>,
5442    /// Latitude position of geographically projected marks.
5443    pub latitude: Option<FieldDef>,
5444    /// Latitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`, and
5445    /// `"rule"`.
5446    pub latitude2: Option<FieldDef>,
5447    /// Longitude position of geographically projected marks.
5448    pub longitude: Option<FieldDef>,
5449    /// Longitude-2 position for geographically projected ranged `"area"`, `"bar"`, `"rect"`,
5450    /// and  `"rule"`.
5451    pub longitude2: Option<FieldDef>,
5452    /// Opacity of the marks – either can be a value or a range.
5453    ///
5454    /// __Default value:__ If undefined, the default opacity depends on [mark
5455    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property.
5456    pub opacity: Option<MarkPropDefWithCondition>,
5457    /// Order of the marks.
5458    /// - For stacked marks, this `order` channel encodes [stack
5459    /// order](https://vega.github.io/vega-lite/docs/stack.html#order).
5460    /// - For line and trail marks, this `order` channel encodes order of data points in the
5461    /// lines. This can be useful for creating [a connected
5462    /// scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html).
5463    /// Setting `order` to `{"value": null}` makes the line marks use the original order in the
5464    /// data sources.
5465    /// - Otherwise, this `order` channel encodes layer order of the marks.
5466    ///
5467    /// __Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating
5468    /// additional aggregation grouping.
5469    pub order: Option<Order>,
5470    /// For `point` marks the supported values are
5471    /// `"circle"` (default), `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`,
5472    /// or `"triangle-down"`, or else a custom SVG path string.
5473    /// For `geoshape` marks it should be a field definition of the geojson data
5474    ///
5475    /// __Default value:__ If undefined, the default shape depends on [mark
5476    /// config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape`
5477    /// property.
5478    pub shape: Option<MarkPropDefWithCondition>,
5479    /// Size of the mark.
5480    /// - For `"point"`, `"square"` and `"circle"`, – the symbol size, or pixel area of the mark.
5481    /// - For `"bar"` and `"tick"` – the bar and tick's size.
5482    /// - For `"text"` – the text's font size.
5483    /// - Size is unsupported for `"line"`, `"area"`, and `"rect"`. (Use `"trail"` instead of
5484    /// line with varying size)
5485    pub size: Option<MarkPropDefWithCondition>,
5486    /// Stroke color of the marks.
5487    /// __Default value:__ If undefined, the default color depends on [mark
5488    /// config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.
5489    ///
5490    /// _Note:_ When using `stroke` channel, `color ` channel will be ignored. To customize both
5491    /// stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`).
5492    pub stroke: Option<MarkPropDefWithCondition>,
5493    /// Text of the `text` mark.
5494    pub text: Option<TextClass>,
5495    /// The tooltip text to show upon mouse hover.
5496    pub tooltip: Option<Tooltip>,
5497    /// X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
5498    pub x: Option<XClass>,
5499    /// X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and  `"rule"`.
5500    pub x2: Option<X2Class>,
5501    /// Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
5502    pub y: Option<XClass>,
5503    /// Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and  `"rule"`.
5504    pub y2: Option<X2Class>,
5505}
5506
5507/// Layer Spec with encoding and projection
5508///
5509/// Unit spec that can have a composite mark.
5510#[derive(Debug, Serialize, Deserialize)]
5511pub struct LayerSpec {
5512    /// An object describing the data source
5513    pub data: Option<Data>,
5514    /// Description of this mark for commenting purpose.
5515    pub description: Option<String>,
5516    /// A shared key-value mapping between encoding channels and definition of fields in the
5517    /// underlying layers.
5518    ///
5519    /// A key-value mapping between encoding channels and definition of fields.
5520    pub encoding: Option<SpecEncoding>,
5521    /// The height of a visualization.
5522    ///
5523    /// __Default value:__
5524    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
5525    /// is `"fit"` or its y-channel has a [continuous
5526    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be
5527    /// the value of
5528    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
5529    /// - For y-axis with a band or point scale: if
5530    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
5531    /// or unspecified, the height is [determined by the range step, paddings, and the
5532    /// cardinality of the field mapped to
5533    /// y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the
5534    /// `rangeStep` is `null`, the height will be the value of
5535    /// [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).
5536    /// - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
5537    ///
5538    /// __Note__: For plots with [`row` and `column`
5539    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
5540    /// height of a single view.
5541    ///
5542    /// __See also:__ The documentation for [width and
5543    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
5544    pub height: Option<f64>,
5545    /// Layer or single view specifications to be layered.
5546    ///
5547    /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
5548    /// layering facet specifications is not allowed.
5549    pub layer: Option<Vec<LayerSpec>>,
5550    /// Name of the visualization for later reference.
5551    pub name: Option<String>,
5552    /// An object defining properties of the geographic projection shared by underlying layers.
5553    ///
5554    /// An object defining properties of geographic projection, which will be applied to `shape`
5555    /// path for `"geoshape"` marks
5556    /// and to `latitude` and `"longitude"` channels for other marks.
5557    pub projection: Option<Projection>,
5558    /// Scale, axis, and legend resolutions for layers.
5559    pub resolve: Option<Resolve>,
5560    /// Title for the plot.
5561    pub title: Option<Title>,
5562    /// An array of data transformations such as filter and new field calculation.
5563    pub transform: Option<Vec<Transform>>,
5564    /// The width of a visualization.
5565    ///
5566    /// __Default value:__ This will be determined by the following rules:
5567    ///
5568    /// - If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type
5569    /// is `"fit"` or its x-channel has a [continuous
5570    /// scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be
5571    /// the value of
5572    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
5573    /// - For x-axis with a band or point scale: if
5574    /// [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value
5575    /// or unspecified, the width is [determined by the range step, paddings, and the cardinality
5576    /// of the field mapped to
5577    /// x-channel](https://vega.github.io/vega-lite/docs/scale.html#band).   Otherwise, if the
5578    /// `rangeStep` is `null`, the width will be the value of
5579    /// [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).
5580    /// - If no field is mapped to `x` channel, the `width` will be the value of
5581    /// [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height)
5582    /// for `text` mark and the value of `rangeStep` for other marks.
5583    ///
5584    /// __Note:__ For plots with [`row` and `column`
5585    /// channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the
5586    /// width of a single view.
5587    ///
5588    /// __See also:__ The documentation for [width and
5589    /// height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.
5590    pub width: Option<f64>,
5591    /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
5592    /// `"line"`,
5593    /// `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
5594    /// object](https://vega.github.io/vega-lite/docs/mark.html#mark-def).
5595    pub mark: Option<AnyMark>,
5596    /// A key-value mapping between selection names and definitions.
5597    pub selection: Option<HashMap<String, SelectionDef>>,
5598}
5599
5600#[derive(Debug, Serialize, Deserialize)]
5601pub struct MarkDef {
5602    /// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
5603    pub align: Option<HorizontalAlign>,
5604    /// The rotation angle of the text, in degrees.
5605    pub angle: Option<f64>,
5606    /// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
5607    ///
5608    /// __Default value:__ `"middle"`
5609    pub baseline: Option<VerticalAlign>,
5610    /// Offset between bars for binned field.  Ideal value for this is either 0 (Preferred by
5611    /// statisticians) or 1 (Vega-Lite Default, D3 example style).
5612    ///
5613    /// __Default value:__ `1`
5614    #[serde(rename = "binSpacing")]
5615    pub bin_spacing: Option<f64>,
5616    /// Whether a mark be clipped to the enclosing group’s width and height.
5617    pub clip: Option<bool>,
5618    /// Default color.  Note that `fill` and `stroke` have higher precedence than `color` and
5619    /// will override `color`.
5620    ///
5621    /// __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
5622    ///
5623    /// __Note:__ This property cannot be used in a [style
5624    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
5625    pub color: Option<String>,
5626    /// The radius in pixels of rounded rectangle corners.
5627    ///
5628    /// __Default value:__ `0`
5629    #[serde(rename = "cornerRadius")]
5630    pub corner_radius: Option<f64>,
5631    /// The mouse cursor used over the mark. Any valid [CSS cursor
5632    /// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
5633    pub cursor: Option<Cursor>,
5634    /// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
5635    /// This property determines on which side is truncated in response to the limit parameter.
5636    ///
5637    /// __Default value:__ `"ltr"`
5638    pub dir: Option<Dir>,
5639    /// The horizontal offset, in pixels, between the text label and its anchor point. The offset
5640    /// is applied after rotation by the _angle_ property.
5641    pub dx: Option<f64>,
5642    /// The vertical offset, in pixels, between the text label and its anchor point. The offset
5643    /// is applied after rotation by the _angle_ property.
5644    pub dy: Option<f64>,
5645    /// The ellipsis string for text truncated in response to the limit parameter.
5646    ///
5647    /// __Default value:__ `"…"`
5648    pub ellipsis: Option<String>,
5649    /// Default Fill Color.  This has higher precedence than `config.color`
5650    ///
5651    /// __Default value:__ (None)
5652    pub fill: Option<String>,
5653    /// Whether the mark's color should be used as fill color instead of stroke color.
5654    ///
5655    /// __Default value:__ `true` for all marks except `point` and `false` for `point`.
5656    ///
5657    /// __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
5658    ///
5659    /// __Note:__ This property cannot be used in a [style
5660    /// config](https://vega.github.io/vega-lite/docs/mark.html#style-config).
5661    pub filled: Option<bool>,
5662    /// The fill opacity (value between [0,1]).
5663    ///
5664    /// __Default value:__ `1`
5665    #[serde(rename = "fillOpacity")]
5666    pub fill_opacity: Option<f64>,
5667    /// The typeface to set the text in (e.g., `"Helvetica Neue"`).
5668    pub font: Option<String>,
5669    /// The font size, in pixels.
5670    #[serde(rename = "fontSize")]
5671    pub font_size: Option<f64>,
5672    /// The font style (e.g., `"italic"`).
5673    #[serde(rename = "fontStyle")]
5674    pub font_style: Option<FontStyle>,
5675    /// The font weight.
5676    /// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
5677    /// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
5678    #[serde(rename = "fontWeight")]
5679    pub font_weight: Option<FontWeight>,
5680    /// A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
5681    pub href: Option<String>,
5682    /// The line interpolation method to use for line and area marks. One of the following:
5683    /// - `"linear"`: piecewise linear segments, as in a polyline.
5684    /// - `"linear-closed"`: close the linear segments to form a polygon.
5685    /// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
5686    /// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
5687    /// function.
5688    /// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
5689    /// function.
5690    /// - `"basis"`: a B-spline, with control point duplication on the ends.
5691    /// - `"basis-open"`: an open B-spline; may not intersect the start or end.
5692    /// - `"basis-closed"`: a closed B-spline, as in a loop.
5693    /// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
5694    /// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
5695    /// will intersect other control points.
5696    /// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
5697    /// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
5698    /// spline.
5699    /// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
5700    pub interpolate: Option<Interpolate>,
5701    /// The maximum length of the text mark in pixels. The text value will be automatically
5702    /// truncated if the rendered size exceeds the limit.
5703    ///
5704    /// __Default value:__ `0`, indicating no limit
5705    pub limit: Option<f64>,
5706    /// A flag for overlaying line on top of area marks, or an object defining the properties of
5707    /// the overlayed lines.
5708    ///
5709    /// - If this value is an empty object (`{}`) or `true`, lines with default properties will
5710    /// be used.
5711    ///
5712    /// - If this value is `false`, no lines would be automatically added to area marks.
5713    ///
5714    /// __Default value:__ `false`.
5715    pub line: Option<Line>,
5716    /// The overall opacity (value between [0,1]).
5717    ///
5718    /// __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
5719    /// `square` marks or layered `bar` charts and `1` otherwise.
5720    pub opacity: Option<f64>,
5721    /// The orientation of a non-stacked bar, tick, area, and line charts.
5722    /// The value is either horizontal (default) or vertical.
5723    /// - For bar, rule and tick, this determines whether the size of the bar and tick
5724    /// should be applied to x or y dimension.
5725    /// - For area, this property determines the orient property of the Vega output.
5726    /// - For line and trail marks, this property determines the sort order of the points in the
5727    /// line
5728    /// if `config.sortLineBy` is not specified.
5729    /// For stacked charts, this is always determined by the orientation of the stack;
5730    /// therefore explicitly specified value will be ignored.
5731    pub orient: Option<Orient>,
5732    /// A flag for overlaying points on top of line or area marks, or an object defining the
5733    /// properties of the overlayed points.
5734    ///
5735    /// - If this property is `"transparent"`, transparent points will be used (for enhancing
5736    /// tooltips and selections).
5737    ///
5738    /// - If this property is an empty object (`{}`) or `true`, filled points with default
5739    /// properties will be used.
5740    ///
5741    /// - If this property is `false`, no points would be automatically added to line or area
5742    /// marks.
5743    ///
5744    /// __Default value:__ `false`.
5745    pub point: Option<PointUnion>,
5746    /// Polar coordinate radial offset, in pixels, of the text label from the origin determined
5747    /// by the `x` and `y` properties.
5748    pub radius: Option<f64>,
5749    /// The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
5750    /// `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
5751    ///
5752    /// __Default value:__ `"circle"`
5753    pub shape: Option<String>,
5754    /// The pixel area each the point/circle/square.
5755    /// For example: in the case of circles, the radius is determined in part by the square root
5756    /// of the size value.
5757    ///
5758    /// __Default value:__ `30`
5759    pub size: Option<f64>,
5760    /// Default Stroke Color.  This has higher precedence than `config.color`
5761    ///
5762    /// __Default value:__ (None)
5763    pub stroke: Option<String>,
5764    /// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
5765    ///
5766    /// __Default value:__ `"square"`
5767    #[serde(rename = "strokeCap")]
5768    pub stroke_cap: Option<StrokeCap>,
5769    /// An array of alternating stroke, space lengths for creating dashed or dotted lines.
5770    #[serde(rename = "strokeDash")]
5771    pub stroke_dash: Option<Vec<f64>>,
5772    /// The offset (in pixels) into which to begin drawing with the stroke dash array.
5773    #[serde(rename = "strokeDashOffset")]
5774    pub stroke_dash_offset: Option<f64>,
5775    /// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
5776    ///
5777    /// __Default value:__ `"miter"`
5778    #[serde(rename = "strokeJoin")]
5779    pub stroke_join: Option<StrokeJoin>,
5780    /// The miter limit at which to bevel a line join.
5781    #[serde(rename = "strokeMiterLimit")]
5782    pub stroke_miter_limit: Option<f64>,
5783    /// The stroke opacity (value between [0,1]).
5784    ///
5785    /// __Default value:__ `1`
5786    #[serde(rename = "strokeOpacity")]
5787    pub stroke_opacity: Option<f64>,
5788    /// The stroke width, in pixels.
5789    #[serde(rename = "strokeWidth")]
5790    pub stroke_width: Option<f64>,
5791    /// A string or array of strings indicating the name of custom styles to apply to the mark. A
5792    /// style is a named collection of mark property defaults defined within the [style
5793    /// configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is
5794    /// an array, later styles will override earlier styles. Any [mark
5795    /// properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly
5796    /// defined within the `encoding` will override a style default.
5797    ///
5798    /// __Default value:__ The mark's name.  For example, a bar mark will have style `"bar"` by
5799    /// default.
5800    /// __Note:__ Any specified style will augment the default style. For example, a bar mark
5801    /// with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
5802    /// specified style `"foo"` has higher precedence).
5803    pub style: Option<Style>,
5804    /// Depending on the interpolation type, sets the tension parameter (for line and area marks).
5805    pub tension: Option<f64>,
5806    /// Placeholder text if the `text` channel is not specified
5807    pub text: Option<String>,
5808    /// Polar coordinate angle, in radians, of the text label from the origin determined by the
5809    /// `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
5810    /// `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
5811    /// indicating "north".
5812    pub theta: Option<f64>,
5813    /// Thickness of the tick mark.
5814    ///
5815    /// __Default value:__  `1`
5816    pub thickness: Option<f64>,
5817    /// The tooltip text to show upon mouse hover.
5818    pub tooltip: Option<serde_json::Value>,
5819    /// The mark type.
5820    /// One of `"bar"`, `"circle"`, `"square"`, `"tick"`, `"line"`,
5821    /// `"area"`, `"point"`, `"geoshape"`, `"rule"`, and `"text"`.
5822    #[serde(rename = "type")]
5823    pub mark_def_type: Mark,
5824    /// Offset for x2-position.
5825    #[serde(rename = "x2Offset")]
5826    pub x2_offset: Option<f64>,
5827    /// Offset for x-position.
5828    #[serde(rename = "xOffset")]
5829    pub x_offset: Option<f64>,
5830    /// Offset for y2-position.
5831    #[serde(rename = "y2Offset")]
5832    pub y2_offset: Option<f64>,
5833    /// Offset for y-position.
5834    #[serde(rename = "yOffset")]
5835    pub y_offset: Option<f64>,
5836}
5837
5838/// An object defining properties of geographic projection, which will be applied to `shape`
5839/// path for `"geoshape"` marks
5840/// and to `latitude` and `"longitude"` channels for other marks.
5841///
5842/// An object defining properties of the geographic projection shared by underlying layers.
5843#[derive(Debug, Serialize, Deserialize)]
5844pub struct Projection {
5845    /// Sets the projection’s center to the specified center, a two-element array of longitude
5846    /// and latitude in degrees.
5847    ///
5848    /// __Default value:__ `[0, 0]`
5849    pub center: Option<Vec<f64>>,
5850    /// Sets the projection’s clipping circle radius to the specified angle in degrees. If
5851    /// `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
5852    /// than small-circle clipping.
5853    #[serde(rename = "clipAngle")]
5854    pub clip_angle: Option<f64>,
5855    /// Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
5856    /// bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
5857    /// the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
5858    /// viewport clipping is performed.
5859    #[serde(rename = "clipExtent")]
5860    pub clip_extent: Option<Vec<Vec<f64>>>,
5861    pub coefficient: Option<f64>,
5862    pub distance: Option<f64>,
5863    pub fraction: Option<f64>,
5864    pub lobes: Option<f64>,
5865    pub parallel: Option<f64>,
5866    /// Sets the threshold for the projection’s [adaptive
5867    /// resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
5868    /// value corresponds to the [Douglas–Peucker
5869    /// distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
5870    /// If precision is not specified, returns the projection’s current resampling precision
5871    /// which defaults to `√0.5 ≅ 0.70710…`.
5872    pub precision: Option<HashMap<String, PrecisionValue>>,
5873    pub radius: Option<f64>,
5874    pub ratio: Option<f64>,
5875    /// Sets the projection’s three-axis rotation to the specified angles, which must be a two-
5876    /// or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
5877    /// angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
5878    ///
5879    /// __Default value:__ `[0, 0, 0]`
5880    pub rotate: Option<Vec<f64>>,
5881    pub spacing: Option<f64>,
5882    pub tilt: Option<f64>,
5883    /// The cartographic projection to use. This value is case-insensitive, for example
5884    /// `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
5885    /// projection types [in the
5886    /// documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
5887    ///
5888    /// __Default value:__ `mercator`
5889    #[serde(rename = "type")]
5890    pub projection_type: Option<VgProjectionType>,
5891}
5892
5893/// Scale, axis, and legend resolutions for facets.
5894///
5895/// Defines how scales, axes, and legends from different specs should be combined. Resolve is
5896/// a mapping from `scale`, `axis`, and `legend` to a mapping from channels to resolutions.
5897///
5898/// Scale, axis, and legend resolutions for layers.
5899///
5900/// Scale and legend resolutions for repeated charts.
5901///
5902/// Scale, axis, and legend resolutions for vertically concatenated charts.
5903///
5904/// Scale, axis, and legend resolutions for horizontally concatenated charts.
5905#[derive(Debug, Serialize, Deserialize)]
5906pub struct Resolve {
5907    pub axis: Option<AxisResolveMap>,
5908    pub legend: Option<LegendResolveMap>,
5909    pub scale: Option<ScaleResolveMap>,
5910}
5911
5912#[derive(Debug, Serialize, Deserialize)]
5913pub struct AxisResolveMap {
5914    pub x: Option<ResolveMode>,
5915    pub y: Option<ResolveMode>,
5916}
5917
5918#[derive(Debug, Serialize, Deserialize)]
5919pub struct LegendResolveMap {
5920    pub color: Option<ResolveMode>,
5921    pub fill: Option<ResolveMode>,
5922    pub opacity: Option<ResolveMode>,
5923    pub shape: Option<ResolveMode>,
5924    pub size: Option<ResolveMode>,
5925    pub stroke: Option<ResolveMode>,
5926}
5927
5928#[derive(Debug, Serialize, Deserialize)]
5929pub struct ScaleResolveMap {
5930    pub color: Option<ResolveMode>,
5931    pub fill: Option<ResolveMode>,
5932    pub opacity: Option<ResolveMode>,
5933    pub shape: Option<ResolveMode>,
5934    pub size: Option<ResolveMode>,
5935    pub stroke: Option<ResolveMode>,
5936    pub x: Option<ResolveMode>,
5937    pub y: Option<ResolveMode>,
5938}
5939
5940#[derive(Debug, Serialize, Deserialize)]
5941pub struct SelectionDef {
5942    /// Establish a two-way binding between a single selection and input elements
5943    /// (also known as dynamic query widgets). A binding takes the form of
5944    /// Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)
5945    /// or can be a mapping between projected field/encodings and binding definitions.
5946    ///
5947    /// See the [bind transform](https://vega.github.io/vega-lite/docs/bind.html) documentation
5948    /// for more information.
5949    ///
5950    /// Establishes a two-way binding between the interval selection and the scales
5951    /// used within the same view. This allows a user to interactively pan and
5952    /// zoom the view.
5953    pub bind: Option<SelectionDefBind>,
5954    /// By default, all data values are considered to lie within an empty selection.
5955    /// When set to `none`, empty selections contain no data values.
5956    pub empty: Option<VgLayoutAlign>,
5957    /// An array of encoding channels. The corresponding data field values
5958    /// must match for a data tuple to fall within the selection.
5959    pub encodings: Option<Vec<SingleDefChannel>>,
5960    /// An array of field names whose values must match for a data tuple to
5961    /// fall within the selection.
5962    pub fields: Option<Vec<String>>,
5963    /// When true, an invisible voronoi diagram is computed to accelerate discrete
5964    /// selection. The data value _nearest_ the mouse cursor is added to the selection.
5965    ///
5966    /// See the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html)
5967    /// documentation for more information.
5968    pub nearest: Option<bool>,
5969    /// A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
5970    /// selector) that triggers the selection.
5971    /// For interval selections, the event stream must specify a [start and
5972    /// end](https://vega.github.io/vega/docs/event-streams/#between-filters).
5973    pub on: Option<serde_json::Value>,
5974    /// With layered and multi-view displays, a strategy that determines how
5975    /// selections' data queries are resolved when applied in a filter transform,
5976    /// conditional encoding rule, or scale domain.
5977    pub resolve: Option<SelectionResolution>,
5978    #[serde(rename = "type")]
5979    pub selection_def_type: SelectionDefType,
5980    /// Controls whether data values should be toggled or only ever inserted into
5981    /// multi selections. Can be `true`, `false` (for insertion only), or a
5982    /// [Vega expression](https://vega.github.io/vega/docs/expressions/).
5983    ///
5984    /// __Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,
5985    /// data values are toggled when a user interacts with the shift-key pressed).
5986    ///
5987    /// See the [toggle transform](https://vega.github.io/vega-lite/docs/toggle.html)
5988    /// documentation for more information.
5989    pub toggle: Option<Translate>,
5990    /// An interval selection also adds a rectangle mark to depict the
5991    /// extents of the interval. The `mark` property can be used to customize the
5992    /// appearance of the mark.
5993    pub mark: Option<BrushConfig>,
5994    /// When truthy, allows a user to interactively move an interval selection
5995    /// back-and-forth. Can be `true`, `false` (to disable panning), or a
5996    /// [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)
5997    /// which must include a start and end event to trigger continuous panning.
5998    ///
5999    /// __Default value:__ `true`, which corresponds to
6000    /// `[mousedown, window:mouseup] > window:mousemove!` which corresponds to
6001    /// clicks and dragging within an interval selection to reposition it.
6002    pub translate: Option<Translate>,
6003    /// When truthy, allows a user to interactively resize an interval selection.
6004    /// Can be `true`, `false` (to disable zooming), or a [Vega event stream
6005    /// definition](https://vega.github.io/vega/docs/event-streams/). Currently,
6006    /// only `wheel` events are supported.
6007    ///
6008    ///
6009    /// __Default value:__ `true`, which corresponds to `wheel!`.
6010    pub zoom: Option<Translate>,
6011}
6012
6013#[derive(Debug, Serialize, Deserialize)]
6014pub struct TitleParams {
6015    /// The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
6016    /// example, with an orientation of top these anchor positions map to a left-, center-, or
6017    /// right-aligned title.
6018    ///
6019    /// __Default value:__ `"middle"` for
6020    /// [single](https://vega.github.io/vega-lite/docs/spec.html) and
6021    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.
6022    /// `"start"` for other composite views.
6023    ///
6024    /// __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
6025    /// customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and
6026    /// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.  For other composite
6027    /// views, `anchor` is always `"start"`.
6028    pub anchor: Option<Anchor>,
6029    /// The orthogonal offset in pixels by which to displace the title from its position along
6030    /// the edge of the chart.
6031    pub offset: Option<f64>,
6032    /// The orientation of the title relative to the chart. One of `"top"` (the default),
6033    /// `"bottom"`, `"left"`, or `"right"`.
6034    pub orient: Option<TitleOrient>,
6035    /// A [mark style property](https://vega.github.io/vega-lite/docs/config.html#style) to apply
6036    /// to the title text mark.
6037    ///
6038    /// __Default value:__ `"group-title"`.
6039    pub style: Option<Style>,
6040    /// The title text.
6041    pub text: String,
6042}
6043
6044#[derive(Debug, Serialize, Deserialize)]
6045pub struct Transform {
6046    /// The `filter` property must be one of the predicate definitions:
6047    ///
6048    /// 1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,
6049    /// where `datum` can be used to refer to the current data object
6050    ///
6051    /// 2) one of the field predicates:
6052    /// [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),
6053    /// [`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),
6054    /// [`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),
6055    /// [`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),
6056    /// [`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),
6057    /// [`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),
6058    /// or [`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate).
6059    ///
6060    /// 3) a [selection
6061    /// predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)
6062    ///
6063    /// 4) a logical operand that combines (1), (2), or (3).
6064    pub filter: Box<Option<Box<PurpleLogicalOperandPredicate>>>,
6065    /// The field for storing the computed formula value.
6066    ///
6067    /// The field or fields for storing the computed formula value.
6068    /// If `from.fields` is specified, the transform will use the same names for `as`.
6069    /// If `from.fields` is not specified, `as` has to be a string and we put the whole object
6070    /// into the data under the specified name.
6071    ///
6072    /// The output fields at which to write the start and end bin values.
6073    ///
6074    /// The output field to write the timeUnit value.
6075    #[serde(rename = "as")]
6076    pub transform_as: Option<Style>,
6077    /// A [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string. Use
6078    /// the variable `datum` to refer to the current data object.
6079    pub calculate: Option<String>,
6080    /// The default value to use if lookup fails.
6081    ///
6082    /// __Default value:__ `null`
6083    #[serde(rename = "default")]
6084    pub transform_default: Option<String>,
6085    /// Secondary data reference.
6086    pub from: Option<LookupData>,
6087    /// Key in primary data source.
6088    pub lookup: Option<String>,
6089    /// An object indicating bin properties, or simply `true` for using default bin parameters.
6090    pub bin: Option<Bin>,
6091    /// The data field to bin.
6092    ///
6093    /// The data field to apply time unit.
6094    pub field: Option<String>,
6095    /// The timeUnit.
6096    #[serde(rename = "timeUnit")]
6097    pub time_unit: Option<TimeUnit>,
6098    /// Array of objects that define fields to aggregate.
6099    pub aggregate: Option<Vec<AggregatedFieldDef>>,
6100    /// The data fields to group by. If not specified, a single group containing all data objects
6101    /// will be used.
6102    ///
6103    /// The data fields for partitioning the data objects into separate windows. If unspecified,
6104    /// all data points will be in a single group.
6105    pub groupby: Option<Vec<String>>,
6106    /// A frame specification as a two-element array indicating how the sliding window should
6107    /// proceed. The array entries should either be a number indicating the offset from the
6108    /// current data object, or null to indicate unbounded rows preceding or following the
6109    /// current data object. The default value is `[null, 0]`, indicating that the sliding window
6110    /// includes the current object and all preceding objects. The value `[-5, 5]` indicates that
6111    /// the window should include five objects preceding and five objects following the current
6112    /// object. Finally, `[null, null]` indicates that the window frame should always include all
6113    /// data objects. The only operators affected are the aggregation operations and the
6114    /// `first_value`, `last_value`, and `nth_value` window operations. The other window
6115    /// operations are not affected by this.
6116    ///
6117    /// __Default value:__:  `[null, 0]` (includes the current object and all preceding objects)
6118    pub frame: Option<Vec<Option<f64>>>,
6119    /// Indicates if the sliding window frame should ignore peer values. (Peer values are those
6120    /// considered identical by the sort criteria). The default is false, causing the window
6121    /// frame to expand to include all peer values. If set to true, the window frame will be
6122    /// defined by offset values only. This setting only affects those operations that depend on
6123    /// the window frame, namely aggregation operations and the first_value, last_value, and
6124    /// nth_value window operations.
6125    ///
6126    /// __Default value:__ `false`
6127    #[serde(rename = "ignorePeers")]
6128    pub ignore_peers: Option<bool>,
6129    /// A sort field definition for sorting data objects within a window. If two data objects are
6130    /// considered equal by the comparator, they are considered “peer” values of equal rank. If
6131    /// sort is not specified, the order is undefined: data objects are processed in the order
6132    /// they are observed and none are considered peers (the ignorePeers parameter is ignored and
6133    /// treated as if set to `true`).
6134    pub sort: Option<Vec<SortField>>,
6135    /// The definition of the fields in the window, and what calculations to use.
6136    pub window: Option<Vec<WindowFieldDef>>,
6137}
6138
6139#[derive(Debug, Serialize, Deserialize)]
6140pub struct AggregatedFieldDef {
6141    /// The output field names to use for each aggregated field.
6142    #[serde(rename = "as")]
6143    pub aggregated_field_def_as: String,
6144    /// The data field for which to compute aggregate function. This is required for all
6145    /// aggregation operations except `"count"`.
6146    pub field: Option<String>,
6147    /// The aggregation operations to apply to the fields, such as sum, average or count.
6148    /// See the [full list of supported aggregation
6149    /// operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)
6150    /// for more information.
6151    pub op: AggregateOp,
6152}
6153
6154/// Secondary data reference.
6155#[derive(Debug, Serialize, Deserialize)]
6156pub struct LookupData {
6157    /// Secondary data source to lookup in.
6158    pub data: Data,
6159    /// Fields in foreign data to lookup.
6160    /// If not specified, the entire object is queried.
6161    pub fields: Option<Vec<String>>,
6162    /// Key in data to lookup.
6163    pub key: String,
6164}
6165
6166/// A sort definition for transform
6167#[derive(Debug, Serialize, Deserialize)]
6168pub struct SortField {
6169    /// The name of the field to sort.
6170    pub field: String,
6171    /// Whether to sort the field in ascending or descending order.
6172    pub order: Option<VgComparatorOrder>,
6173}
6174
6175#[derive(Debug, Serialize, Deserialize)]
6176pub struct WindowFieldDef {
6177    /// The output name for the window operation.
6178    #[serde(rename = "as")]
6179    pub window_field_def_as: String,
6180    /// The data field for which to compute the aggregate or window function. This can be omitted
6181    /// for window functions that do not operate over a field such as `count`, `rank`,
6182    /// `dense_rank`.
6183    pub field: Option<String>,
6184    /// The window or aggregation operations to apply within a window, including `rank`, `lead`,
6185    /// `sum`, `average` or `count`. See the list of all supported operations
6186    /// [here](https://vega.github.io/vega-lite/docs/window.html#ops).
6187    pub op: Op,
6188    /// Parameter values for the window functions. Parameter values can be omitted for operations
6189    /// that do not accept a parameter.
6190    ///
6191    /// See the list of all supported operations and their parameters
6192    /// [here](https://vega.github.io/vega-lite/docs/transforms/window.html).
6193    pub param: Option<f64>,
6194}
6195
6196/// An object that describes what fields should be repeated into views that are laid out as a
6197/// `row` or `column`.
6198#[derive(Debug, Serialize, Deserialize)]
6199pub struct Repeat {
6200    /// Horizontal repeated views.
6201    pub column: Option<Vec<String>>,
6202    /// Vertical repeated views.
6203    pub row: Option<Vec<String>>,
6204}
6205
6206#[derive(Debug, Serialize, Deserialize)]
6207pub struct RowColNumber {
6208    pub column: Option<f64>,
6209    pub row: Option<f64>,
6210}
6211
6212/// The alignment to apply to grid rows and columns.
6213/// The supported string values are `"all"`, `"each"`, and `"none"`.
6214///
6215/// - For `"none"`, a flow layout will be used, in which adjacent subviews are simply placed
6216/// one after the other.
6217/// - For `"each"`, subviews will be aligned into a clean grid structure, but each row or
6218/// column may be of variable size.
6219/// - For `"all"`, subviews will be aligned and each row or column will be sized identically
6220/// based on the maximum observed size. String values for this property will be applied to
6221/// both grid rows and columns.
6222///
6223/// Alternatively, an object value of the form `{"row": string, "column": string}` can be
6224/// used to supply different alignments for rows and columns.
6225///
6226/// __Default value:__ `"all"`.
6227#[derive(Debug, Serialize, Deserialize)]
6228#[serde(untagged)]
6229pub enum Align {
6230    Enum(VgLayoutAlign),
6231    RowColVgLayoutAlign(RowColVgLayoutAlign),
6232}
6233
6234/// Sets how the visualization size should be determined. If a string, should be one of
6235/// `"pad"`, `"fit"` or `"none"`.
6236/// Object values can additionally specify parameters for content sizing and automatic
6237/// resizing.
6238/// `"fit"` is only supported for single and layered views that don't use `rangeStep`.
6239///
6240/// __Default value__: `pad`
6241#[derive(Debug, Serialize, Deserialize)]
6242#[serde(untagged)]
6243pub enum Autosize {
6244    AutoSizeParams(AutoSizeParams),
6245    Enum(AutosizeType),
6246}
6247
6248#[derive(Debug, Serialize, Deserialize)]
6249#[serde(untagged)]
6250pub enum Center {
6251    Bool(bool),
6252    RowColBoolean(RowColBoolean),
6253}
6254
6255/// The font weight.
6256/// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
6257/// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
6258///
6259/// Font weight of the title.
6260/// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
6261/// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
6262///
6263/// Font weight of the header title.
6264/// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
6265/// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
6266///
6267/// The font weight of the legend title.
6268/// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
6269/// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
6270///
6271/// Font weight for title text.
6272/// This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`,
6273/// ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
6274#[derive(Debug, Serialize, Deserialize)]
6275#[serde(untagged)]
6276pub enum FontWeight {
6277    Double(f64),
6278    Enum(FontWeightString),
6279}
6280
6281#[derive(Debug, Serialize, Deserialize)]
6282#[serde(untagged)]
6283pub enum Line {
6284    Bool(bool),
6285    OverlayMarkDef(OverlayMarkDef),
6286}
6287
6288/// A string or array of strings indicating the name of custom styles to apply to the mark. A
6289/// style is a named collection of mark property defaults defined within the [style
6290/// configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is
6291/// an array, later styles will override earlier styles. Any [mark
6292/// properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly
6293/// defined within the `encoding` will override a style default.
6294///
6295/// __Default value:__ The mark's name.  For example, a bar mark will have style `"bar"` by
6296/// default.
6297/// __Note:__ Any specified style will augment the default style. For example, a bar mark
6298/// with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
6299/// specified style `"foo"` has higher precedence).
6300///
6301/// A [mark style property](https://vega.github.io/vega-lite/docs/config.html#style) to apply
6302/// to the title text mark.
6303///
6304/// __Default value:__ `"group-title"`.
6305///
6306/// The field or fields for storing the computed formula value.
6307/// If `from.fields` is specified, the transform will use the same names for `as`.
6308/// If `from.fields` is not specified, `as` has to be a string and we put the whole object
6309/// into the data under the specified name.
6310///
6311/// The output fields at which to write the start and end bin values.
6312#[derive(Debug, Serialize, Deserialize)]
6313#[serde(untagged)]
6314pub enum Style {
6315    String(String),
6316    StringArray(Vec<String>),
6317}
6318
6319#[derive(Debug, Serialize, Deserialize)]
6320#[serde(untagged)]
6321pub enum PointUnion {
6322    Bool(bool),
6323    Enum(PointEnum),
6324    OverlayMarkDef(OverlayMarkDef),
6325}
6326
6327/// Indicates if labels should be hidden if they exceed the axis range. If `false `(the
6328/// default) no bounds overlap analysis is performed. If `true`, labels will be hidden if
6329/// they exceed the axis range by more than 1 pixel. If this property is a number, it
6330/// specifies the pixel tolerance: the maximum amount by which a label bounding box may
6331/// exceed the axis range.
6332///
6333/// __Default value:__ `false`.
6334///
6335/// Indicates if the first and last axis labels should be aligned flush with the scale range.
6336/// Flush alignment for a horizontal axis will left-align the first label and right-align the
6337/// last label. For vertical axes, bottom and top text baselines are applied instead. If this
6338/// property is a number, it also indicates the number of pixels by which to offset the first
6339/// and last labels; for example, a value of 2 will flush-align the first and last labels and
6340/// also push them 2 pixels outward from the center of the axis. The additional adjustment
6341/// can sometimes help the labels better visually group with corresponding axis ticks.
6342///
6343/// __Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.
6344#[derive(Debug, Serialize, Deserialize)]
6345#[serde(untagged)]
6346pub enum Label {
6347    Bool(bool),
6348    Double(f64),
6349}
6350
6351#[derive(Debug, Serialize, Deserialize)]
6352#[serde(untagged)]
6353pub enum LabelOverlapUnion {
6354    Bool(bool),
6355    Enum(LabelOverlapEnum),
6356}
6357
6358/// The full data set, included inline. This can be an array of objects or primitive values,
6359/// an object, or a string.
6360/// Arrays of primitive values are ingested as objects with a `data` property. Strings are
6361/// parsed according to the specified format type.
6362#[derive(Debug, Serialize, Deserialize)]
6363#[serde(untagged)]
6364pub enum InlineDatasetValue {
6365    AnythingMap(HashMap<String, Option<serde_json::Value>>),
6366    String(String),
6367    UnionArray(Vec<InlineDataset>),
6368}
6369
6370#[derive(Debug, Serialize, Deserialize)]
6371#[serde(untagged)]
6372pub enum InlineDataset {
6373    AnythingMap(HashMap<String, Option<serde_json::Value>>),
6374    Bool(bool),
6375    Double(f64),
6376    String(String),
6377}
6378
6379/// The default visualization padding, in pixels, from the edge of the visualization canvas
6380/// to the data rectangle.  If a number, specifies padding for all sides.
6381/// If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
6382/// "bottom": 5}` to specify padding for each side of the visualization.
6383///
6384/// __Default value__: `5`
6385#[derive(Debug, Serialize, Deserialize)]
6386#[serde(untagged)]
6387pub enum Padding {
6388    Double(f64),
6389    PaddingClass(PaddingClass),
6390}
6391
6392#[derive(Debug, Serialize, Deserialize)]
6393#[serde(untagged)]
6394pub enum PrecisionValue {
6395    Double(f64),
6396    String(String),
6397}
6398
6399#[derive(Debug, Serialize, Deserialize)]
6400#[serde(untagged)]
6401pub enum ConfigRange {
6402    UnionArray(Vec<PrecisionValue>),
6403    VgScheme(VgScheme),
6404}
6405
6406/// When truthy, allows a user to interactively move an interval selection
6407/// back-and-forth. Can be `true`, `false` (to disable panning), or a
6408/// [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)
6409/// which must include a start and end event to trigger continuous panning.
6410///
6411/// __Default value:__ `true`, which corresponds to
6412/// `[mousedown, window:mouseup] > window:mousemove!` which corresponds to
6413/// clicks and dragging within an interval selection to reposition it.
6414///
6415/// When truthy, allows a user to interactively resize an interval selection.
6416/// Can be `true`, `false` (to disable zooming), or a [Vega event stream
6417/// definition](https://vega.github.io/vega/docs/event-streams/). Currently,
6418/// only `wheel` events are supported.
6419///
6420///
6421/// __Default value:__ `true`, which corresponds to `wheel!`.
6422///
6423/// Controls whether data values should be toggled or only ever inserted into
6424/// multi selections. Can be `true`, `false` (for insertion only), or a
6425/// [Vega expression](https://vega.github.io/vega/docs/expressions/).
6426///
6427/// __Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,
6428/// data values are toggled when a user interacts with the shift-key pressed).
6429///
6430/// See the [toggle transform](https://vega.github.io/vega-lite/docs/toggle.html)
6431/// documentation for more information.
6432#[derive(Debug, Serialize, Deserialize)]
6433#[serde(untagged)]
6434pub enum Translate {
6435    Bool(bool),
6436    String(String),
6437}
6438
6439#[derive(Debug, Serialize, Deserialize)]
6440#[serde(untagged)]
6441pub enum BindValue {
6442    Double(f64),
6443    String(String),
6444    StringArray(Vec<String>),
6445    VgBinding(VgBinding),
6446}
6447
6448#[derive(Debug, Serialize, Deserialize)]
6449#[serde(untagged)]
6450pub enum Parse {
6451    Enum(Cursor),
6452    UnionMap(HashMap<String, Option<String>>),
6453}
6454
6455/// The full data set, included inline. This can be an array of objects or primitive values,
6456/// an object, or a string.
6457/// Arrays of primitive values are ingested as objects with a `data` property. Strings are
6458/// parsed according to the specified format type.
6459#[derive(Debug, Serialize, Deserialize)]
6460#[serde(untagged)]
6461pub enum DataInlineDataset {
6462    AnythingMap(HashMap<String, Option<serde_json::Value>>),
6463    String(String),
6464    UnionArray(Vec<InlineDataset>),
6465}
6466
6467#[derive(Debug, Serialize, Deserialize)]
6468#[serde(untagged)]
6469pub enum Bin {
6470    BinParams(BinParams),
6471    Bool(bool),
6472}
6473
6474#[derive(Debug, Serialize, Deserialize)]
6475#[serde(untagged)]
6476pub enum ColorCondition {
6477    ConditionalPredicateMarkPropFieldDefClass(ConditionalPredicateMarkPropFieldDefClass),
6478    ConditionalValueDefArray(Vec<ConditionalValueDef>),
6479}
6480
6481/// Filter using a selection name.
6482///
6483/// A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of
6484/// [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose).
6485#[derive(Debug, Serialize, Deserialize)]
6486#[serde(untagged)]
6487pub enum SelectionOperandElement {
6488    Selection(Selection),
6489    String(String),
6490}
6491
6492/// Filter using a selection name.
6493///
6494/// A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of
6495/// [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose).
6496#[derive(Debug, Serialize, Deserialize)]
6497#[serde(untagged)]
6498pub enum PurpleSelectionOperand {
6499    Selection(Selection),
6500    String(String),
6501}
6502
6503/// The `filter` property must be one of the predicate definitions:
6504///
6505/// 1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,
6506/// where `datum` can be used to refer to the current data object
6507///
6508/// 2) one of the field predicates:
6509/// [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),
6510/// [`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),
6511/// [`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),
6512/// [`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),
6513/// [`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),
6514/// [`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),
6515/// or [`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate).
6516///
6517/// 3) a [selection
6518/// predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)
6519///
6520/// 4) a logical operand that combines (1), (2), or (3).
6521#[derive(Debug, Serialize, Deserialize)]
6522#[serde(untagged)]
6523pub enum LogicalOperandPredicateElement {
6524    Predicate(Predicate),
6525    String(String),
6526}
6527
6528/// The `filter` property must be one of the predicate definitions:
6529///
6530/// 1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,
6531/// where `datum` can be used to refer to the current data object
6532///
6533/// 2) one of the field predicates:
6534/// [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),
6535/// [`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),
6536/// [`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),
6537/// [`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),
6538/// [`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),
6539/// [`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),
6540/// or [`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate).
6541///
6542/// 3) a [selection
6543/// predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)
6544///
6545/// 4) a logical operand that combines (1), (2), or (3).
6546#[derive(Debug, Serialize, Deserialize)]
6547#[serde(untagged)]
6548pub enum PurpleLogicalOperandPredicate {
6549    Predicate(Predicate),
6550    String(String),
6551}
6552
6553/// The value that the field should be equal to.
6554#[derive(Debug, Serialize, Deserialize)]
6555#[serde(untagged)]
6556pub enum EqualUnion {
6557    Bool(bool),
6558    DateTime(DateTime),
6559    Double(f64),
6560    String(String),
6561}
6562
6563/// Value representing the day of a week.  This can be one of: (1) integer value -- `1`
6564/// represents Monday; (2) case-insensitive day name (e.g., `"Monday"`);  (3)
6565/// case-insensitive, 3-character short day name (e.g., `"Mon"`).   <br/> **Warning:** A
6566/// DateTime definition object with `day`** should not be combined with `year`, `quarter`,
6567/// `month`, or `date`.
6568#[derive(Debug, Serialize, Deserialize)]
6569#[serde(untagged)]
6570pub enum Day {
6571    Double(f64),
6572    String(String),
6573}
6574
6575/// One of: (1) integer value representing the month from `1`-`12`. `1` represents January;
6576/// (2) case-insensitive month name (e.g., `"January"`);  (3) case-insensitive, 3-character
6577/// short month name (e.g., `"Jan"`).
6578#[derive(Debug, Serialize, Deserialize)]
6579#[serde(untagged)]
6580pub enum Month {
6581    Double(f64),
6582    String(String),
6583}
6584
6585#[derive(Debug, Serialize, Deserialize)]
6586#[serde(untagged)]
6587pub enum Lt {
6588    DateTime(DateTime),
6589    Double(f64),
6590    String(String),
6591}
6592
6593/// The value that the field should be equal to.
6594#[derive(Debug, Serialize, Deserialize)]
6595#[serde(untagged)]
6596pub enum SortElement {
6597    Bool(bool),
6598    DateTime(DateTime),
6599    Double(f64),
6600    String(String),
6601}
6602
6603#[derive(Debug, Serialize, Deserialize)]
6604#[serde(untagged)]
6605pub enum RangeElement {
6606    DateTime(DateTime),
6607    Double(f64),
6608}
6609
6610/// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6611/// `0` to `1` for opacity).
6612///
6613/// A constant value in visual domain.
6614#[derive(Debug, Serialize, Deserialize)]
6615#[serde(untagged)]
6616pub enum ConditionalValueDefValue {
6617    Bool(bool),
6618    Double(f64),
6619    String(String),
6620}
6621
6622#[derive(Debug, Serialize, Deserialize)]
6623#[serde(untagged)]
6624pub enum Field {
6625    RepeatRef(RepeatRef),
6626    String(String),
6627}
6628
6629/// Customized domain values.
6630///
6631/// For _quantitative_ fields, `domain` can take the form of a two-element array with minimum
6632/// and maximum values.  [Piecewise
6633/// scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise) can be created by
6634/// providing a `domain` with more than two entries.
6635/// If the input field is aggregated, `domain` can also be a string value `"unaggregated"`,
6636/// indicating that the domain should include the raw data values prior to the aggregation.
6637///
6638/// For _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in
6639/// the form of either timestamps or the [DateTime definition
6640/// objects](https://vega.github.io/vega-lite/docs/types.html#datetime).
6641///
6642/// For _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input
6643/// values.
6644///
6645/// The `selection` property can be used to [interactively
6646/// determine](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale
6647/// domain.
6648#[derive(Debug, Serialize, Deserialize)]
6649#[serde(untagged)]
6650pub enum DomainUnion {
6651    DomainClass(DomainClass),
6652    Enum(Domain),
6653    UnionArray(Vec<SortElement>),
6654}
6655
6656/// The interpolation method for range values. By default, a general interpolator for
6657/// numbers, dates, strings and colors (in RGB space) is used. For color ranges, this
6658/// property allows interpolation in alternative color spaces. Legal values include `rgb`,
6659/// `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long'
6660/// variants use longer paths in polar coordinate spaces). If object-valued, this property
6661/// accepts an object with a string-valued _type_ property and an optional numeric _gamma_
6662/// property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate
6663/// documentation](https://github.com/d3/d3-interpolate).
6664///
6665/// __Note:__ Sequential scales do not support `interpolate` as they have a fixed
6666/// interpolator.  Since Vega-Lite uses sequential scales for quantitative fields by default,
6667/// you have to set the scale `type` to other quantitative scale type such as `"linear"` to
6668/// customize `interpolate`.
6669#[derive(Debug, Serialize, Deserialize)]
6670#[serde(untagged)]
6671pub enum InterpolateUnion {
6672    Enum(ScaleInterpolate),
6673    ScaleInterpolateParams(ScaleInterpolateParams),
6674}
6675
6676/// Extending the domain so that it starts and ends on nice round values. This method
6677/// typically modifies the scale’s domain, and may only extend the bounds to the nearest
6678/// round value. Nicing is useful if the domain is computed from data and may be irregular.
6679/// For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2,
6680/// 1.0]_.
6681///
6682/// For quantitative scales such as linear, `nice` can be either a boolean flag or a number.
6683/// If `nice` is a number, it will represent a desired tick count. This allows greater
6684/// control over the step size used to extend the bounds, guaranteeing that the returned
6685/// ticks will exactly cover the domain.
6686///
6687/// For temporal fields with time and utc scales, the `nice` value can be a string indicating
6688/// the desired time interval. Legal values are `"millisecond"`, `"second"`, `"minute"`,
6689/// `"hour"`, `"day"`, `"week"`, `"month"`, and `"year"`. Alternatively, `time` and `utc`
6690/// scales can accept an object-valued interval specifier of the form `{"interval": "month",
6691/// "step": 3}`, which includes a desired number of interval steps. Here, the domain would
6692/// snap to quarter (Jan, Apr, Jul, Oct) boundaries.
6693///
6694/// __Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise.
6695#[derive(Debug, Serialize, Deserialize)]
6696#[serde(untagged)]
6697pub enum NiceUnion {
6698    Bool(bool),
6699    Double(f64),
6700    Enum(NiceTime),
6701    NiceClass(NiceClass),
6702}
6703
6704/// The range of the scale. One of:
6705///
6706/// - A string indicating a [pre-defined named scale
6707/// range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example,
6708/// `"symbol"`, or `"diverging"`).
6709///
6710/// - For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous),
6711/// two-element array indicating  minimum and maximum values, or an array with more than two
6712/// entries for specifying a [piecewise
6713/// scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).
6714///
6715/// - For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and
6716/// [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an
6717/// array of desired output values.
6718///
6719/// __Notes:__
6720///
6721/// 1) For [sequential](https://vega.github.io/vega-lite/docs/scale.html#sequential),
6722/// [ordinal](https://vega.github.io/vega-lite/docs/scale.html#ordinal), and discretizing
6723/// color scales, you can also specify a color
6724/// [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.
6725///
6726/// 2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be
6727/// customized via the view's corresponding
6728/// [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`) or via
6729/// [range steps and paddings properties](#range-step) for [band](#band) and [point](#point)
6730/// scales.
6731#[derive(Debug, Serialize, Deserialize)]
6732#[serde(untagged)]
6733pub enum ScaleRange {
6734    String(String),
6735    UnionArray(Vec<PrecisionValue>),
6736}
6737
6738/// A string indicating a color
6739/// [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g.,
6740/// `"category10"` or `"viridis"`) or a [scheme parameter
6741/// object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).
6742///
6743/// Discrete color schemes may be used with
6744/// [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or
6745/// [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales.
6746/// Continuous color schemes are intended for use with
6747/// [sequential](https://vega.github.io/vega-lite/docs/scales.html#sequential) scales.
6748///
6749/// For the full list of supported schemes, please refer to the [Vega
6750/// Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.
6751#[derive(Debug, Serialize, Deserialize)]
6752#[serde(untagged)]
6753pub enum Scheme {
6754    SchemeParams(SchemeParams),
6755    String(String),
6756}
6757
6758/// Sort order for the encoded field.
6759///
6760/// For continuous fields (quantitative or temporal), `sort` can be either `"ascending"` or
6761/// `"descending"`.
6762///
6763/// For discrete fields, `sort` can be one of the following:
6764/// - `"ascending"` or `"descending"` -- for sorting by the values' natural order in
6765/// Javascript.
6766/// - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field)
6767/// for sorting by another field.
6768/// - [An array specifying the field values in preferred
6769/// order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the
6770/// sort order will obey the values in the array, followed by any unspecified values in their
6771/// original order.  For discrete time field, values in the sort array can be [date-time
6772/// definition objects](types#datetime). In addition, for time units `"month"` and `"day"`,
6773/// the values can be the month or day names (case insensitive) or their 3-letter initials
6774/// (e.g., `"Mon"`, `"Tue"`).
6775/// - `null` indicating no sort.
6776///
6777/// __Default value:__ `"ascending"`
6778///
6779/// __Note:__ `null` is not supported for `row` and `column`.
6780#[derive(Debug, Serialize, Deserialize)]
6781#[serde(untagged)]
6782pub enum Sort {
6783    EncodingSortField(EncodingSortField),
6784    Enum(VgComparatorOrder),
6785    UnionArray(Vec<SortElement>),
6786}
6787
6788/// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6789/// `0` to `1` for opacity).
6790///
6791/// A constant value in visual domain.
6792#[derive(Debug, Serialize, Deserialize)]
6793#[serde(untagged)]
6794pub enum PurpleValue {
6795    Bool(bool),
6796    Double(f64),
6797    String(String),
6798}
6799
6800#[derive(Debug, Serialize, Deserialize)]
6801#[serde(untagged)]
6802pub enum Detail {
6803    FieldDef(FieldDef),
6804    FieldDefArray(Vec<FieldDef>),
6805}
6806
6807#[derive(Debug, Serialize, Deserialize)]
6808#[serde(untagged)]
6809pub enum HrefCondition {
6810    ConditionalPredicateFieldDefClass(ConditionalPredicateFieldDefClass),
6811    ConditionalValueDefArray(Vec<ConditionalValueDef>),
6812}
6813
6814#[derive(Debug, Serialize, Deserialize)]
6815#[serde(untagged)]
6816pub enum Order {
6817    Def(Def),
6818    OrderFieldDefArray(Vec<OrderFieldDef>),
6819}
6820
6821#[derive(Debug, Serialize, Deserialize)]
6822#[serde(untagged)]
6823pub enum TextCondition {
6824    ConditionalPredicateTextFieldDefClass(ConditionalPredicateTextFieldDefClass),
6825    ConditionalValueDefArray(Vec<ConditionalValueDef>),
6826}
6827
6828#[derive(Debug, Serialize, Deserialize)]
6829#[serde(untagged)]
6830pub enum Tooltip {
6831    TextDefWithCondition(TextDefWithCondition),
6832    TextFieldDefArray(Vec<TextFieldDef>),
6833}
6834
6835/// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
6836/// `"line"`,
6837/// `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6838/// object](https://vega.github.io/vega-lite/docs/mark.html#mark-def).
6839#[derive(Debug, Serialize, Deserialize)]
6840#[serde(untagged)]
6841pub enum AnyMark {
6842    Enum(Mark),
6843    MarkDef(MarkDef),
6844}
6845
6846#[derive(Debug, Serialize, Deserialize)]
6847#[serde(untagged)]
6848pub enum SelectionDefBind {
6849    Enum(BindEnum),
6850    UnionMap(HashMap<String, BindValue>),
6851}
6852
6853#[derive(Debug, Serialize, Deserialize)]
6854#[serde(untagged)]
6855pub enum Title {
6856    String(String),
6857    TitleParams(TitleParams),
6858}
6859
6860#[derive(Debug, Serialize, Deserialize)]
6861#[serde(untagged)]
6862pub enum Spacing {
6863    Double(f64),
6864    RowColNumber(RowColNumber),
6865}
6866
6867/// By default, all data values are considered to lie within an empty selection.
6868/// When set to `none`, empty selections contain no data values.
6869#[derive(Debug, Serialize, Deserialize)]
6870pub enum VgLayoutAlign {
6871    #[serde(rename = "all")]
6872    All,
6873    #[serde(rename = "each")]
6874    Each,
6875    #[serde(rename = "none")]
6876    None,
6877}
6878
6879/// The sizing format type. One of `"pad"`, `"fit"` or `"none"`. See the [autosize
6880/// type](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for
6881/// descriptions of each.
6882///
6883/// __Default value__: `"pad"`
6884#[derive(Debug, Serialize, Deserialize)]
6885pub enum AutosizeType {
6886    #[serde(rename = "fit")]
6887    Fit,
6888    #[serde(rename = "none")]
6889    None,
6890    #[serde(rename = "pad")]
6891    Pad,
6892}
6893
6894/// Determines how size calculation should be performed, one of `"content"` or `"padding"`.
6895/// The default setting (`"content"`) interprets the width and height settings as the data
6896/// rectangle (plotting) dimensions, to which padding is then added. In contrast, the
6897/// `"padding"` setting includes the padding within the view size calculations, such that the
6898/// width and height settings indicate the **total** intended size of the view.
6899///
6900/// __Default value__: `"content"`
6901#[derive(Debug, Serialize, Deserialize)]
6902pub enum Contains {
6903    #[serde(rename = "content")]
6904    Content,
6905    #[serde(rename = "padding")]
6906    Padding,
6907}
6908
6909/// The bounds calculation method to use for determining the extent of a sub-plot. One of
6910/// `full` (the default) or `flush`.
6911///
6912/// - If set to `full`, the entire calculated bounds (including axes, title, and legend) will
6913/// be used.
6914/// - If set to `flush`, only the specified width and height values for the sub-view will be
6915/// used. The `flush` setting can be useful when attempting to place sub-plots without axes
6916/// or legends into a uniform grid structure.
6917///
6918/// __Default value:__ `"full"`
6919#[derive(Debug, Serialize, Deserialize)]
6920pub enum Bounds {
6921    #[serde(rename = "flush")]
6922    Flush,
6923    #[serde(rename = "full")]
6924    Full,
6925}
6926
6927/// The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
6928#[derive(Debug, Serialize, Deserialize)]
6929pub enum HorizontalAlign {
6930    #[serde(rename = "center")]
6931    Center,
6932    #[serde(rename = "left")]
6933    Left,
6934    #[serde(rename = "right")]
6935    Right,
6936}
6937
6938/// The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
6939///
6940/// __Default value:__ `"middle"`
6941///
6942/// Vertical text baseline for title text.
6943#[derive(Debug, Serialize, Deserialize)]
6944pub enum VerticalAlign {
6945    #[serde(rename = "bottom")]
6946    Bottom,
6947    #[serde(rename = "middle")]
6948    Middle,
6949    #[serde(rename = "top")]
6950    Top,
6951}
6952
6953/// The mouse cursor used over the mark. Any valid [CSS cursor
6954/// type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
6955#[derive(Debug, Serialize, Deserialize)]
6956pub enum Cursor {
6957    #[serde(rename = "alias")]
6958    Alias,
6959    #[serde(rename = "all-scroll")]
6960    AllScroll,
6961    #[serde(rename = "auto")]
6962    Auto,
6963    #[serde(rename = "cell")]
6964    Cell,
6965    #[serde(rename = "col-resize")]
6966    ColResize,
6967    #[serde(rename = "context-menu")]
6968    ContextMenu,
6969    #[serde(rename = "copy")]
6970    Copy,
6971    #[serde(rename = "crosshair")]
6972    Crosshair,
6973    #[serde(rename = "default")]
6974    Default,
6975    #[serde(rename = "e-resize")]
6976    EResize,
6977    #[serde(rename = "ew-resize")]
6978    EwResize,
6979    #[serde(rename = "grab")]
6980    Grab,
6981    #[serde(rename = "grabbing")]
6982    Grabbing,
6983    #[serde(rename = "help")]
6984    Help,
6985    #[serde(rename = "move")]
6986    Move,
6987    #[serde(rename = "n-resize")]
6988    NResize,
6989    #[serde(rename = "ne-resize")]
6990    NeResize,
6991    #[serde(rename = "nesw-resize")]
6992    NeswResize,
6993    #[serde(rename = "no-drop")]
6994    NoDrop,
6995    #[serde(rename = "none")]
6996    None,
6997    #[serde(rename = "not-allowed")]
6998    NotAllowed,
6999    #[serde(rename = "ns-resize")]
7000    NsResize,
7001    #[serde(rename = "nw-resize")]
7002    NwResize,
7003    #[serde(rename = "nwse-resize")]
7004    NwseResize,
7005    #[serde(rename = "pointer")]
7006    Pointer,
7007    #[serde(rename = "progress")]
7008    Progress,
7009    #[serde(rename = "row-resize")]
7010    RowResize,
7011    #[serde(rename = "s-resize")]
7012    SResize,
7013    #[serde(rename = "se-resize")]
7014    SeResize,
7015    #[serde(rename = "sw-resize")]
7016    SwResize,
7017    #[serde(rename = "text")]
7018    Text,
7019    #[serde(rename = "vertical-text")]
7020    VerticalText,
7021    #[serde(rename = "w-resize")]
7022    WResize,
7023    #[serde(rename = "wait")]
7024    Wait,
7025    #[serde(rename = "zoom-in")]
7026    ZoomIn,
7027    #[serde(rename = "zoom-out")]
7028    ZoomOut,
7029}
7030
7031/// The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left).
7032/// This property determines on which side is truncated in response to the limit parameter.
7033///
7034/// __Default value:__ `"ltr"`
7035#[derive(Debug, Serialize, Deserialize)]
7036pub enum Dir {
7037    #[serde(rename = "ltr")]
7038    Ltr,
7039    #[serde(rename = "rtl")]
7040    Rtl,
7041}
7042
7043/// The font style (e.g., `"italic"`).
7044#[derive(Debug, Serialize, Deserialize)]
7045pub enum FontStyle {
7046    #[serde(rename = "italic")]
7047    Italic,
7048    #[serde(rename = "normal")]
7049    Normal,
7050}
7051
7052#[derive(Debug, Serialize, Deserialize)]
7053pub enum FontWeightString {
7054    #[serde(rename = "bold")]
7055    Bold,
7056    #[serde(rename = "normal")]
7057    Normal,
7058}
7059
7060/// The line interpolation method to use for line and area marks. One of the following:
7061/// - `"linear"`: piecewise linear segments, as in a polyline.
7062/// - `"linear-closed"`: close the linear segments to form a polygon.
7063/// - `"step"`: alternate between horizontal and vertical segments, as in a step function.
7064/// - `"step-before"`: alternate between vertical and horizontal segments, as in a step
7065/// function.
7066/// - `"step-after"`: alternate between horizontal and vertical segments, as in a step
7067/// function.
7068/// - `"basis"`: a B-spline, with control point duplication on the ends.
7069/// - `"basis-open"`: an open B-spline; may not intersect the start or end.
7070/// - `"basis-closed"`: a closed B-spline, as in a loop.
7071/// - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
7072/// - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
7073/// will intersect other control points.
7074/// - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
7075/// - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
7076/// spline.
7077/// - `"monotone"`: cubic interpolation that preserves monotonicity in y.
7078#[derive(Debug, Serialize, Deserialize)]
7079pub enum Interpolate {
7080    #[serde(rename = "basis")]
7081    Basis,
7082    #[serde(rename = "basis-closed")]
7083    BasisClosed,
7084    #[serde(rename = "basis-open")]
7085    BasisOpen,
7086    #[serde(rename = "bundle")]
7087    Bundle,
7088    #[serde(rename = "cardinal")]
7089    Cardinal,
7090    #[serde(rename = "cardinal-closed")]
7091    CardinalClosed,
7092    #[serde(rename = "cardinal-open")]
7093    CardinalOpen,
7094    #[serde(rename = "linear")]
7095    Linear,
7096    #[serde(rename = "linear-closed")]
7097    LinearClosed,
7098    #[serde(rename = "monotone")]
7099    Monotone,
7100    #[serde(rename = "step")]
7101    Step,
7102    #[serde(rename = "step-after")]
7103    StepAfter,
7104    #[serde(rename = "step-before")]
7105    StepBefore,
7106}
7107
7108/// The orientation of a non-stacked bar, tick, area, and line charts.
7109/// The value is either horizontal (default) or vertical.
7110/// - For bar, rule and tick, this determines whether the size of the bar and tick
7111/// should be applied to x or y dimension.
7112/// - For area, this property determines the orient property of the Vega output.
7113/// - For line and trail marks, this property determines the sort order of the points in the
7114/// line
7115/// if `config.sortLineBy` is not specified.
7116/// For stacked charts, this is always determined by the orientation of the stack;
7117/// therefore explicitly specified value will be ignored.
7118#[derive(Debug, Serialize, Deserialize)]
7119pub enum Orient {
7120    #[serde(rename = "horizontal")]
7121    Horizontal,
7122    #[serde(rename = "vertical")]
7123    Vertical,
7124}
7125
7126/// The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
7127///
7128/// __Default value:__ `"square"`
7129#[derive(Debug, Serialize, Deserialize)]
7130pub enum StrokeCap {
7131    #[serde(rename = "butt")]
7132    Butt,
7133    #[serde(rename = "round")]
7134    Round,
7135    #[serde(rename = "square")]
7136    Square,
7137}
7138
7139/// The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
7140///
7141/// __Default value:__ `"miter"`
7142///
7143/// The stroke line join method. One of miter (default), round or bevel.
7144///
7145/// __Default value:__ 'miter'
7146#[derive(Debug, Serialize, Deserialize)]
7147pub enum StrokeJoin {
7148    #[serde(rename = "bevel")]
7149    Bevel,
7150    #[serde(rename = "miter")]
7151    Miter,
7152    #[serde(rename = "round")]
7153    Round,
7154}
7155
7156#[derive(Debug, Serialize, Deserialize)]
7157pub enum PointEnum {
7158    #[serde(rename = "transparent")]
7159    Transparent,
7160}
7161
7162#[derive(Debug, Serialize, Deserialize)]
7163pub enum LabelOverlapEnum {
7164    #[serde(rename = "greedy")]
7165    Greedy,
7166    #[serde(rename = "parity")]
7167    Parity,
7168}
7169
7170/// Defines how Vega-Lite generates title for fields.  There are three possible styles:
7171/// - `"verbal"` (Default) - displays function in a verbal style (e.g., "Sum of field",
7172/// "Year-month of date", "field (binned)").
7173/// - `"function"` - displays function using parentheses and capitalized texts (e.g.,
7174/// "SUM(field)", "YEARMONTH(date)", "BIN(field)").
7175/// - `"plain"` - displays only the field name without functions (e.g., "field", "date",
7176/// "field").
7177#[derive(Debug, Serialize, Deserialize)]
7178pub enum FieldTitle {
7179    #[serde(rename = "functional")]
7180    Functional,
7181    #[serde(rename = "plain")]
7182    Plain,
7183    #[serde(rename = "verbal")]
7184    Verbal,
7185}
7186
7187/// Vertical text baseline for the header title. One of `"top"`, `"bottom"`, `"middle"`.
7188///
7189/// __Default value:__ `"middle"`
7190#[derive(Debug, Serialize, Deserialize)]
7191pub enum TextBaseline {
7192    #[serde(rename = "alphabetic")]
7193    Alphabetic,
7194    #[serde(rename = "bottom")]
7195    Bottom,
7196    #[serde(rename = "middle")]
7197    Middle,
7198    #[serde(rename = "top")]
7199    Top,
7200}
7201
7202#[derive(Debug, Serialize, Deserialize)]
7203pub enum InvalidValues {
7204    #[serde(rename = "filter")]
7205    Filter,
7206}
7207
7208/// The orientation of the legend, which determines how the legend is positioned within the
7209/// scene. One of "left", "right", "top-left", "top-right", "bottom-left", "bottom-right",
7210/// "none".
7211///
7212/// __Default value:__ `"right"`
7213#[derive(Debug, Serialize, Deserialize)]
7214pub enum LegendOrient {
7215    #[serde(rename = "bottom-left")]
7216    BottomLeft,
7217    #[serde(rename = "bottom-right")]
7218    BottomRight,
7219    #[serde(rename = "left")]
7220    Left,
7221    #[serde(rename = "none")]
7222    None,
7223    #[serde(rename = "right")]
7224    Right,
7225    #[serde(rename = "top-left")]
7226    TopLeft,
7227    #[serde(rename = "top-right")]
7228    TopRight,
7229}
7230
7231/// The cartographic projection to use. This value is case-insensitive, for example
7232/// `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
7233/// projection types [in the
7234/// documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
7235///
7236/// __Default value:__ `mercator`
7237#[derive(Debug, Serialize, Deserialize)]
7238pub enum VgProjectionType {
7239    #[serde(rename = "albers")]
7240    Albers,
7241    #[serde(rename = "albersUsa")]
7242    AlbersUsa,
7243    #[serde(rename = "azimuthalEqualArea")]
7244    AzimuthalEqualArea,
7245    #[serde(rename = "azimuthalEquidistant")]
7246    AzimuthalEquidistant,
7247    #[serde(rename = "conicConformal")]
7248    ConicConformal,
7249    #[serde(rename = "conicEqualArea")]
7250    ConicEqualArea,
7251    #[serde(rename = "conicEquidistant")]
7252    ConicEquidistant,
7253    #[serde(rename = "equirectangular")]
7254    Equirectangular,
7255    #[serde(rename = "gnomonic")]
7256    Gnomonic,
7257    #[serde(rename = "mercator")]
7258    Mercator,
7259    #[serde(rename = "orthographic")]
7260    Orthographic,
7261    #[serde(rename = "stereographic")]
7262    Stereographic,
7263    #[serde(rename = "transverseMercator")]
7264    TransverseMercator,
7265}
7266
7267/// Establishes a two-way binding between the interval selection and the scales
7268/// used within the same view. This allows a user to interactively pan and
7269/// zoom the view.
7270#[derive(Debug, Serialize, Deserialize)]
7271pub enum BindEnum {
7272    #[serde(rename = "scales")]
7273    Scales,
7274}
7275
7276#[derive(Debug, Serialize, Deserialize)]
7277pub enum SingleDefChannel {
7278    #[serde(rename = "color")]
7279    Color,
7280    #[serde(rename = "column")]
7281    Column,
7282    #[serde(rename = "fill")]
7283    Fill,
7284    #[serde(rename = "href")]
7285    Href,
7286    #[serde(rename = "key")]
7287    Key,
7288    #[serde(rename = "latitude")]
7289    Latitude,
7290    #[serde(rename = "latitude2")]
7291    Latitude2,
7292    #[serde(rename = "longitude")]
7293    Longitude,
7294    #[serde(rename = "longitude2")]
7295    Longitude2,
7296    #[serde(rename = "opacity")]
7297    Opacity,
7298    #[serde(rename = "row")]
7299    Row,
7300    #[serde(rename = "shape")]
7301    Shape,
7302    #[serde(rename = "size")]
7303    Size,
7304    #[serde(rename = "stroke")]
7305    Stroke,
7306    #[serde(rename = "text")]
7307    Text,
7308    #[serde(rename = "tooltip")]
7309    Tooltip,
7310    #[serde(rename = "x")]
7311    X,
7312    #[serde(rename = "x2")]
7313    X2,
7314    #[serde(rename = "y")]
7315    Y,
7316    #[serde(rename = "y2")]
7317    Y2,
7318}
7319
7320/// With layered and multi-view displays, a strategy that determines how
7321/// selections' data queries are resolved when applied in a filter transform,
7322/// conditional encoding rule, or scale domain.
7323#[derive(Debug, Serialize, Deserialize)]
7324pub enum SelectionResolution {
7325    #[serde(rename = "global")]
7326    Global,
7327    #[serde(rename = "intersect")]
7328    Intersect,
7329    #[serde(rename = "union")]
7330    Union,
7331}
7332
7333/// Default stack offset for stackable mark.
7334#[derive(Debug, Serialize, Deserialize)]
7335pub enum StackOffset {
7336    #[serde(rename = "center")]
7337    Center,
7338    #[serde(rename = "normalize")]
7339    Normalize,
7340    #[serde(rename = "zero")]
7341    Zero,
7342}
7343
7344/// The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
7345/// example, with an orientation of top these anchor positions map to a left-, center-, or
7346/// right-aligned title.
7347///
7348/// __Default value:__ `"middle"` for
7349/// [single](https://vega.github.io/vega-lite/docs/spec.html) and
7350/// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.
7351/// `"start"` for other composite views.
7352///
7353/// __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
7354/// customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and
7355/// [layered](https://vega.github.io/vega-lite/docs/layer.html) views.  For other composite
7356/// views, `anchor` is always `"start"`.
7357#[derive(Debug, Serialize, Deserialize)]
7358pub enum Anchor {
7359    #[serde(rename = "end")]
7360    End,
7361    #[serde(rename = "middle")]
7362    Middle,
7363    #[serde(rename = "start")]
7364    Start,
7365}
7366
7367/// Default title orientation ("top", "bottom", "left", or "right")
7368///
7369/// The orientation of the title relative to the chart. One of `"top"` (the default),
7370/// `"bottom"`, `"left"`, or `"right"`.
7371///
7372/// The orientation of the axis. One of `"top"`, `"bottom"`, `"left"` or `"right"`. The
7373/// orientation can be used to further specialize the axis type (e.g., a y axis oriented for
7374/// the right edge of the chart).
7375///
7376/// __Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.
7377#[derive(Debug, Serialize, Deserialize)]
7378pub enum TitleOrient {
7379    #[serde(rename = "bottom")]
7380    Bottom,
7381    #[serde(rename = "left")]
7382    Left,
7383    #[serde(rename = "right")]
7384    Right,
7385    #[serde(rename = "top")]
7386    Top,
7387}
7388
7389/// Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.
7390/// The default format type is determined by the extension of the file URL.
7391/// If no extension is detected, `"json"` will be used by default.
7392#[derive(Debug, Serialize, Deserialize)]
7393pub enum DataFormatType {
7394    #[serde(rename = "csv")]
7395    Csv,
7396    #[serde(rename = "dsv")]
7397    Dsv,
7398    #[serde(rename = "json")]
7399    Json,
7400    #[serde(rename = "topojson")]
7401    Topojson,
7402    #[serde(rename = "tsv")]
7403    Tsv,
7404}
7405
7406/// Aggregation function for the field
7407/// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
7408///
7409/// __Default value:__ `undefined` (None)
7410///
7411/// An [aggregate operation](https://vega.github.io/vega-lite/docs/aggregate.html#ops) to
7412/// perform on the field prior to sorting (e.g., `"count"`, `"mean"` and `"median"`).
7413/// This property is required in cases where the sort field and the data reference field do
7414/// not match.
7415/// The input data objects will be aggregated, grouped by the encoded data field.
7416///
7417/// For a full list of operations, please see the documentation for
7418/// [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).
7419///
7420/// The aggregation operations to apply to the fields, such as sum, average or count.
7421/// See the [full list of supported aggregation
7422/// operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)
7423/// for more information.
7424#[derive(Debug, Serialize, Deserialize)]
7425pub enum AggregateOp {
7426    #[serde(rename = "argmax")]
7427    Argmax,
7428    #[serde(rename = "argmin")]
7429    Argmin,
7430    #[serde(rename = "average")]
7431    Average,
7432    #[serde(rename = "ci0")]
7433    Ci0,
7434    #[serde(rename = "ci1")]
7435    Ci1,
7436    #[serde(rename = "count")]
7437    Count,
7438    #[serde(rename = "distinct")]
7439    Distinct,
7440    #[serde(rename = "max")]
7441    Max,
7442    #[serde(rename = "mean")]
7443    Mean,
7444    #[serde(rename = "median")]
7445    Median,
7446    #[serde(rename = "min")]
7447    Min,
7448    #[serde(rename = "missing")]
7449    Missing,
7450    #[serde(rename = "q1")]
7451    Q1,
7452    #[serde(rename = "q3")]
7453    Q3,
7454    #[serde(rename = "stderr")]
7455    Stderr,
7456    #[serde(rename = "stdev")]
7457    Stdev,
7458    #[serde(rename = "stdevp")]
7459    Stdevp,
7460    #[serde(rename = "sum")]
7461    Sum,
7462    #[serde(rename = "valid")]
7463    Valid,
7464    #[serde(rename = "values")]
7465    Values,
7466    #[serde(rename = "variance")]
7467    Variance,
7468    #[serde(rename = "variancep")]
7469    Variancep,
7470}
7471
7472/// Time unit for the field to be filtered.
7473///
7474/// Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
7475/// or [a temporal field that gets casted as
7476/// ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).
7477///
7478/// __Default value:__ `undefined` (None)
7479///
7480/// The timeUnit.
7481#[derive(Debug, Serialize, Deserialize)]
7482pub enum TimeUnit {
7483    #[serde(rename = "date")]
7484    Date,
7485    #[serde(rename = "day")]
7486    Day,
7487    #[serde(rename = "hours")]
7488    Hours,
7489    #[serde(rename = "hoursminutes")]
7490    Hoursminutes,
7491    #[serde(rename = "hoursminutesseconds")]
7492    Hoursminutesseconds,
7493    #[serde(rename = "milliseconds")]
7494    Milliseconds,
7495    #[serde(rename = "minutes")]
7496    Minutes,
7497    #[serde(rename = "minutesseconds")]
7498    Minutesseconds,
7499    #[serde(rename = "month")]
7500    Month,
7501    #[serde(rename = "monthdate")]
7502    Monthdate,
7503    #[serde(rename = "quarter")]
7504    Quarter,
7505    #[serde(rename = "quartermonth")]
7506    Quartermonth,
7507    #[serde(rename = "seconds")]
7508    Seconds,
7509    #[serde(rename = "secondsmilliseconds")]
7510    Secondsmilliseconds,
7511    #[serde(rename = "utcdate")]
7512    Utcdate,
7513    #[serde(rename = "utcday")]
7514    Utcday,
7515    #[serde(rename = "utchours")]
7516    Utchours,
7517    #[serde(rename = "utchoursminutes")]
7518    Utchoursminutes,
7519    #[serde(rename = "utchoursminutesseconds")]
7520    Utchoursminutesseconds,
7521    #[serde(rename = "utcmilliseconds")]
7522    Utcmilliseconds,
7523    #[serde(rename = "utcminutes")]
7524    Utcminutes,
7525    #[serde(rename = "utcminutesseconds")]
7526    Utcminutesseconds,
7527    #[serde(rename = "utcmonth")]
7528    Utcmonth,
7529    #[serde(rename = "utcmonthdate")]
7530    Utcmonthdate,
7531    #[serde(rename = "utcquarter")]
7532    Utcquarter,
7533    #[serde(rename = "utcquartermonth")]
7534    Utcquartermonth,
7535    #[serde(rename = "utcseconds")]
7536    Utcseconds,
7537    #[serde(rename = "utcsecondsmilliseconds")]
7538    Utcsecondsmilliseconds,
7539    #[serde(rename = "utcyear")]
7540    Utcyear,
7541    #[serde(rename = "utcyearmonth")]
7542    Utcyearmonth,
7543    #[serde(rename = "utcyearmonthdate")]
7544    Utcyearmonthdate,
7545    #[serde(rename = "utcyearmonthdatehours")]
7546    Utcyearmonthdatehours,
7547    #[serde(rename = "utcyearmonthdatehoursminutes")]
7548    Utcyearmonthdatehoursminutes,
7549    #[serde(rename = "utcyearmonthdatehoursminutesseconds")]
7550    Utcyearmonthdatehoursminutesseconds,
7551    #[serde(rename = "utcyearquarter")]
7552    Utcyearquarter,
7553    #[serde(rename = "utcyearquartermonth")]
7554    Utcyearquartermonth,
7555    #[serde(rename = "year")]
7556    Year,
7557    #[serde(rename = "yearmonth")]
7558    Yearmonth,
7559    #[serde(rename = "yearmonthdate")]
7560    Yearmonthdate,
7561    #[serde(rename = "yearmonthdatehours")]
7562    Yearmonthdatehours,
7563    #[serde(rename = "yearmonthdatehoursminutes")]
7564    Yearmonthdatehoursminutes,
7565    #[serde(rename = "yearmonthdatehoursminutesseconds")]
7566    Yearmonthdatehoursminutesseconds,
7567    #[serde(rename = "yearquarter")]
7568    Yearquarter,
7569    #[serde(rename = "yearquartermonth")]
7570    Yearquartermonth,
7571}
7572
7573/// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
7574/// `"nominal"`).
7575/// It can also be a `"geojson"` type for encoding
7576/// ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).
7577///
7578/// Constants and utilities for data type
7579/// Data type based on level of measurement
7580#[derive(Debug, Serialize, Deserialize)]
7581pub enum Type {
7582    #[serde(rename = "geojson")]
7583    Geojson,
7584    #[serde(rename = "latitude")]
7585    Latitude,
7586    #[serde(rename = "longitude")]
7587    Longitude,
7588    #[serde(rename = "nominal")]
7589    Nominal,
7590    #[serde(rename = "ordinal")]
7591    Ordinal,
7592    #[serde(rename = "quantitative")]
7593    Quantitative,
7594    #[serde(rename = "temporal")]
7595    Temporal,
7596}
7597
7598/// The type of the legend. Use `"symbol"` to create a discrete legend and `"gradient"` for a
7599/// continuous color gradient.
7600///
7601/// __Default value:__ `"gradient"` for non-binned quantitative fields and temporal fields;
7602/// `"symbol"` otherwise.
7603#[derive(Debug, Serialize, Deserialize)]
7604pub enum LegendType {
7605    #[serde(rename = "gradient")]
7606    Gradient,
7607    #[serde(rename = "symbol")]
7608    Symbol,
7609}
7610
7611#[derive(Debug, Serialize, Deserialize)]
7612pub enum Domain {
7613    #[serde(rename = "unaggregated")]
7614    Unaggregated,
7615}
7616
7617#[derive(Debug, Serialize, Deserialize)]
7618pub enum ScaleInterpolateParamsType {
7619    #[serde(rename = "cubehelix")]
7620    Cubehelix,
7621    #[serde(rename = "cubehelix-long")]
7622    CubehelixLong,
7623    #[serde(rename = "rgb")]
7624    Rgb,
7625}
7626
7627#[derive(Debug, Serialize, Deserialize)]
7628pub enum ScaleInterpolate {
7629    #[serde(rename = "cubehelix")]
7630    Cubehelix,
7631    #[serde(rename = "cubehelix-long")]
7632    CubehelixLong,
7633    #[serde(rename = "hcl")]
7634    Hcl,
7635    #[serde(rename = "hcl-long")]
7636    HclLong,
7637    #[serde(rename = "hsl")]
7638    Hsl,
7639    #[serde(rename = "hsl-long")]
7640    HslLong,
7641    #[serde(rename = "lab")]
7642    Lab,
7643    #[serde(rename = "rgb")]
7644    Rgb,
7645}
7646
7647#[derive(Debug, Serialize, Deserialize)]
7648pub enum NiceTime {
7649    #[serde(rename = "day")]
7650    Day,
7651    #[serde(rename = "hour")]
7652    Hour,
7653    #[serde(rename = "minute")]
7654    Minute,
7655    #[serde(rename = "month")]
7656    Month,
7657    #[serde(rename = "second")]
7658    Second,
7659    #[serde(rename = "week")]
7660    Week,
7661    #[serde(rename = "year")]
7662    Year,
7663}
7664
7665/// The type of scale.  Vega-Lite supports the following categories of scale types:
7666///
7667/// 1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous)
7668/// -- mapping continuous domains to continuous output ranges
7669/// ([`"linear"`](https://vega.github.io/vega-lite/docs/scale.html#linear),
7670/// [`"pow"`](https://vega.github.io/vega-lite/docs/scale.html#pow),
7671/// [`"sqrt"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt),
7672/// [`"log"`](https://vega.github.io/vega-lite/docs/scale.html#log),
7673/// [`"time"`](https://vega.github.io/vega-lite/docs/scale.html#time),
7674/// [`"utc"`](https://vega.github.io/vega-lite/docs/scale.html#utc),
7675/// [`"sequential"`](https://vega.github.io/vega-lite/docs/scale.html#sequential)).
7676///
7677/// 2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) --
7678/// mapping discrete domains to discrete
7679/// ([`"ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous
7680/// ([`"band"`](https://vega.github.io/vega-lite/docs/scale.html#band) and
7681/// [`"point"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.
7682///
7683/// 3) [**Discretizing
7684/// Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping
7685/// continuous domains to discrete output ranges
7686/// ([`"bin-linear"`](https://vega.github.io/vega-lite/docs/scale.html#bin-linear) and
7687/// [`"bin-ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal)).
7688///
7689/// __Default value:__ please see the [scale type
7690/// table](https://vega.github.io/vega-lite/docs/scale.html#type).
7691#[derive(Debug, Serialize, Deserialize)]
7692pub enum ScaleType {
7693    #[serde(rename = "band")]
7694    Band,
7695    #[serde(rename = "bin-linear")]
7696    BinLinear,
7697    #[serde(rename = "bin-ordinal")]
7698    BinOrdinal,
7699    #[serde(rename = "linear")]
7700    Linear,
7701    #[serde(rename = "log")]
7702    Log,
7703    #[serde(rename = "ordinal")]
7704    Ordinal,
7705    #[serde(rename = "point")]
7706    Point,
7707    #[serde(rename = "pow")]
7708    Pow,
7709    #[serde(rename = "sequential")]
7710    Sequential,
7711    #[serde(rename = "sqrt")]
7712    Sqrt,
7713    #[serde(rename = "time")]
7714    Time,
7715    #[serde(rename = "utc")]
7716    Utc,
7717}
7718
7719/// Whether to sort the field in ascending or descending order.
7720#[derive(Debug, Serialize, Deserialize)]
7721pub enum VgComparatorOrder {
7722    #[serde(rename = "ascending")]
7723    Ascending,
7724    #[serde(rename = "descending")]
7725    Descending,
7726}
7727
7728/// All types of primitive marks.
7729///
7730/// The mark type.
7731/// One of `"bar"`, `"circle"`, `"square"`, `"tick"`, `"line"`,
7732/// `"area"`, `"point"`, `"geoshape"`, `"rule"`, and `"text"`.
7733#[derive(Debug, Serialize, Deserialize)]
7734pub enum Mark {
7735    #[serde(rename = "area")]
7736    Area,
7737    #[serde(rename = "bar")]
7738    Bar,
7739    #[serde(rename = "circle")]
7740    Circle,
7741    #[serde(rename = "geoshape")]
7742    Geoshape,
7743    #[serde(rename = "line")]
7744    Line,
7745    #[serde(rename = "point")]
7746    Point,
7747    #[serde(rename = "rect")]
7748    Rect,
7749    #[serde(rename = "rule")]
7750    Rule,
7751    #[serde(rename = "square")]
7752    Square,
7753    #[serde(rename = "text")]
7754    Text,
7755    #[serde(rename = "tick")]
7756    Tick,
7757    #[serde(rename = "trail")]
7758    Trail,
7759}
7760
7761#[derive(Debug, Serialize, Deserialize)]
7762pub enum ResolveMode {
7763    #[serde(rename = "independent")]
7764    Independent,
7765    #[serde(rename = "shared")]
7766    Shared,
7767}
7768
7769#[derive(Debug, Serialize, Deserialize)]
7770pub enum SelectionDefType {
7771    #[serde(rename = "interval")]
7772    Interval,
7773    #[serde(rename = "multi")]
7774    Multi,
7775    #[serde(rename = "single")]
7776    Single,
7777}
7778
7779/// The window or aggregation operations to apply within a window, including `rank`, `lead`,
7780/// `sum`, `average` or `count`. See the list of all supported operations
7781/// [here](https://vega.github.io/vega-lite/docs/window.html#ops).
7782///
7783/// Aggregation function for the field
7784/// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
7785///
7786/// __Default value:__ `undefined` (None)
7787///
7788/// An [aggregate operation](https://vega.github.io/vega-lite/docs/aggregate.html#ops) to
7789/// perform on the field prior to sorting (e.g., `"count"`, `"mean"` and `"median"`).
7790/// This property is required in cases where the sort field and the data reference field do
7791/// not match.
7792/// The input data objects will be aggregated, grouped by the encoded data field.
7793///
7794/// For a full list of operations, please see the documentation for
7795/// [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).
7796///
7797/// The aggregation operations to apply to the fields, such as sum, average or count.
7798/// See the [full list of supported aggregation
7799/// operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)
7800/// for more information.
7801#[derive(Debug, Serialize, Deserialize)]
7802pub enum Op {
7803    #[serde(rename = "argmax")]
7804    Argmax,
7805    #[serde(rename = "argmin")]
7806    Argmin,
7807    #[serde(rename = "average")]
7808    Average,
7809    #[serde(rename = "ci0")]
7810    Ci0,
7811    #[serde(rename = "ci1")]
7812    Ci1,
7813    #[serde(rename = "count")]
7814    Count,
7815    #[serde(rename = "cume_dist")]
7816    CumeDist,
7817    #[serde(rename = "dense_rank")]
7818    DenseRank,
7819    #[serde(rename = "distinct")]
7820    Distinct,
7821    #[serde(rename = "first_value")]
7822    FirstValue,
7823    #[serde(rename = "lag")]
7824    Lag,
7825    #[serde(rename = "last_value")]
7826    LastValue,
7827    #[serde(rename = "lead")]
7828    Lead,
7829    #[serde(rename = "max")]
7830    Max,
7831    #[serde(rename = "mean")]
7832    Mean,
7833    #[serde(rename = "median")]
7834    Median,
7835    #[serde(rename = "min")]
7836    Min,
7837    #[serde(rename = "missing")]
7838    Missing,
7839    #[serde(rename = "nth_value")]
7840    NthValue,
7841    #[serde(rename = "ntile")]
7842    Ntile,
7843    #[serde(rename = "percent_rank")]
7844    PercentRank,
7845    #[serde(rename = "q1")]
7846    Q1,
7847    #[serde(rename = "q3")]
7848    Q3,
7849    #[serde(rename = "rank")]
7850    Rank,
7851    #[serde(rename = "row_number")]
7852    RowNumber,
7853    #[serde(rename = "stderr")]
7854    Stderr,
7855    #[serde(rename = "stdev")]
7856    Stdev,
7857    #[serde(rename = "stdevp")]
7858    Stdevp,
7859    #[serde(rename = "sum")]
7860    Sum,
7861    #[serde(rename = "valid")]
7862    Valid,
7863    #[serde(rename = "values")]
7864    Values,
7865    #[serde(rename = "variance")]
7866    Variance,
7867    #[serde(rename = "variancep")]
7868    Variancep,
7869}