Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
57files differ
22modified
35new
0deleted
14,619changed lines
+10,259 −4,360insertions / deletions
Base 3df8d2010453809da42f3a516d959c56eb8ebe37 · PR merge f41bac926a8d253287c843f3f0677f034e418dcd · Head e124ac76e4f84acb2d7562ee6cba6cf0919e1c9e · raw patch
Aschema-cjson/test/inputs/schema/one-of-objects.schema/default/TopLevel.c+172 −0
@@ -0,0 +1,172 @@
1+/**
2+ * TopLevel.c
3+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
4+ */
5+
6+#include "TopLevel.h"
7+
8+struct Item * cJSON_ParseItem(const char * s) {
9+ struct Item * x = NULL;
10+ if (NULL != s) {
11+ cJSON * j = cJSON_Parse(s);
12+ if (NULL != j) {
13+ x = cJSON_GetItemValue(j);
14+ cJSON_Delete(j);
15+ }
16+ }
17+ return x;
18+}
19+
20+struct Item * cJSON_GetItemValue(const cJSON * j) {
21+ struct Item * x = NULL;
22+ if (NULL != j) {
23+ if (NULL != (x = cJSON_malloc(sizeof(struct Item)))) {
24+ memset(x, 0, sizeof(struct Item));
25+ if (cJSON_HasObjectItem(j, "aa")) {
26+ x->aa = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "aa")));
27+ }
28+ if (cJSON_HasObjectItem(j, "bb")) {
29+ x->bb = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "bb")));
30+ }
31+ if (cJSON_HasObjectItem(j, "cc")) {
32+ x->cc = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "cc")));
33+ }
34+ if (cJSON_HasObjectItem(j, "dd")) {
35+ x->dd = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "dd")));
36+ }
37+ }
38+ }
39+ return x;
40+}
41+
42+cJSON * cJSON_CreateItem(const struct Item * x) {
43+ cJSON * j = NULL;
44+ if (NULL != x) {
45+ if (NULL != (j = cJSON_CreateObject())) {
46+ if (NULL != x->aa) {
47+ cJSON_AddStringToObject(j, "aa", x->aa);
48+ }
49+ if (NULL != x->bb) {
50+ cJSON_AddStringToObject(j, "bb", x->bb);
51+ }
52+ if (NULL != x->cc) {
53+ cJSON_AddStringToObject(j, "cc", x->cc);
54+ }
55+ if (NULL != x->dd) {
56+ cJSON_AddStringToObject(j, "dd", x->dd);
57+ }
58+ }
59+ }
60+ return j;
61+}
62+
63+char * cJSON_PrintItem(const struct Item * x) {
64+ char * s = NULL;
65+ if (NULL != x) {
66+ cJSON * j = cJSON_CreateItem(x);
67+ if (NULL != j) {
68+ s = cJSON_Print(j);
69+ cJSON_Delete(j);
70+ }
71+ }
72+ return s;
73+}
74+
75+void cJSON_DeleteItem(struct Item * x) {
76+ if (NULL != x) {
77+ if (NULL != x->aa) {
78+ cJSON_free(x->aa);
79+ }
80+ if (NULL != x->bb) {
81+ cJSON_free(x->bb);
82+ }
83+ if (NULL != x->cc) {
84+ cJSON_free(x->cc);
85+ }
86+ if (NULL != x->dd) {
87+ cJSON_free(x->dd);
88+ }
89+ cJSON_free(x);
90+ }
91+}
92+
93+struct TopLevel * cJSON_ParseTopLevel(const char * s) {
94+ struct TopLevel * x = NULL;
95+ if (NULL != s) {
96+ cJSON * j = cJSON_Parse(s);
97+ if (NULL != j) {
98+ x = cJSON_GetTopLevelValue(j);
99+ cJSON_Delete(j);
100+ }
101+ }
102+ return x;
103+}
104+
105+struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
106+ struct TopLevel * x = NULL;
107+ if (NULL != j) {
108+ if (NULL != (x = cJSON_malloc(sizeof(struct TopLevel)))) {
109+ memset(x, 0, sizeof(struct TopLevel));
110+ if (cJSON_HasObjectItem(j, "items")) {
111+ list_t * x1 = list_create(false, NULL);
112+ if (NULL != x1) {
113+ cJSON * e1 = NULL;
114+ cJSON * j1 = cJSON_GetObjectItemCaseSensitive(j, "items");
115+ cJSON_ArrayForEach(e1, j1) {
116+ list_add_tail(x1, cJSON_GetItemValue(e1), sizeof(struct Item *));
117+ }
118+ x->items = x1;
119+ }
120+ }
121+ else {
122+ x->items = list_create(false, NULL);
123+ }
124+ }
125+ }
126+ return x;
127+}
128+
129+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
130+ cJSON * j = NULL;
131+ if (NULL != x) {
132+ if (NULL != (j = cJSON_CreateObject())) {
133+ if (NULL != x->items) {
134+ cJSON * j1 = cJSON_AddArrayToObject(j, "items");
135+ if (NULL != j1) {
136+ struct Item * x1 = list_get_head(x->items);
137+ while (NULL != x1) {
138+ cJSON_AddItemToArray(j1, cJSON_CreateItem(x1));
139+ x1 = list_get_next(x->items);
140+ }
141+ }
142+ }
143+ }
144+ }
145+ return j;
146+}
147+
148+char * cJSON_PrintTopLevel(const struct TopLevel * x) {
149+ char * s = NULL;
150+ if (NULL != x) {
151+ cJSON * j = cJSON_CreateTopLevel(x);
152+ if (NULL != j) {
153+ s = cJSON_Print(j);
154+ cJSON_Delete(j);
155+ }
156+ }
157+ return s;
158+}
159+
160+void cJSON_DeleteTopLevel(struct TopLevel * x) {
161+ if (NULL != x) {
162+ if (NULL != x->items) {
163+ struct Item * x1 = list_get_head(x->items);
164+ while (NULL != x1) {
165+ cJSON_DeleteItem(x1);
166+ x1 = list_get_next(x->items);
167+ }
168+ list_release(x->items);
169+ }
170+ cJSON_free(x);
171+ }
172+}
Aschema-cjson/test/inputs/schema/one-of-objects.schema/default/TopLevel.h+64 −0
@@ -0,0 +1,64 @@
1+/**
2+ * TopLevel.h
3+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
4+ * This file depends of https://github.com/DaveGamble/cJSON, https://github.com/joelguittet/c-list and https://github.com/joelguittet/c-hashtable
5+ * To parse json data from json string use the following: struct <type> * data = cJSON_Parse<type>(<string>);
6+ * To get json data from cJSON object use the following: struct <type> * data = cJSON_Get<type>Value(<cjson>);
7+ * To get cJSON object from json data use the following: cJSON * cjson = cJSON_Create<type>(<data>);
8+ * To print json string from json data use the following: char * string = cJSON_Print<type>(<data>);
9+ * To delete json data use the following: cJSON_Delete<type>(<data>);
10+ */
11+
12+#ifndef __TOPLEVEL_H__
13+#define __TOPLEVEL_H__
14+
15+#ifdef __cplusplus
16+extern "C" {
17+#endif
18+
19+#include <stdint.h>
20+#include <stdbool.h>
21+#include <stdlib.h>
22+#include <string.h>
23+#include <cJSON.h>
24+#include <hashtable.h>
25+#include <list.h>
26+
27+#ifndef cJSON_Bool
28+#define cJSON_Bool (cJSON_True | cJSON_False)
29+#endif
30+#ifndef cJSON_Map
31+#define cJSON_Map (1 << 16)
32+#endif
33+#ifndef cJSON_Enum
34+#define cJSON_Enum (1 << 17)
35+#endif
36+
37+struct Item {
38+ char * aa;
39+ char * bb;
40+ char * cc;
41+ char * dd;
42+};
43+
44+struct TopLevel {
45+ list_t * items;
46+};
47+
48+struct Item * cJSON_ParseItem(const char * s);
49+struct Item * cJSON_GetItemValue(const cJSON * j);
50+cJSON * cJSON_CreateItem(const struct Item * x);
51+char * cJSON_PrintItem(const struct Item * x);
52+void cJSON_DeleteItem(struct Item * x);
53+
54+struct TopLevel * cJSON_ParseTopLevel(const char * s);
55+struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j);
56+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x);
57+char * cJSON_PrintTopLevel(const struct TopLevel * x);
58+void cJSON_DeleteTopLevel(struct TopLevel * x);
59+
60+#ifdef __cplusplus
61+}
62+#endif
63+
64+#endif /* __TOPLEVEL_H__ */
Aschema-cplusplus/test/inputs/schema/one-of-objects.schema/default/quicktype.hpp+165 −0
@@ -0,0 +1,165 @@
1+// To parse this JSON data, first install
2+//
3+// json.hpp https://github.com/nlohmann/json
4+//
5+// Then include this file, and then do
6+//
7+// TopLevel data = nlohmann::json::parse(jsonString);
8+
9+#pragma once
10+
11+#include <optional>
12+#include "json.hpp"
13+
14+#include <optional>
15+#include <stdexcept>
16+#include <regex>
17+
18+#ifndef NLOHMANN_OPT_HELPER
19+#define NLOHMANN_OPT_HELPER
20+namespace nlohmann {
21+ template <typename T>
22+ struct adl_serializer<std::shared_ptr<T>> {
23+ static void to_json(json & j, const std::shared_ptr<T> & opt) {
24+ if (!opt) j = nullptr; else j = *opt;
25+ }
26+
27+ static std::shared_ptr<T> from_json(const json & j) {
28+ if (j.is_null()) return std::shared_ptr<T>(); else return std::make_shared<T>(j.get<T>());
29+ }
30+ };
31+ template <typename T>
32+ struct adl_serializer<std::optional<T>> {
33+ static void to_json(json & j, const std::optional<T> & opt) {
34+ if (!opt) j = nullptr; else j = *opt;
35+ }
36+
37+ static std::optional<T> from_json(const json & j) {
38+ if (j.is_null()) return std::optional<T>(); else return std::make_optional<T>(j.get<T>());
39+ }
40+ };
41+}
42+#endif
43+
44+namespace quicktype {
45+ using nlohmann::json;
46+
47+ #ifndef NLOHMANN_UNTYPED_quicktype_HELPER
48+ #define NLOHMANN_UNTYPED_quicktype_HELPER
49+ inline json get_untyped(const json & j, const char * property) {
50+ if (j.find(property) != j.end()) {
51+ return j.at(property).get<json>();
52+ }
53+ return json();
54+ }
55+
56+ inline json get_untyped(const json & j, std::string property) {
57+ return get_untyped(j, property.data());
58+ }
59+ #endif
60+
61+ #ifndef NLOHMANN_OPTIONAL_quicktype_HELPER
62+ #define NLOHMANN_OPTIONAL_quicktype_HELPER
63+ template <typename T>
64+ inline std::shared_ptr<T> get_heap_optional(const json & j, const char * property) {
65+ auto it = j.find(property);
66+ if (it != j.end() && !it->is_null()) {
67+ return j.at(property).get<std::shared_ptr<T>>();
68+ }
69+ return std::shared_ptr<T>();
70+ }
71+
72+ template <typename T>
73+ inline std::shared_ptr<T> get_heap_optional(const json & j, std::string property) {
74+ return get_heap_optional<T>(j, property.data());
75+ }
76+ template <typename T>
77+ inline std::optional<T> get_stack_optional(const json & j, const char * property) {
78+ auto it = j.find(property);
79+ if (it != j.end() && !it->is_null()) {
80+ return j.at(property).get<std::optional<T>>();
81+ }
82+ return std::optional<T>();
83+ }
84+
85+ template <typename T>
86+ inline std::optional<T> get_stack_optional(const json & j, std::string property) {
87+ return get_stack_optional<T>(j, property.data());
88+ }
89+ #endif
90+
91+ class Item {
92+ public:
93+ Item() = default;
94+ virtual ~Item() = default;
95+
96+ private:
97+ std::optional<std::string> aa;
98+ std::optional<std::string> bb;
99+ std::optional<std::string> cc;
100+ std::optional<std::string> dd;
101+
102+ public:
103+ const std::optional<std::string> & get_aa() const { return aa; }
104+ std::optional<std::string> & get_mutable_aa() { return aa; }
105+ void set_aa(const std::optional<std::string> & value) { this->aa = value; }
106+
107+ const std::optional<std::string> & get_bb() const { return bb; }
108+ std::optional<std::string> & get_mutable_bb() { return bb; }
109+ void set_bb(const std::optional<std::string> & value) { this->bb = value; }
110+
111+ const std::optional<std::string> & get_cc() const { return cc; }
112+ std::optional<std::string> & get_mutable_cc() { return cc; }
113+ void set_cc(const std::optional<std::string> & value) { this->cc = value; }
114+
115+ const std::optional<std::string> & get_dd() const { return dd; }
116+ std::optional<std::string> & get_mutable_dd() { return dd; }
117+ void set_dd(const std::optional<std::string> & value) { this->dd = value; }
118+ };
119+
120+ class TopLevel {
121+ public:
122+ TopLevel() = default;
123+ virtual ~TopLevel() = default;
124+
125+ private:
126+ std::vector<Item> items;
127+
128+ public:
129+ const std::vector<Item> & get_items() const { return items; }
130+ std::vector<Item> & get_mutable_items() { return items; }
131+ void set_items(const std::vector<Item> & value) { this->items = value; }
132+ };
133+}
134+
135+namespace quicktype {
136+ void from_json(const json & j, Item & x);
137+ void to_json(json & j, const Item & x);
138+
139+ void from_json(const json & j, TopLevel & x);
140+ void to_json(json & j, const TopLevel & x);
141+
142+ inline void from_json(const json & j, Item& x) {
143+ x.set_aa(get_stack_optional<std::string>(j, "aa"));
144+ x.set_bb(get_stack_optional<std::string>(j, "bb"));
145+ x.set_cc(get_stack_optional<std::string>(j, "cc"));
146+ x.set_dd(get_stack_optional<std::string>(j, "dd"));
147+ }
148+
149+ inline void to_json(json & j, const Item & x) {
150+ j = json::object();
151+ j["aa"] = x.get_aa();
152+ j["bb"] = x.get_bb();
153+ j["cc"] = x.get_cc();
154+ j["dd"] = x.get_dd();
155+ }
156+
157+ inline void from_json(const json & j, TopLevel& x) {
158+ x.set_items(j.at("items").get<std::vector<Item>>());
159+ }
160+
161+ inline void to_json(json & j, const TopLevel & x) {
162+ j = json::object();
163+ j["items"] = x.get_items();
164+ }
165+}
Aschema-csharp-SystemTextJson/test/inputs/schema/one-of-objects.schema/default/QuickType.cs+76 −0
@@ -0,0 +1,76 @@
1+// <auto-generated />
2+//
3+// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
4+//
5+// using QuickType;
6+//
7+// var topLevel = TopLevel.FromJson(jsonString);
8+#nullable enable
9+#pragma warning disable CS8618
10+#pragma warning disable CS8601
11+#pragma warning disable CS8602
12+#pragma warning disable CS8603
13+#pragma warning disable CS8604
14+#pragma warning disable CS8625
15+#pragma warning disable CS8765
16+
17+namespace QuickType
18+{
19+ using System;
20+ using System.Collections.Generic;
21+
22+ using System.Globalization;
23+ using Newtonsoft.Json;
24+ using Newtonsoft.Json.Converters;
25+
26+ public partial class TopLevel
27+ {
28+ [JsonProperty("items", Required = Required.Always)]
29+ public Item[] Items { get; set; }
30+ }
31+
32+ public partial class Item
33+ {
34+ [JsonProperty("aa", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
35+ public string? Aa { get; set; }
36+
37+ [JsonProperty("bb", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
38+ public string? Bb { get; set; }
39+
40+ [JsonProperty("cc", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
41+ public string? Cc { get; set; }
42+
43+ [JsonProperty("dd", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
44+ public string? Dd { get; set; }
45+ }
46+
47+ public partial class TopLevel
48+ {
49+ public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings);
50+ }
51+
52+ public static partial class Serialize
53+ {
54+ public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
55+ }
56+
57+ internal static partial class Converter
58+ {
59+ public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
60+ {
61+ MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
62+ DateParseHandling = DateParseHandling.None,
63+ Converters =
64+ {
65+ new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
66+ },
67+ };
68+ }
69+}
70+#pragma warning restore CS8618
71+#pragma warning restore CS8601
72+#pragma warning restore CS8602
73+#pragma warning restore CS8603
74+#pragma warning restore CS8604
75+#pragma warning restore CS8625
76+#pragma warning restore CS8765
Aschema-csharp/test/inputs/schema/one-of-objects.schema/default/QuickType.cs+185 −0
@@ -0,0 +1,185 @@
1+// <auto-generated />
2+//
3+// To parse this JSON data, add NuGet 'System.Text.Json' then do:
4+//
5+// using QuickType;
6+//
7+// var topLevel = TopLevel.FromJson(jsonString);
8+#nullable enable
9+#pragma warning disable CS8618
10+#pragma warning disable CS8601
11+#pragma warning disable CS8602
12+#pragma warning disable CS8603
13+
14+namespace QuickType
15+{
16+ using System;
17+ using System.Collections.Generic;
18+
19+ using System.Text.Json;
20+ using System.Text.Json.Serialization;
21+ using System.Globalization;
22+
23+ public partial class TopLevel
24+ {
25+ [JsonRequired]
26+ [JsonPropertyName("items")]
27+ public Item[] Items { get; set; }
28+ }
29+
30+ public partial class Item
31+ {
32+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
33+ [JsonPropertyName("aa")]
34+ public string? Aa { get; set; }
35+
36+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
37+ [JsonPropertyName("bb")]
38+ public string? Bb { get; set; }
39+
40+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
41+ [JsonPropertyName("cc")]
42+ public string? Cc { get; set; }
43+
44+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
45+ [JsonPropertyName("dd")]
46+ public string? Dd { get; set; }
47+ }
48+
49+ public partial class TopLevel
50+ {
51+ public static TopLevel FromJson(string json) => JsonSerializer.Deserialize<TopLevel>(json, QuickType.Converter.Settings);
52+ }
53+
54+ public static partial class Serialize
55+ {
56+ public static string ToJson(this TopLevel self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
57+ }
58+
59+ internal static partial class Converter
60+ {
61+ public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
62+ {
63+ Converters =
64+ {
65+ new DateOnlyConverter(),
66+ new TimeOnlyConverter(),
67+ IsoDateTimeOffsetConverter.Singleton
68+ },
69+ };
70+ }
71+
72+ public class DateOnlyConverter : JsonConverter<DateOnly>
73+ {
74+ private readonly string serializationFormat;
75+ public DateOnlyConverter() : this(null) { }
76+
77+ public DateOnlyConverter(string? serializationFormat)
78+ {
79+ this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
80+ }
81+
82+ public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
83+ {
84+ var value = reader.GetString();
85+ return DateOnly.Parse(value!);
86+ }
87+
88+ public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
89+ => writer.WriteStringValue(value.ToString(serializationFormat));
90+ }
91+
92+ public class TimeOnlyConverter : JsonConverter<TimeOnly>
93+ {
94+ private readonly string serializationFormat;
95+
96+ public TimeOnlyConverter() : this(null) { }
97+
98+ public TimeOnlyConverter(string? serializationFormat)
99+ {
100+ this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
101+ }
102+
103+ public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
104+ {
105+ var value = reader.GetString();
106+ return TimeOnly.Parse(value!);
107+ }
108+
109+ public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
110+ => writer.WriteStringValue(value.ToString(serializationFormat));
111+ }
112+
113+ internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
114+ {
115+ public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
116+
117+ private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
118+
119+ private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
120+ private string? _dateTimeFormat;
121+ private CultureInfo? _culture;
122+
123+ public DateTimeStyles DateTimeStyles
124+ {
125+ get => _dateTimeStyles;
126+ set => _dateTimeStyles = value;
127+ }
128+
129+ public string? DateTimeFormat
130+ {
131+ get => _dateTimeFormat ?? string.Empty;
132+ set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
133+ }
134+
135+ public CultureInfo Culture
136+ {
137+ get => _culture ?? CultureInfo.CurrentCulture;
138+ set => _culture = value;
139+ }
140+
141+ public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
142+ {
143+ string text;
144+
145+
146+ if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
147+ || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
148+ {
149+ value = value.ToUniversalTime();
150+ }
151+
152+ text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
153+
154+ writer.WriteStringValue(text);
155+ }
156+
157+ public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
158+ {
159+ string? dateText = reader.GetString();
160+
161+ if (string.IsNullOrEmpty(dateText) == false)
162+ {
163+ if (!string.IsNullOrEmpty(_dateTimeFormat))
164+ {
165+ return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
166+ }
167+ else
168+ {
169+ return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
170+ }
171+ }
172+ else
173+ {
174+ return default(DateTimeOffset);
175+ }
176+ }
177+
178+
179+ public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
180+ }
181+}
182+#pragma warning restore CS8618
183+#pragma warning restore CS8601
184+#pragma warning restore CS8602
185+#pragma warning restore CS8603
Aschema-dart/test/inputs/schema/one-of-objects.schema/default/TopLevel.dart+53 −0
@@ -0,0 +1,53 @@
1+// To parse this JSON data, do
2+//
3+// final topLevel = topLevelFromJson(jsonString);
4+
5+import 'dart:convert';
6+
7+TopLevel topLevelFromJson(String str) => TopLevel.fromJson(json.decode(str));
8+
9+String topLevelToJson(TopLevel data) => json.encode(data.toJson());
10+
11+class TopLevel {
12+ final List<Item> items;
13+
14+ TopLevel({
15+ required this.items,
16+ });
17+
18+ factory TopLevel.fromJson(Map<String, dynamic> json) => TopLevel(
19+ items: List<Item>.from(json["items"].map((x) => Item.fromJson(x))),
20+ );
21+
22+ Map<String, dynamic> toJson() => {
23+ "items": List<dynamic>.from(items.map((x) => x.toJson())),
24+ };
25+}
26+
27+class Item {
28+ final String? aa;
29+ final String? bb;
30+ final String? cc;
31+ final String? dd;
32+
33+ Item({
34+ this.aa,
35+ this.bb,
36+ this.cc,
37+ this.dd,
38+ });
39+
40+ factory Item.fromJson(Map<String, dynamic> json) => Item(
41+ aa: json["aa"],
42+ bb: json["bb"],
43+ cc: json["cc"],
44+ dd: json["dd"],
45+ );
46+
47+ Map<String, dynamic> toJson() => {
48+ "aa": aa,
49+ "bb": bb,
50+ "cc": cc,
51+ "dd": dd,
52+ };
53+}
Aschema-elixir/test/inputs/schema/one-of-objects.schema/default/QuickType.ex+80 −0
@@ -0,0 +1,80 @@
1+# This file was autogenerated using quicktype https://github.com/quicktype/quicktype
2+#
3+# Add Jason to your mix.exs
4+#
5+# Decode a JSON string: TopLevel.from_json(data)
6+# Encode into a JSON string: TopLevel.to_json(struct)
7+
8+defmodule Item do
9+ defstruct [:aa, :bb, :cc, :dd]
10+
11+ @type t :: %__MODULE__{
12+ aa: String.t() | nil,
13+ bb: String.t() | nil,
14+ cc: String.t() | nil,
15+ dd: String.t() | nil
16+ }
17+
18+ def from_map(m) do
19+ %Item{
20+ aa: m["aa"],
21+ bb: m["bb"],
22+ cc: m["cc"],
23+ dd: m["dd"],
24+ }
25+ end
26+
27+ def from_json(json) do
28+ json
29+ |> Jason.decode!()
30+ |> from_map()
31+ end
32+
33+ def to_map(struct) do
34+ %{
35+ "aa" => struct.aa,
36+ "bb" => struct.bb,
37+ "cc" => struct.cc,
38+ "dd" => struct.dd,
39+ }
40+ end
41+
42+ def to_json(struct) do
43+ struct
44+ |> to_map()
45+ |> Jason.encode!()
46+ end
47+end
48+
49+defmodule TopLevel do
50+ @enforce_keys [:items]
51+ defstruct [:items]
52+
53+ @type t :: %__MODULE__{
54+ items: [Item.t()]
55+ }
56+
57+ def from_map(m) do
58+ %TopLevel{
59+ items: Enum.map(m["items"], &Item.from_map/1),
60+ }
61+ end
62+
63+ def from_json(json) do
64+ json
65+ |> Jason.decode!()
66+ |> from_map()
67+ end
68+
69+ def to_map(struct) do
70+ %{
71+ "items" => struct.items && Enum.map(struct.items, &Item.to_map/1),
72+ }
73+ end
74+
75+ def to_json(struct) do
76+ struct
77+ |> to_map()
78+ |> Jason.encode!()
79+ end
80+end
Aschema-elm/test/inputs/schema/one-of-objects.schema/default/QuickType.elm+76 −0
@@ -0,0 +1,76 @@
1+-- To decode the JSON data, add this file to your project, run
2+--
3+-- elm install NoRedInk/elm-json-decode-pipeline
4+--
5+-- add these imports
6+--
7+-- import Json.Decode exposing (decodeString)
8+-- import QuickType exposing (quickType)
9+--
10+-- and you're off to the races with
11+--
12+-- decodeString quickType myJsonString
13+
14+module QuickType exposing
15+ ( QuickType
16+ , quickTypeToString
17+ , quickType
18+ , Item
19+ )
20+
21+import Json.Decode as Jdec
22+import Json.Decode.Pipeline as Jpipe
23+import Json.Encode as Jenc
24+import Dict exposing (Dict)
25+
26+type alias QuickType =
27+ { items : List Item
28+ }
29+
30+type alias Item =
31+ { aa : Maybe String
32+ , bb : Maybe String
33+ , cc : Maybe String
34+ , dd : Maybe String
35+ }
36+
37+-- decoders and encoders
38+
39+quickTypeToString : QuickType -> String
40+quickTypeToString r = Jenc.encode 0 (encodeQuickType r)
41+
42+quickType : Jdec.Decoder QuickType
43+quickType =
44+ Jdec.succeed QuickType
45+ |> Jpipe.required "items" (Jdec.list item)
46+
47+encodeQuickType : QuickType -> Jenc.Value
48+encodeQuickType x =
49+ Jenc.object
50+ [ ("items", Jenc.list encodeItem x.items)
51+ ]
52+
53+item : Jdec.Decoder Item
54+item =
55+ Jdec.succeed Item
56+ |> Jpipe.optional "aa" (Jdec.nullable Jdec.string) Nothing
57+ |> Jpipe.optional "bb" (Jdec.nullable Jdec.string) Nothing
58+ |> Jpipe.optional "cc" (Jdec.nullable Jdec.string) Nothing
59+ |> Jpipe.optional "dd" (Jdec.nullable Jdec.string) Nothing
60+
61+encodeItem : Item -> Jenc.Value
62+encodeItem x =
63+ Jenc.object
64+ [ ("aa", makeNullableEncoder Jenc.string x.aa)
65+ , ("bb", makeNullableEncoder Jenc.string x.bb)
66+ , ("cc", makeNullableEncoder Jenc.string x.cc)
67+ , ("dd", makeNullableEncoder Jenc.string x.dd)
68+ ]
69+
70+--- encoder helpers
71+
72+makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
73+makeNullableEncoder f m =
74+ case m of
75+ Just x -> f x
76+ Nothing -> Jenc.null
Mschema-flow/test/inputs/schema/class-map-union.schema/default/TopLevel.js+16 −16
@@ -13,23 +13,21 @@ export type TopLevel = {
1313 union?: TopLevelUnion;
1414 };
1515
16-export type TopLevelUnion = {
17- foo?: Foo;
18- bar?: Bar;
19- [property: string]: UnionValue;
16+export type TopLevelUnion = PurpleUnion | FluffyUnion | { [key: string]: boolean } | { [key: string]: UnionValue };
17+
18+export type PurpleUnion = {
19+ foo?: number;
2020 };
2121
22-export type Bar = boolean | BarObject | string;
22+export type FluffyUnion = {
23+ bar?: string;
24+};
2325
24-export type BarObject = {
26+export type UnionValue = {
2527 quux?: number;
2628 [property: string]: mixed;
2729 };
2830
29-export type Foo = boolean | number | BarObject;
30-
31-export type UnionValue = boolean | BarObject;
32-
3331 // Converts JSON strings to/from your types
3432 // and asserts the results of JSON.parse at runtime
3533 function toTopLevel(json: string): TopLevel {
@@ -195,13 +193,15 @@ function r(name: string) {
195193
196194 const typeMap: any = {
197195 "TopLevel": o([
198- { json: "union", js: "union", typ: u(undefined, r("TopLevelUnion")) },
196+ { json: "union", js: "union", typ: u(undefined, u(r("PurpleUnion"), r("FluffyUnion"), m(true), m(r("UnionValue")))) },
197+ ], false),
198+ "PurpleUnion": o([
199+ { json: "foo", js: "foo", typ: u(undefined, 3.14) },
200+ ], false),
201+ "FluffyUnion": o([
202+ { json: "bar", js: "bar", typ: u(undefined, "") },
199203 ], false),
200- "TopLevelUnion": o([
201- { json: "foo", js: "foo", typ: u(undefined, u(true, 3.14, r("BarObject"))) },
202- { json: "bar", js: "bar", typ: u(undefined, u(true, r("BarObject"), "")) },
203- ], u(true, r("BarObject"))),
204- "BarObject": o([
204+ "UnionValue": o([
205205 { json: "quux", js: "quux", typ: u(undefined, 0) },
206206 ], "any"),
207207 };
Mschema-flow/test/inputs/schema/nested-intersection-union.schema/default/TopLevel.js+25 −11
@@ -13,11 +13,21 @@ export type TopLevel = {
1313 input: Item[];
1414 };
1515
16-export type Item = {
17- content?: string;
18- id?: string;
19- output?: string;
20- summary?: string;
16+export type Item = Message | FunctionOutput | ReasoningItem;
17+
18+export type Message = {
19+ content: string;
20+ [property: string]: mixed;
21+};
22+
23+export type FunctionOutput = {
24+ id: string;
25+ output: string;
26+ [property: string]: mixed;
27+};
28+
29+export type ReasoningItem = {
30+ summary: string;
2131 [property: string]: mixed;
2232 };
2333
@@ -186,13 +196,17 @@ function r(name: string) {
186196
187197 const typeMap: any = {
188198 "TopLevel": o([
189- { json: "input", js: "input", typ: a(r("Item")) },
199+ { json: "input", js: "input", typ: a(u(r("Message"), r("FunctionOutput"), r("ReasoningItem"))) },
190200 ], false),
191- "Item": o([
192- { json: "content", js: "content", typ: u(undefined, "") },
193- { json: "id", js: "id", typ: u(undefined, "") },
194- { json: "output", js: "output", typ: u(undefined, "") },
195- { json: "summary", js: "summary", typ: u(undefined, "") },
201+ "Message": o([
202+ { json: "content", js: "content", typ: "" },
203+ ], "any"),
204+ "FunctionOutput": o([
205+ { json: "id", js: "id", typ: "" },
206+ { json: "output", js: "output", typ: "" },
207+ ], "any"),
208+ "ReasoningItem": o([
209+ { json: "summary", js: "summary", typ: "" },
196210 ], "any"),
197211 };
Mschema-flow/test/inputs/schema/nullable-optional-one-of.schema/default/TopLevel.js+26 −10
@@ -9,24 +9,34 @@
99 // These functions will throw an error if the JSON doesn't
1010 // match the expected interface, even if the JSON is valid.
1111
12-export type TopLevel = {
12+export type TopLevel = One | Two;
13+
14+export type One = {
15+ b: null | string;
16+ kind: PurpleKind;
17+ [property: string]: mixed;
18+};
19+
20+export type PurpleKind =
21+ "one";
22+
23+export type Two = {
1324 b?: null | string;
14- kind: Kind;
25+ kind: FluffyKind;
1526 [property: string]: mixed;
1627 };
1728
18-export type Kind =
19- "one"
20- | "two";
29+export type FluffyKind =
30+ "two";
2131
2232 // Converts JSON strings to/from your types
2333 // and asserts the results of JSON.parse at runtime
2434 function toTopLevel(json: string): TopLevel {
25- return cast(JSON.parse(json), r("TopLevel"));
35+ return cast(JSON.parse(json), u(r("One"), r("Two")));
2636 }
2737
2838 function topLevelToJson(value: TopLevel): string {
29- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
39+ return JSON.stringify(uncast(value, u(r("One"), r("Two"))), null, 2);
3040 }
3141
3242 function invalidValue(typ: any, val: any, key: any, parent: any = '') {
@@ -183,12 +193,18 @@ function r(name: string) {
183193 }
184194
185195 const typeMap: any = {
186- "TopLevel": o([
196+ "One": o([
197+ { json: "b", js: "b", typ: u(null, "") },
198+ { json: "kind", js: "kind", typ: r("PurpleKind") },
199+ ], "any"),
200+ "Two": o([
187201 { json: "b", js: "b", typ: u(undefined, u(null, "")) },
188- { json: "kind", js: "kind", typ: r("Kind") },
202+ { json: "kind", js: "kind", typ: r("FluffyKind") },
189203 ], "any"),
190- "Kind": [
204+ "PurpleKind": [
191205 "one",
206+ ],
207+ "FluffyKind": [
192208 "two",
193209 ],
194210 };
Aschema-flow/test/inputs/schema/one-of-objects.schema/default/TopLevel.js+208 −0
@@ -0,0 +1,208 @@
1+// @flow
2+
3+// To parse this data:
4+//
5+// const Convert = require("./TopLevel");
6+//
7+// const topLevel = Convert.toTopLevel(json);
8+//
9+// These functions will throw an error if the JSON doesn't
10+// match the expected interface, even if the JSON is valid.
11+
12+export type TopLevel = {
13+ items: ItemElement[];
14+};
15+
16+export type ItemElement = PurpleItem | FluffyItem;
17+
18+export type PurpleItem = {
19+ aa?: string;
20+ bb?: string;
21+};
22+
23+export type FluffyItem = {
24+ cc?: string;
25+ dd?: string;
26+};
27+
28+// Converts JSON strings to/from your types
29+// and asserts the results of JSON.parse at runtime
30+function toTopLevel(json: string): TopLevel {
31+ return cast(JSON.parse(json), r("TopLevel"));
32+}
33+
34+function topLevelToJson(value: TopLevel): string {
35+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
36+}
37+
38+function invalidValue(typ: any, val: any, key: any, parent: any = '') {
39+ const prettyTyp = prettyTypeName(typ);
40+ const parentText = parent ? ` on ${parent}` : '';
41+ const keyText = key ? ` for key "${key}"` : '';
42+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
43+}
44+
45+function prettyTypeName(typ: any): string {
46+ if (Array.isArray(typ)) {
47+ if (typ.length === 2 && typ[0] === undefined) {
48+ return `an optional ${prettyTypeName(typ[1])}`;
49+ } else {
50+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
51+ }
52+ } else if (typeof typ === "object" && typ.literal !== undefined) {
53+ return typ.literal;
54+ } else {
55+ return typeof typ;
56+ }
57+}
58+
59+function jsonToJSProps(typ: any): any {
60+ if (typ.jsonToJS === undefined) {
61+ const map: any = {};
62+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
63+ typ.jsonToJS = map;
64+ }
65+ return typ.jsonToJS;
66+}
67+
68+function jsToJSONProps(typ: any): any {
69+ if (typ.jsToJSON === undefined) {
70+ const map: any = {};
71+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
72+ typ.jsToJSON = map;
73+ }
74+ return typ.jsToJSON;
75+}
76+
77+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
78+ function transformPrimitive(typ: string, val: any): any {
79+ if (typeof typ === typeof val) return val;
80+ return invalidValue(typ, val, key, parent);
81+ }
82+
83+ function transformUnion(typs: any[], val: any): any {
84+ // val must validate against one typ in typs
85+ const l = typs.length;
86+ for (let i = 0; i < l; i++) {
87+ const typ = typs[i];
88+ try {
89+ return transform(val, typ, getProps);
90+ } catch (_) {}
91+ }
92+ return invalidValue(typs, val, key, parent);
93+ }
94+
95+ function transformEnum(cases: string[], val: any): any {
96+ if (cases.indexOf(val) !== -1) return val;
97+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
98+ }
99+
100+ function transformArray(typ: any, val: any): any {
101+ // val must be an array with no invalid elements
102+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
103+ return val.map(el => transform(el, typ, getProps));
104+ }
105+
106+ function transformDate(val: any): any {
107+ if (val === null) {
108+ return null;
109+ }
110+ const d = new Date(val);
111+ if (isNaN(d.valueOf())) {
112+ return invalidValue(l("Date"), val, key, parent);
113+ }
114+ return d;
115+ }
116+
117+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
118+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
119+ return invalidValue(l(ref || "object"), val, key, parent);
120+ }
121+ const result: any = {};
122+ Object.getOwnPropertyNames(props).forEach(key => {
123+ const prop = props[key];
124+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
125+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
126+ });
127+ Object.getOwnPropertyNames(val).forEach(key => {
128+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
129+ result[key] = transform(val[key], additional, getProps, key, ref);
130+ }
131+ });
132+ return result;
133+ }
134+
135+ if (typ === "any") return val;
136+ if (typ === null) {
137+ if (val === null) return val;
138+ return invalidValue(typ, val, key, parent);
139+ }
140+ if (typ === false) return invalidValue(typ, val, key, parent);
141+ let ref: any = undefined;
142+ while (typeof typ === "object" && typ.ref !== undefined) {
143+ ref = typ.ref;
144+ typ = typeMap[typ.ref];
145+ }
146+ if (Array.isArray(typ)) return transformEnum(typ, val);
147+ if (typeof typ === "object") {
148+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
149+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
150+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
151+ : invalidValue(typ, val, key, parent);
152+ }
153+ // Numbers can be parsed by Date but shouldn't be.
154+ if (typ === Date && typeof val !== "number") return transformDate(val);
155+ return transformPrimitive(typ, val);
156+}
157+
158+function cast<T>(val: any, typ: any): T {
159+ return transform(val, typ, jsonToJSProps);
160+}
161+
162+function uncast<T>(val: T, typ: any): any {
163+ return transform(val, typ, jsToJSONProps);
164+}
165+
166+function l(typ: any) {
167+ return { literal: typ };
168+}
169+
170+function a(typ: any) {
171+ return { arrayItems: typ };
172+}
173+
174+function u(...typs: any[]) {
175+ return { unionMembers: typs };
176+}
177+
178+function o(props: any[], additional: any) {
179+ return { props, additional };
180+}
181+
182+function m(additional: any) {
183+ const props: any[] = [];
184+ return { props, additional };
185+}
186+
187+function r(name: string) {
188+ return { ref: name };
189+}
190+
191+const typeMap: any = {
192+ "TopLevel": o([
193+ { json: "items", js: "items", typ: a(u(r("PurpleItem"), r("FluffyItem"))) },
194+ ], false),
195+ "PurpleItem": o([
196+ { json: "aa", js: "aa", typ: u(undefined, "") },
197+ { json: "bb", js: "bb", typ: u(undefined, "") },
198+ ], false),
199+ "FluffyItem": o([
200+ { json: "cc", js: "cc", typ: u(undefined, "") },
201+ { json: "dd", js: "dd", typ: u(undefined, "") },
202+ ], false),
203+};
204+
205+module.exports = {
206+ "topLevelToJson": topLevelToJson,
207+ "toTopLevel": toTopLevel,
208+};
Mschema-flow/test/inputs/schema/postman-collection.schema/default/TopLevel.js+14 −6
@@ -9,11 +9,17 @@
99 // These functions will throw an error if the JSON doesn't
1010 // match the expected interface, even if the JSON is valid.
1111
12+export type Group = {
13+ item?: TopLevel[];
14+ [property: string]: mixed;
15+};
16+
1217 /**
1318 * Postman collection
1419 */
15-export type TopLevel = {
16- item?: TopLevel[];
20+export type TopLevel = Group | Item;
21+
22+export type Item = {
1723 name?: string;
1824 response?: Response[];
1925 [property: string]: mixed;
@@ -27,11 +33,11 @@ export type Response = {
2733 // Converts JSON strings to/from your types
2834 // and asserts the results of JSON.parse at runtime
2935 function toTopLevel(json: string): TopLevel {
30- return cast(JSON.parse(json), r("TopLevel"));
36+ return cast(JSON.parse(json), u(r("Group"), r("Item")));
3137 }
3238
3339 function topLevelToJson(value: TopLevel): string {
34- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
40+ return JSON.stringify(uncast(value, u(r("Group"), r("Item"))), null, 2);
3541 }
3642
3743 function invalidValue(typ: any, val: any, key: any, parent: any = '') {
@@ -188,8 +194,10 @@ function r(name: string) {
188194 }
189195
190196 const typeMap: any = {
191- "TopLevel": o([
192- { json: "item", js: "item", typ: u(undefined, a(r("TopLevel"))) },
197+ "Group": o([
198+ { json: "item", js: "item", typ: u(undefined, a(u(r("Group"), r("Item")))) },
199+ ], "any"),
200+ "Item": o([
193201 { json: "name", js: "name", typ: u(undefined, "") },
194202 { json: "response", js: "response", typ: u(undefined, a(r("Response"))) },
195203 ], "any"),
Mschema-flow/test/inputs/schema/union.schema/default/TopLevel.js+19 −9
@@ -9,21 +9,28 @@
99 // These functions will throw an error if the JSON doesn't
1010 // match the expected interface, even if the JSON is valid.
1111
12-export type TopLevel = {
13- one?: number;
14- two: boolean;
15- three?: number;
12+export type TopLevel = PurpleTopLevel | FluffyTopLevel;
13+
14+export type PurpleTopLevel = {
15+ one: number;
16+ two: boolean;
17+ [property: string]: mixed;
18+};
19+
20+export type FluffyTopLevel = {
21+ three: number;
22+ two: boolean;
1623 [property: string]: mixed;
1724 };
1825
1926 // Converts JSON strings to/from your types
2027 // and asserts the results of JSON.parse at runtime
2128 function toTopLevel(json: string): TopLevel[] {
22- return cast(JSON.parse(json), a(r("TopLevel")));
29+ return cast(JSON.parse(json), a(u(r("PurpleTopLevel"), r("FluffyTopLevel"))));
2330 }
2431
2532 function topLevelToJson(value: TopLevel[]): string {
26- return JSON.stringify(uncast(value, a(r("TopLevel"))), null, 2);
33+ return JSON.stringify(uncast(value, a(u(r("PurpleTopLevel"), r("FluffyTopLevel")))), null, 2);
2734 }
2835
2936 function invalidValue(typ: any, val: any, key: any, parent: any = '') {
@@ -180,10 +187,13 @@ function r(name: string) {
180187 }
181188
182189 const typeMap: any = {
183- "TopLevel": o([
184- { json: "one", js: "one", typ: u(undefined, 0) },
190+ "PurpleTopLevel": o([
191+ { json: "one", js: "one", typ: 0 },
192+ { json: "two", js: "two", typ: true },
193+ ], "any"),
194+ "FluffyTopLevel": o([
195+ { json: "three", js: "three", typ: 3.14 },
185196 { json: "two", js: "two", typ: true },
186- { json: "three", js: "three", typ: u(undefined, 3.14) },
187197 ], "any"),
188198 };
Mschema-flow/test/inputs/schema/vega-lite.schema/default/TopLevel.js+2,268 −1,207
@@ -9,7 +9,9 @@
99 // These functions will throw an error if the JSON doesn't
1010 // match the expected interface, even if the JSON is valid.
1111
12-export type TopLevel = {
12+export type TopLevel = TopLevelFacetedUnitSpec | TopLevelLayerSpec | TopLevelFacetSpec | TopLevelRepeatSpec | TopLevelVConcatSpec | TopLevelHConcatSpec;
13+
14+export type TopLevelFacetedUnitSpec = {
1315 /**
1416 * URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
1517 * have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
@@ -49,7 +51,7 @@ export type TopLevel = {
4951 /**
5052 * A key-value mapping between encoding channels and definition of fields.
5153 */
52- encoding?: EncodingWithFacet;
54+ encoding: EncodingWithFacet;
5355 /**
5456 * The height of a visualization.
5557 *
@@ -76,7 +78,7 @@ export type TopLevel = {
7678 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7779 * object](mark.html#mark-def).
7880 */
79- mark?: AnyMark;
81+ mark: AnyMark;
8082 /**
8183 * Name of the visualization for later reference.
8284 */
@@ -132,47 +134,6 @@ export type TopLevel = {
132134 * __See also:__ The documentation for [width and height](size.html) contains more examples.
133135 */
134136 width?: number;
135- /**
136- * Layer or single view specifications to be layered.
137- *
138- * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
139- * layering facet specifications is not allowed.
140- */
141- layer?: LayerSpec[];
142- /**
143- * Scale, axis, and legend resolutions for layers.
144- *
145- * Scale, axis, and legend resolutions for facets.
146- *
147- * Scale and legend resolutions for repeated charts.
148- *
149- * Scale, axis, and legend resolutions for vertically concatenated charts.
150- *
151- * Scale, axis, and legend resolutions for horizontally concatenated charts.
152- */
153- resolve?: Resolve;
154- /**
155- * An object that describes mappings between `row` and `column` channels and their field
156- * definitions.
157- */
158- facet?: FacetMapping;
159- /**
160- * A specification of the view that gets faceted.
161- */
162- spec?: Spec;
163- /**
164- * An object that describes what fields should be repeated into views that are laid out as a
165- * `row` or `column`.
166- */
167- repeat?: Repeat;
168- /**
169- * A list of views that should be concatenated and put into a column.
170- */
171- vconcat?: Spec[];
172- /**
173- * A list of views that should be concatenated and put into a row.
174- */
175- hconcat?: Spec[];
176137 };
177138
178139 /**
@@ -1814,21 +1775,18 @@ export type RangeConfig = {
18141775 *
18151776 * Default range for _quantitative_ and _temporal_ fields.
18161777 */
1817-export type Category = string[] | CategoryVGScheme;
1778+export type Category = string[] | VGScheme;
18181779
1819-export type CategoryVGScheme = {
1780+export type VGScheme = {
18201781 count?: number;
18211782 extent?: number[];
18221783 scheme: string;
18231784 };
18241785
1825-export type RangeConfigValue = TitleFontWeight[] | RangeConfigValueVGScheme;
1786+export type RangeConfigValue = TitleFontWeight[] | VGScheme | RangeConfigValueClass;
18261787
1827-export type RangeConfigValueVGScheme = {
1828- count?: number;
1829- extent?: number[];
1830- scheme?: string;
1831- step?: number;
1788+export type RangeConfigValueClass = {
1789+ step: number;
18321790 };
18331791
18341792 /**
@@ -2009,7 +1967,7 @@ export type IntervalSelectionConfig = {
20091967 * used within the same view. This allows a user to interactively pan and
20101968 * zoom the view.
20111969 */
2012- bind?: BindEnum;
1970+ bind?: Bind;
20131971 /**
20141972 * By default, all data values are considered to lie within an empty selection.
20151973 * When set to `none`, empty selections contain no data values.
@@ -2072,7 +2030,7 @@ export type IntervalSelectionConfig = {
20722030 * used within the same view. This allows a user to interactively pan and
20732031 * zoom the view.
20742032 */
2075-export type BindEnum =
2033+export type Bind =
20762034 "scales";
20772035
20782036 /**
@@ -2292,15 +2250,50 @@ export type SingleSelectionConfig = {
22922250 resolve?: SelectionResolution;
22932251 };
22942252
2295-export type VGBinding = {
2253+export type VGBinding = VGCheckboxBinding | VGRadioBinding | VGSelectBinding | VGRangeBinding | VGGenericBinding;
2254+
2255+export type VGCheckboxBinding = {
22962256 element?: string;
2297- input: string;
2298- options?: string[];
2257+ input: PurpleInput;
2258+};
2259+
2260+export type PurpleInput =
2261+ "checkbox";
2262+
2263+export type VGRadioBinding = {
2264+ element?: string;
2265+ input: FluffyInput;
2266+ options: string[];
2267+};
2268+
2269+export type FluffyInput =
2270+ "radio";
2271+
2272+export type VGSelectBinding = {
2273+ element?: string;
2274+ input: TentacledInput;
2275+ options: string[];
2276+};
2277+
2278+export type TentacledInput =
2279+ "select";
2280+
2281+export type VGRangeBinding = {
2282+ element?: string;
2283+ input: StickyInput;
22992284 max?: number;
23002285 min?: number;
23012286 step?: number;
23022287 };
23032288
2289+export type StickyInput =
2290+ "range";
2291+
2292+export type VGGenericBinding = {
2293+ element?: string;
2294+ input: string;
2295+};
2296+
23042297 /**
23052298 * Default stack offset for stackable mark.
23062299 */
@@ -3039,31 +3032,18 @@ export type ViewConfig = {
30393032 *
30403033 * Secondary data source to lookup in.
30413034 */
3042-export type Data = {
3035+export type Data = URLData | InlineData | NamedData;
3036+
3037+export type URLData = {
30433038 /**
30443039 * An object that specifies the format for parsing the data file.
3045- *
3046- * An object that specifies the format for parsing the data values.
3047- *
3048- * An object that specifies the format for parsing the data.
30493040 */
30503041 format?: DataFormat;
30513042 /**
30523043 * An URL from which to load the data set. Use the `format.type` property
30533044 * to ensure the loaded data is correctly parsed.
30543045 */
3055- url?: string;
3056- /**
3057- * The full data set, included inline. This can be an array of objects or primitive values
3058- * or a string.
3059- * Arrays of primitive values are ingested as objects with a `data` property. Strings are
3060- * parsed according to the specified format type.
3061- */
3062- values?: Values;
3063- /**
3064- * Provide a placeholder name and bind data at runtime.
3065- */
3066- name?: string;
3046+ url: string;
30673047 };
30683048
30693049 /**
@@ -3073,7 +3053,9 @@ export type Data = {
30733053 *
30743054 * An object that specifies the format for parsing the data.
30753055 */
3076-export type DataFormat = {
3056+export type DataFormat = CSVDataFormat | JSONDataFormat | TopoDataFormat;
3057+
3058+export type CSVDataFormat = {
30773059 /**
30783060 * If set to auto (the default), perform automatic type inference to determine the desired
30793061 * data types.
@@ -3096,7 +3078,41 @@ export type DataFormat = {
30963078 * The default format type is determined by the extension of the file URL.
30973079 * If no extension is detected, `"json"` will be used by default.
30983080 */
3099- type?: DataFormatType;
3081+ type?: PurpleType;
3082+};
3083+
3084+export type ParseUnion = ParseEnum | { [key: string]: mixed };
3085+
3086+export type ParseEnum =
3087+ "auto";
3088+
3089+/**
3090+ * Type of input data: `"json"`, `"csv"`, `"tsv"`.
3091+ * The default format type is determined by the extension of the file URL.
3092+ * If no extension is detected, `"json"` will be used by default.
3093+ */
3094+export type PurpleType =
3095+ "csv"
3096+ | "tsv";
3097+
3098+export type JSONDataFormat = {
3099+ /**
3100+ * If set to auto (the default), perform automatic type inference to determine the desired
3101+ * data types.
3102+ * Alternatively, a parsing directive object can be provided for explicit data types. Each
3103+ * property of the object corresponds to a field name, and the value to the desired data
3104+ * type (one of `"number"`, `"boolean"` or `"date"`).
3105+ * For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each
3106+ * input record a Date value.
3107+ *
3108+ * For `"date"`, we parse data based using Javascript's
3109+ * [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
3110+ * For Specific date formats can be provided (e.g., `{foo: 'date:"%m%d%Y"'}`), using the
3111+ * [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date
3112+ * format parsing is supported similarly (e.g., `{foo: 'utc:"%m%d%Y"'}`). See more about
3113+ * [UTC time](timeunit.html#utc)
3114+ */
3115+ parse?: ParseUnion;
31003116 /**
31013117 * The JSON property containing the desired data.
31023118 * This parameter can be used when the loaded JSON file may have surrounding structure or
@@ -3106,6 +3122,23 @@ export type DataFormat = {
31063122 * from the loaded JSON object.
31073123 */
31083124 property?: string;
3125+ /**
3126+ * Type of input data: `"json"`, `"csv"`, `"tsv"`.
3127+ * The default format type is determined by the extension of the file URL.
3128+ * If no extension is detected, `"json"` will be used by default.
3129+ */
3130+ type?: FluffyType;
3131+};
3132+
3133+/**
3134+ * Type of input data: `"json"`, `"csv"`, `"tsv"`.
3135+ * The default format type is determined by the extension of the file URL.
3136+ * If no extension is detected, `"json"` will be used by default.
3137+ */
3138+export type FluffyType =
3139+ "json";
3140+
3141+export type TopoDataFormat = {
31093142 /**
31103143 * The name of the TopoJSON object set to convert to a GeoJSON feature collection.
31113144 * For example, in a map of the world, there may be an object set named `"countries"`.
@@ -3123,23 +3156,52 @@ export type DataFormat = {
31233156 * countries, states or counties.
31243157 */
31253158 mesh?: string;
3159+ /**
3160+ * If set to auto (the default), perform automatic type inference to determine the desired
3161+ * data types.
3162+ * Alternatively, a parsing directive object can be provided for explicit data types. Each
3163+ * property of the object corresponds to a field name, and the value to the desired data
3164+ * type (one of `"number"`, `"boolean"` or `"date"`).
3165+ * For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each
3166+ * input record a Date value.
3167+ *
3168+ * For `"date"`, we parse data based using Javascript's
3169+ * [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
3170+ * For Specific date formats can be provided (e.g., `{foo: 'date:"%m%d%Y"'}`), using the
3171+ * [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date
3172+ * format parsing is supported similarly (e.g., `{foo: 'utc:"%m%d%Y"'}`). See more about
3173+ * [UTC time](timeunit.html#utc)
3174+ */
3175+ parse?: ParseUnion;
3176+ /**
3177+ * Type of input data: `"json"`, `"csv"`, `"tsv"`.
3178+ * The default format type is determined by the extension of the file URL.
3179+ * If no extension is detected, `"json"` will be used by default.
3180+ */
3181+ type?: TentacledType;
31263182 };
31273183
3128-export type ParseUnion = ParseEnum | { [key: string]: mixed };
3129-
3130-export type ParseEnum =
3131- "auto";
3132-
31333184 /**
31343185 * Type of input data: `"json"`, `"csv"`, `"tsv"`.
31353186 * The default format type is determined by the extension of the file URL.
31363187 * If no extension is detected, `"json"` will be used by default.
31373188 */
3138-export type DataFormatType =
3139- "csv"
3140- | "tsv"
3141- | "json"
3142- | "topojson";
3189+export type TentacledType =
3190+ "topojson";
3191+
3192+export type InlineData = {
3193+ /**
3194+ * An object that specifies the format for parsing the data values.
3195+ */
3196+ format?: DataFormat;
3197+ /**
3198+ * The full data set, included inline. This can be an array of objects or primitive values
3199+ * or a string.
3200+ * Arrays of primitive values are ingested as objects with a `data` property. Strings are
3201+ * parsed according to the specified format type.
3202+ */
3203+ values: Values;
3204+};
31433205
31443206 /**
31453207 * The full data set, included inline. This can be an array of objects or primitive values
@@ -3151,6 +3213,17 @@ export type Values = ValuesValue[] | { [key: string]: mixed } | string;
31513213
31523214 export type ValuesValue = boolean | number | { [key: string]: mixed } | string;
31533215
3216+export type NamedData = {
3217+ /**
3218+ * An object that specifies the format for parsing the data.
3219+ */
3220+ format?: DataFormat;
3221+ /**
3222+ * Provide a placeholder name and bind data at runtime.
3223+ */
3224+ name: string;
3225+};
3226+
31543227 /**
31553228 * A key-value mapping between encoding channels and definition of fields.
31563229 */
@@ -3166,7 +3239,7 @@ export type EncodingWithFacet = {
31663239 * _Note:_ See the scale documentation for more information about customizing [color
31673240 * scheme](scale.html#scheme).
31683241 */
3169- color?: MarkPropDefWithCondition;
3242+ color?: Color;
31703243 /**
31713244 * Horizontal facets for trellis plots.
31723245 */
@@ -3179,14 +3252,14 @@ export type EncodingWithFacet = {
31793252 /**
31803253 * A URL to load upon mouse click.
31813254 */
3182- href?: DefWithCondition;
3255+ href?: Href;
31833256 /**
31843257 * Opacity of the marks – either can be a value or a range.
31853258 *
31863259 * __Default value:__ If undefined, the default opacity depends on [mark
31873260 * config](config.html#mark)'s `opacity` property.
31883261 */
3189- opacity?: MarkPropDefWithCondition;
3262+ opacity?: Color;
31903263 /**
31913264 * Stack order for stacked marks or order of data points in line marks for connected scatter
31923265 * plots.
@@ -3208,7 +3281,7 @@ export type EncodingWithFacet = {
32083281 * __Default value:__ If undefined, the default shape depends on [mark
32093282 * config](config.html#point-config)'s `shape` property.
32103283 */
3211- shape?: MarkPropDefWithCondition;
3284+ shape?: Color;
32123285 /**
32133286 * Size of the mark.
32143287 * - For `"point"`, `"square"` and `"circle"`, – the symbol size, or pixel area of the mark.
@@ -3216,31 +3289,31 @@ export type EncodingWithFacet = {
32163289 * - For `"text"` – the text's font size.
32173290 * - Size is currently unsupported for `"line"`, `"area"`, and `"rect"`.
32183291 */
3219- size?: MarkPropDefWithCondition;
3292+ size?: Color;
32203293 /**
32213294 * Text of the `text` mark.
32223295 */
3223- text?: TextDefWithCondition;
3296+ text?: Text;
32243297 /**
32253298 * The tooltip text to show upon mouse hover.
32263299 */
3227- tooltip?: TextDefWithCondition;
3300+ tooltip?: Text;
32283301 /**
32293302 * X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
32303303 */
3231- x?: XClass;
3304+ x?: X;
32323305 /**
32333306 * X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
32343307 */
3235- x2?: X2Class;
3308+ x2?: X2;
32363309 /**
32373310 * Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
32383311 */
3239- y?: XClass;
3312+ y?: X;
32403313 /**
32413314 * Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
32423315 */
3243- y2?: X2Class;
3316+ y2?: X2;
32443317 };
32453318
32463319 /**
@@ -3272,21 +3345,18 @@ export type EncodingWithFacet = {
32723345 * - For `"bar"` and `"tick"` – the bar and tick's size.
32733346 * - For `"text"` – the text's font size.
32743347 * - Size is currently unsupported for `"line"`, `"area"`, and `"rect"`.
3275- *
3348+ */
3349+export type Color = MarkPropFieldDefWithCondition | MarkPropValueDefWithCondition;
3350+
3351+/**
32763352 * A FieldDef with Condition<ValueDef>
32773353 * {
32783354 * condition: {value: ...},
32793355 * field: ...,
32803356 * ...
32813357 * }
3282- *
3283- * A ValueDef with Condition<ValueDef | FieldDef>
3284- * {
3285- * condition: {field: ...} | {value: ...},
3286- * value: ...,
3287- * }
32883358 */
3289-export type MarkPropDefWithCondition = {
3359+export type MarkPropFieldDefWithCondition = {
32903360 /**
32913361 * Aggregation function for the field
32923362 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -3308,10 +3378,8 @@ export type MarkPropDefWithCondition = {
33083378 * __Note:__ A field definition's `condition` property can only contain [value
33093379 * definitions](encoding.html#value-def)
33103380 * since Vega-Lite only allows at most one encoded field per encoding channel.
3311- *
3312- * A field definition or one or more value definition(s) with a selection predicate.
33133381 */
3314- condition?: ColorCondition;
3382+ condition?: ConditionUnion;
33153383 /**
33163384 * __Required.__ A string defining the name of the field from which to pull a data value
33173385 * or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -3362,11 +3430,7 @@ export type MarkPropDefWithCondition = {
33623430 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
33633431 * [geographic projection](projection.html) is applied.
33643432 */
3365- type?: Type;
3366- /**
3367- * A constant value in visual domain.
3368- */
3369- value?: ConditionalValueDefValue;
3433+ type: Type;
33703434 };
33713435
33723436 /**
@@ -3465,84 +3529,58 @@ export type BinParams = {
34653529 steps?: number[];
34663530 };
34673531
3468-export type ColorCondition = ConditionalValueDef[] | ConditionalPredicateMarkPropFieldDefClass;
3532+export type ConditionUnion = ConditionalValueDef[] | ConditionalPredicateValueDef | ConditionalSelectionValueDef;
34693533
3470-export type ConditionalValueDef = {
3471- test?: LogicalOperandPredicate;
3534+export type ConditionalValueDef = ConditionalPredicateValueDef | ConditionalSelectionValueDef;
3535+
3536+export type ConditionalPredicateValueDef = {
3537+ test: LogicalOperandPredicate;
34723538 /**
34733539 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
34743540 * `0` to `1` for opacity).
34753541 */
3476- value: ConditionalValueDefValue;
3477- /**
3478- * A [selection name](selection.html), or a series of [composed
3479- * selections](selection.html#compose).
3480- */
3481- selection?: SelectionOperand;
3542+ value: ConditionValue;
3543+};
3544+
3545+export type LogicalOrPredicate = {
3546+ or: LogicalOperandPredicate[];
3547+};
3548+
3549+export type LogicalAndPredicate = {
3550+ and: LogicalOperandPredicate[];
34823551 };
34833552
3484-export type Selection = {
3485- not?: SelectionOperand;
3486- and?: SelectionOperand[];
3487- or?: SelectionOperand[];
3553+export type LogicalNotPredicate = {
3554+ not: LogicalOperandPredicate;
34883555 };
34893556
34903557 /**
3491- * Filter using a selection name.
3492- *
3493- * A [selection name](selection.html), or a series of [composed
3494- * selections](selection.html#compose).
3558+ * The `filter` property must be one of the predicate definitions:
3559+ * (1) an [expression](types.html#expression) string,
3560+ * where `datum` can be used to refer to the current data object;
3561+ * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
3562+ * [range predicate](filter.html#range-predicate), [one-of
3563+ * predicate](filter.html#one-of-predicate);
3564+ * (3) a [selection predicate](filter.html#selection-predicate);
3565+ * or (4) a logical operand that combines (1), (2), or (3).
34953566 */
3496-export type SelectionOperand = Selection | string;
3567+export type LogicalOperandPredicate = LogicalNotPredicate | LogicalAndPredicate | LogicalOrPredicate | FieldEqualPredicate | FieldRangePredicate | FieldOneOfPredicate | SelectionPredicate | string;
34973568
3498-export type Predicate = {
3499- not?: LogicalOperandPredicate;
3500- and?: LogicalOperandPredicate[];
3501- or?: LogicalOperandPredicate[];
3569+export type FieldEqualPredicate = {
35023570 /**
35033571 * The value that the field should be equal to.
35043572 */
3505- equal?: Equal;
3573+ equal: Equal;
35063574 /**
35073575 * Field to be filtered.
3508- *
3509- * Field to be filtered
35103576 */
3511- field?: string;
3577+ field: string;
35123578 /**
35133579 * Time unit for the field to be filtered.
3514- *
3515- * time unit for the field to be filtered.
35163580 */
35173581 timeUnit?: TimeUnit;
3518- /**
3519- * An array of inclusive minimum and maximum values
3520- * for a field value of a data item to be included in the filtered data.
3521- */
3522- range?: RangeElement[];
3523- /**
3524- * A set of values that the `field`'s value should be a member of,
3525- * for a data item included in the filtered data.
3526- */
3527- oneOf?: Equal[];
3528- /**
3529- * Filter using a selection name.
3530- */
3531- selection?: SelectionOperand;
35323582 };
35333583
3534-/**
3535- * The `filter` property must be one of the predicate definitions:
3536- * (1) an [expression](types.html#expression) string,
3537- * where `datum` can be used to refer to the current data object;
3538- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
3539- * [range predicate](filter.html#range-predicate), [one-of
3540- * predicate](filter.html#one-of-predicate);
3541- * (3) a [selection predicate](filter.html#selection-predicate);
3542- * or (4) a logical operand that combines (1), (2), or (3).
3543- */
3544-export type LogicalOperandPredicate = Predicate | string;
3545-
35463584 /**
35473585 * The value that the field should be equal to.
35483586 */
@@ -3620,8 +3658,6 @@ export type Day = number | string;
36203658 */
36213659 export type Month = number | string;
36223660
3623-export type RangeElement = DateTime | number | null;
3624-
36253661 /**
36263662 * Time unit for the field to be filtered.
36273663 *
@@ -3680,92 +3716,86 @@ export type TimeUnit =
36803716 | "utcminutesseconds"
36813717 | "utcsecondsmilliseconds";
36823718
3683-/**
3684- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
3685- * `0` to `1` for opacity).
3686- *
3687- * A constant value in visual domain.
3688- */
3689-export type ConditionalValueDefValue = boolean | number | string;
3690-
3691-export type ConditionalPredicateMarkPropFieldDefClass = {
3692- test?: LogicalOperandPredicate;
3719+export type FieldRangePredicate = {
36933720 /**
3694- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
3695- * `0` to `1` for opacity).
3721+ * Field to be filtered
36963722 */
3697- value?: ConditionalValueDefValue;
3723+ field: string;
36983724 /**
3699- * A [selection name](selection.html), or a series of [composed
3700- * selections](selection.html#compose).
3725+ * An array of inclusive minimum and maximum values
3726+ * for a field value of a data item to be included in the filtered data.
37013727 */
3702- selection?: SelectionOperand;
3728+ range: RangeElement[];
37033729 /**
3704- * Aggregation function for the field
3705- * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
3706- *
3707- * __Default value:__ `undefined` (None)
3730+ * time unit for the field to be filtered.
37083731 */
3709- aggregate?: AggregateOp;
3710- /**
3711- * A flag for binning a `quantitative` field, or [an object defining binning
3712- * parameters](bin.html#params).
3713- * If `true`, default [binning parameters](bin.html) will be applied.
3714- *
3715- * __Default value:__ `false`
3716- */
3717- bin?: Bin;
3732+ timeUnit?: TimeUnit;
3733+};
3734+
3735+export type RangeElement = DateTime | number | null;
3736+
3737+export type FieldOneOfPredicate = {
37183738 /**
3719- * __Required.__ A string defining the name of the field from which to pull a data value
3720- * or an object defining iterated values from the [`repeat`](repeat.html) operator.
3721- *
3722- * __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
3723- * (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
3724- * If field names contain dots or brackets but are not nested, you can use `\\` to escape
3725- * dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
3726- * See more details about escaping in the [field documentation](field.html).
3727- *
3728- * __Note:__ `field` is not required if `aggregate` is `count`.
3739+ * Field to be filtered
37293740 */
3730- field?: Field;
3741+ field: string;
37313742 /**
3732- * An object defining properties of the legend.
3733- * If `null`, the legend for the encoding channel will be removed.
3734- *
3735- * __Default value:__ If undefined, default [legend properties](legend.html) are applied.
3743+ * A set of values that the `field`'s value should be a member of,
3744+ * for a data item included in the filtered data.
37363745 */
3737- legend?: Legend | null;
3746+ oneOf: Equal[];
37383747 /**
3739- * An object defining properties of the channel's scale, which is the function that
3740- * transforms values in the data domain (numbers, dates, strings, etc) to visual values
3741- * (pixels, colors, sizes) of the encoding channels.
3742- *
3743- * __Default value:__ If undefined, default [scale properties](scale.html) are applied.
3748+ * time unit for the field to be filtered.
37443749 */
3745- scale?: Scale;
3750+ timeUnit?: TimeUnit;
3751+};
3752+
3753+export type SelectionPredicate = {
37463754 /**
3747- * Sort order for the encoded field.
3748- * Supported `sort` values include `"ascending"`, `"descending"` and `null` (no sorting).
3749- * For fields with discrete domains, `sort` can also be a [sort field definition
3750- * object](sort.html#sort-field).
3751- *
3752- * __Default value:__ `"ascending"`
3755+ * Filter using a selection name.
37533756 */
3754- sort?: SortUnion;
3757+ selection: SelectionOperand;
3758+};
3759+
3760+export type SelectionOr = {
3761+ or: SelectionOperand[];
3762+};
3763+
3764+export type SelectionAnd = {
3765+ and: SelectionOperand[];
3766+};
3767+
3768+export type SelectionNot = {
3769+ not: SelectionOperand;
3770+};
3771+
3772+/**
3773+ * Filter using a selection name.
3774+ *
3775+ * A [selection name](selection.html), or a series of [composed
3776+ * selections](selection.html#compose).
3777+ */
3778+export type SelectionOperand = SelectionNot | SelectionAnd | SelectionOr | string;
3779+
3780+/**
3781+ * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
3782+ * `0` to `1` for opacity).
3783+ *
3784+ * A constant value in visual domain.
3785+ */
3786+export type ConditionValue = boolean | number | string;
3787+
3788+export type ConditionalSelectionValueDef = {
37553789 /**
3756- * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
3757- * or [a temporal field that gets casted as ordinal](type.html#cast).
3758- *
3759- * __Default value:__ `undefined` (None)
3790+ * A [selection name](selection.html), or a series of [composed
3791+ * selections](selection.html#compose).
37603792 */
3761- timeUnit?: TimeUnit;
3793+ selection: SelectionOperand;
37623794 /**
3763- * The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
3764- * `"nominal"`).
3765- * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
3766- * [geographic projection](projection.html) is applied.
3795+ * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
3796+ * `0` to `1` for opacity).
37673797 */
3768- type?: Type;
3798+ value: ConditionValue;
37693799 };
37703800
37713801 export type Field = RepeatRef | string;
@@ -4098,9 +4128,9 @@ export type Scale = {
40984128 * The `selection` property can be used to [interactively
40994129 * determine](selection.html#scale-domains) the scale domain.
41004130 */
4101-export type DomainUnion = Equal[] | DomainClass | Domain;
4131+export type DomainUnion = Equal[] | PurpleSelectionDomain | FluffySelectionDomain | Domain;
41024132
4103-export type DomainClass = {
4133+export type PurpleSelectionDomain = {
41044134 /**
41054135 * The field name to extract selected values for, when a selection is
41064136 * [projected](project.html)
@@ -4111,12 +4141,19 @@ export type DomainClass = {
41114141 * The name of a selection.
41124142 */
41134143 selection: string;
4144+};
4145+
4146+export type FluffySelectionDomain = {
41144147 /**
41154148 * The encoding channel to extract selected values for, when a selection is
41164149 * [projected](project.html)
41174150 * over multiple fields or encodings.
41184151 */
41194152 encoding?: string;
4153+ /**
4154+ * The name of a selection.
4155+ */
4156+ selection: string;
41204157 };
41214158
41224159 export type Domain =
@@ -4273,7 +4310,7 @@ export type ScaleType =
42734310 | "point"
42744311 | "band";
42754312
4276-export type SortUnion = SortField | SortEnum | null;
4313+export type SortUnion = SortField | SortOrderEnum | null;
42774314
42784315 export type SortField = {
42794316 /**
@@ -4297,10 +4334,10 @@ export type SortField = {
42974334 /**
42984335 * The sort order. One of `"ascending"` (default) or `"descending"`.
42994336 */
4300- order?: SortEnum | null;
4337+ order?: SortOrderEnum | null;
43014338 };
43024339
4303-export type SortEnum =
4340+export type SortOrderEnum =
43044341 "ascending"
43054342 | "descending";
43064343
@@ -4322,6 +4359,173 @@ export type Type =
43224359 | "longitude"
43234360 | "geojson";
43244361
4362+/**
4363+ * A ValueDef with Condition<ValueDef | FieldDef>
4364+ * {
4365+ * condition: {field: ...} | {value: ...},
4366+ * value: ...,
4367+ * }
4368+ */
4369+export type MarkPropValueDefWithCondition = {
4370+ /**
4371+ * A field definition or one or more value definition(s) with a selection predicate.
4372+ */
4373+ condition?: ColorCondition;
4374+ /**
4375+ * A constant value in visual domain.
4376+ */
4377+ value?: ConditionValue;
4378+};
4379+
4380+/**
4381+ * A field definition or one or more value definition(s) with a selection predicate.
4382+ */
4383+export type ColorCondition = ConditionalValueDef[] | ConditionalPredicateMarkPropFieldDef | ConditionalSelectionMarkPropFieldDef | ConditionalPredicateValueDef | ConditionalSelectionValueDef;
4384+
4385+export type ConditionalPredicateMarkPropFieldDef = {
4386+ /**
4387+ * Aggregation function for the field
4388+ * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4389+ *
4390+ * __Default value:__ `undefined` (None)
4391+ */
4392+ aggregate?: AggregateOp;
4393+ /**
4394+ * A flag for binning a `quantitative` field, or [an object defining binning
4395+ * parameters](bin.html#params).
4396+ * If `true`, default [binning parameters](bin.html) will be applied.
4397+ *
4398+ * __Default value:__ `false`
4399+ */
4400+ bin?: Bin;
4401+ /**
4402+ * __Required.__ A string defining the name of the field from which to pull a data value
4403+ * or an object defining iterated values from the [`repeat`](repeat.html) operator.
4404+ *
4405+ * __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4406+ * (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4407+ * If field names contain dots or brackets but are not nested, you can use `\\` to escape
4408+ * dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4409+ * See more details about escaping in the [field documentation](field.html).
4410+ *
4411+ * __Note:__ `field` is not required if `aggregate` is `count`.
4412+ */
4413+ field?: Field;
4414+ /**
4415+ * An object defining properties of the legend.
4416+ * If `null`, the legend for the encoding channel will be removed.
4417+ *
4418+ * __Default value:__ If undefined, default [legend properties](legend.html) are applied.
4419+ */
4420+ legend?: Legend | null;
4421+ /**
4422+ * An object defining properties of the channel's scale, which is the function that
4423+ * transforms values in the data domain (numbers, dates, strings, etc) to visual values
4424+ * (pixels, colors, sizes) of the encoding channels.
4425+ *
4426+ * __Default value:__ If undefined, default [scale properties](scale.html) are applied.
4427+ */
4428+ scale?: Scale;
4429+ /**
4430+ * Sort order for the encoded field.
4431+ * Supported `sort` values include `"ascending"`, `"descending"` and `null` (no sorting).
4432+ * For fields with discrete domains, `sort` can also be a [sort field definition
4433+ * object](sort.html#sort-field).
4434+ *
4435+ * __Default value:__ `"ascending"`
4436+ */
4437+ sort?: SortUnion;
4438+ test: LogicalOperandPredicate;
4439+ /**
4440+ * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4441+ * or [a temporal field that gets casted as ordinal](type.html#cast).
4442+ *
4443+ * __Default value:__ `undefined` (None)
4444+ */
4445+ timeUnit?: TimeUnit;
4446+ /**
4447+ * The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4448+ * `"nominal"`).
4449+ * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4450+ * [geographic projection](projection.html) is applied.
4451+ */
4452+ type: Type;
4453+};
4454+
4455+export type ConditionalSelectionMarkPropFieldDef = {
4456+ /**
4457+ * Aggregation function for the field
4458+ * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4459+ *
4460+ * __Default value:__ `undefined` (None)
4461+ */
4462+ aggregate?: AggregateOp;
4463+ /**
4464+ * A flag for binning a `quantitative` field, or [an object defining binning
4465+ * parameters](bin.html#params).
4466+ * If `true`, default [binning parameters](bin.html) will be applied.
4467+ *
4468+ * __Default value:__ `false`
4469+ */
4470+ bin?: Bin;
4471+ /**
4472+ * __Required.__ A string defining the name of the field from which to pull a data value
4473+ * or an object defining iterated values from the [`repeat`](repeat.html) operator.
4474+ *
4475+ * __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4476+ * (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4477+ * If field names contain dots or brackets but are not nested, you can use `\\` to escape
4478+ * dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4479+ * See more details about escaping in the [field documentation](field.html).
4480+ *
4481+ * __Note:__ `field` is not required if `aggregate` is `count`.
4482+ */
4483+ field?: Field;
4484+ /**
4485+ * An object defining properties of the legend.
4486+ * If `null`, the legend for the encoding channel will be removed.
4487+ *
4488+ * __Default value:__ If undefined, default [legend properties](legend.html) are applied.
4489+ */
4490+ legend?: Legend | null;
4491+ /**
4492+ * An object defining properties of the channel's scale, which is the function that
4493+ * transforms values in the data domain (numbers, dates, strings, etc) to visual values
4494+ * (pixels, colors, sizes) of the encoding channels.
4495+ *
4496+ * __Default value:__ If undefined, default [scale properties](scale.html) are applied.
4497+ */
4498+ scale?: Scale;
4499+ /**
4500+ * A [selection name](selection.html), or a series of [composed
4501+ * selections](selection.html#compose).
4502+ */
4503+ selection: SelectionOperand;
4504+ /**
4505+ * Sort order for the encoded field.
4506+ * Supported `sort` values include `"ascending"`, `"descending"` and `null` (no sorting).
4507+ * For fields with discrete domains, `sort` can also be a [sort field definition
4508+ * object](sort.html#sort-field).
4509+ *
4510+ * __Default value:__ `"ascending"`
4511+ */
4512+ sort?: SortUnion;
4513+ /**
4514+ * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4515+ * or [a temporal field that gets casted as ordinal](type.html#cast).
4516+ *
4517+ * __Default value:__ `undefined` (None)
4518+ */
4519+ timeUnit?: TimeUnit;
4520+ /**
4521+ * The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4522+ * `"nominal"`).
4523+ * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4524+ * [geographic projection](projection.html) is applied.
4525+ */
4526+ type: Type;
4527+};
4528+
43254529 /**
43264530 * Horizontal facets for trellis plots.
43274531 *
@@ -4364,7 +4568,7 @@ export type FacetFieldDef = {
43644568 * Sort order for a facet field.
43654569 * This can be `"ascending"`, `"descending"`.
43664570 */
4367- sort?: SortEnum | null;
4571+ sort?: SortOrderEnum | null;
43684572 /**
43694573 * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
43704574 * or [a temporal field that gets casted as ordinal](type.html#cast).
@@ -4474,21 +4678,18 @@ export type FieldDef = {
44744678
44754679 /**
44764680 * A URL to load upon mouse click.
4477- *
4681+ */
4682+export type Href = FieldDefWithCondition | ValueDefWithCondition;
4683+
4684+/**
44784685 * A FieldDef with Condition<ValueDef>
44794686 * {
44804687 * condition: {value: ...},
44814688 * field: ...,
44824689 * ...
44834690 * }
4484- *
4485- * A ValueDef with Condition<ValueDef | FieldDef>
4486- * {
4487- * condition: {field: ...} | {value: ...},
4488- * value: ...,
4489- * }
44904691 */
4491-export type DefWithCondition = {
4692+export type FieldDefWithCondition = {
44924693 /**
44934694 * Aggregation function for the field
44944695 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4510,10 +4711,8 @@ export type DefWithCondition = {
45104711 * __Note:__ A field definition's `condition` property can only contain [value
45114712 * definitions](encoding.html#value-def)
45124713 * since Vega-Lite only allows at most one encoded field per encoding channel.
4513- *
4514- * A field definition or one or more value definition(s) with a selection predicate.
45154714 */
4516- condition?: HrefCondition;
4715+ condition?: ConditionUnion;
45174716 /**
45184717 * __Required.__ A string defining the name of the field from which to pull a data value
45194718 * or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4540,27 +4739,79 @@ export type DefWithCondition = {
45404739 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
45414740 * [geographic projection](projection.html) is applied.
45424741 */
4543- type?: Type;
4742+ type: Type;
4743+};
4744+
4745+/**
4746+ * A ValueDef with Condition<ValueDef | FieldDef>
4747+ * {
4748+ * condition: {field: ...} | {value: ...},
4749+ * value: ...,
4750+ * }
4751+ */
4752+export type ValueDefWithCondition = {
4753+ /**
4754+ * A field definition or one or more value definition(s) with a selection predicate.
4755+ */
4756+ condition?: HrefCondition;
45444757 /**
45454758 * A constant value in visual domain.
45464759 */
4547- value?: ConditionalValueDefValue;
4760+ value?: ConditionValue;
45484761 };
45494762
4550-export type HrefCondition = ConditionalValueDef[] | ConditionalPredicateFieldDefClass;
4763+/**
4764+ * A field definition or one or more value definition(s) with a selection predicate.
4765+ */
4766+export type HrefCondition = ConditionalValueDef[] | ConditionalPredicateFieldDef | ConditionalSelectionFieldDef | ConditionalPredicateValueDef | ConditionalSelectionValueDef;
45514767
4552-export type ConditionalPredicateFieldDefClass = {
4553- test?: LogicalOperandPredicate;
4768+export type ConditionalPredicateFieldDef = {
45544769 /**
4555- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4556- * `0` to `1` for opacity).
4770+ * Aggregation function for the field
4771+ * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
4772+ *
4773+ * __Default value:__ `undefined` (None)
45574774 */
4558- value?: ConditionalValueDefValue;
4775+ aggregate?: AggregateOp;
45594776 /**
4560- * A [selection name](selection.html), or a series of [composed
4561- * selections](selection.html#compose).
4777+ * A flag for binning a `quantitative` field, or [an object defining binning
4778+ * parameters](bin.html#params).
4779+ * If `true`, default [binning parameters](bin.html) will be applied.
4780+ *
4781+ * __Default value:__ `false`
4782+ */
4783+ bin?: Bin;
4784+ /**
4785+ * __Required.__ A string defining the name of the field from which to pull a data value
4786+ * or an object defining iterated values from the [`repeat`](repeat.html) operator.
4787+ *
4788+ * __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
4789+ * (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
4790+ * If field names contain dots or brackets but are not nested, you can use `\\` to escape
4791+ * dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
4792+ * See more details about escaping in the [field documentation](field.html).
4793+ *
4794+ * __Note:__ `field` is not required if `aggregate` is `count`.
4795+ */
4796+ field?: Field;
4797+ test: LogicalOperandPredicate;
4798+ /**
4799+ * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
4800+ * or [a temporal field that gets casted as ordinal](type.html#cast).
4801+ *
4802+ * __Default value:__ `undefined` (None)
4803+ */
4804+ timeUnit?: TimeUnit;
4805+ /**
4806+ * The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4807+ * `"nominal"`).
4808+ * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4809+ * [geographic projection](projection.html) is applied.
45624810 */
4563- selection?: SelectionOperand;
4811+ type: Type;
4812+};
4813+
4814+export type ConditionalSelectionFieldDef = {
45644815 /**
45654816 * Aggregation function for the field
45664817 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4589,6 +4840,11 @@ export type ConditionalPredicateFieldDefClass = {
45894840 * __Note:__ `field` is not required if `aggregate` is `count`.
45904841 */
45914842 field?: Field;
4843+ /**
4844+ * A [selection name](selection.html), or a series of [composed
4845+ * selections](selection.html#compose).
4846+ */
4847+ selection: SelectionOperand;
45924848 /**
45934849 * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
45944850 * or [a temporal field that gets casted as ordinal](type.html#cast).
@@ -4602,7 +4858,7 @@ export type ConditionalPredicateFieldDefClass = {
46024858 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
46034859 * [geographic projection](projection.html) is applied.
46044860 */
4605- type?: Type;
4861+ type: Type;
46064862 };
46074863
46084864 export type Order = OrderFieldDef[] | OrderFieldDef;
@@ -4639,7 +4895,7 @@ export type OrderFieldDef = {
46394895 /**
46404896 * The sort order. One of `"ascending"` (default) or `"descending"`.
46414897 */
4642- sort?: SortEnum | null;
4898+ sort?: SortOrderEnum | null;
46434899 /**
46444900 * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
46454901 * or [a temporal field that gets casted as ordinal](type.html#cast).
@@ -4660,21 +4916,18 @@ export type OrderFieldDef = {
46604916 * Text of the `text` mark.
46614917 *
46624918 * The tooltip text to show upon mouse hover.
4663- *
4919+ */
4920+export type Text = TextFieldDefWithCondition | TextValueDefWithCondition;
4921+
4922+/**
46644923 * A FieldDef with Condition<ValueDef>
46654924 * {
46664925 * condition: {value: ...},
46674926 * field: ...,
46684927 * ...
46694928 * }
4670- *
4671- * A ValueDef with Condition<ValueDef | FieldDef>
4672- * {
4673- * condition: {field: ...} | {value: ...},
4674- * value: ...,
4675- * }
46764929 */
4677-export type TextDefWithCondition = {
4930+export type TextFieldDefWithCondition = {
46784931 /**
46794932 * Aggregation function for the field
46804933 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4696,10 +4949,8 @@ export type TextDefWithCondition = {
46964949 * __Note:__ A field definition's `condition` property can only contain [value
46974950 * definitions](encoding.html#value-def)
46984951 * since Vega-Lite only allows at most one encoded field per encoding channel.
4699- *
4700- * A field definition or one or more value definition(s) with a selection predicate.
47014952 */
4702- condition?: TextCondition;
4953+ condition?: ConditionUnion;
47034954 /**
47044955 * __Required.__ A string defining the name of the field from which to pull a data value
47054956 * or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4731,27 +4982,84 @@ export type TextDefWithCondition = {
47314982 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47324983 * [geographic projection](projection.html) is applied.
47334984 */
4734- type?: Type;
4985+ type: Type;
4986+};
4987+
4988+/**
4989+ * A ValueDef with Condition<ValueDef | FieldDef>
4990+ * {
4991+ * condition: {field: ...} | {value: ...},
4992+ * value: ...,
4993+ * }
4994+ */
4995+export type TextValueDefWithCondition = {
4996+ /**
4997+ * A field definition or one or more value definition(s) with a selection predicate.
4998+ */
4999+ condition?: TextCondition;
47355000 /**
47365001 * A constant value in visual domain.
47375002 */
4738- value?: ConditionalValueDefValue;
5003+ value?: ConditionValue;
47395004 };
47405005
4741-export type TextCondition = ConditionalValueDef[] | ConditionalPredicateTextFieldDefClass;
5006+/**
5007+ * A field definition or one or more value definition(s) with a selection predicate.
5008+ */
5009+export type TextCondition = ConditionalValueDef[] | ConditionalPredicateTextFieldDef | ConditionalSelectionTextFieldDef | ConditionalPredicateValueDef | ConditionalSelectionValueDef;
47425010
4743-export type ConditionalPredicateTextFieldDefClass = {
4744- test?: LogicalOperandPredicate;
5011+export type ConditionalPredicateTextFieldDef = {
47455012 /**
4746- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4747- * `0` to `1` for opacity).
5013+ * Aggregation function for the field
5014+ * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
5015+ *
5016+ * __Default value:__ `undefined` (None)
47485017 */
4749- value?: ConditionalValueDefValue;
5018+ aggregate?: AggregateOp;
47505019 /**
4751- * A [selection name](selection.html), or a series of [composed
4752- * selections](selection.html#compose).
5020+ * A flag for binning a `quantitative` field, or [an object defining binning
5021+ * parameters](bin.html#params).
5022+ * If `true`, default [binning parameters](bin.html) will be applied.
5023+ *
5024+ * __Default value:__ `false`
5025+ */
5026+ bin?: Bin;
5027+ /**
5028+ * __Required.__ A string defining the name of the field from which to pull a data value
5029+ * or an object defining iterated values from the [`repeat`](repeat.html) operator.
5030+ *
5031+ * __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
5032+ * (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
5033+ * If field names contain dots or brackets but are not nested, you can use `\\` to escape
5034+ * dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
5035+ * See more details about escaping in the [field documentation](field.html).
5036+ *
5037+ * __Note:__ `field` is not required if `aggregate` is `count`.
5038+ */
5039+ field?: Field;
5040+ /**
5041+ * The [formatting pattern](format.html) for a text field. If not defined, this will be
5042+ * determined automatically.
5043+ */
5044+ format?: string;
5045+ test: LogicalOperandPredicate;
5046+ /**
5047+ * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
5048+ * or [a temporal field that gets casted as ordinal](type.html#cast).
5049+ *
5050+ * __Default value:__ `undefined` (None)
5051+ */
5052+ timeUnit?: TimeUnit;
5053+ /**
5054+ * The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5055+ * `"nominal"`).
5056+ * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5057+ * [geographic projection](projection.html) is applied.
47535058 */
4754- selection?: SelectionOperand;
5059+ type: Type;
5060+};
5061+
5062+export type ConditionalSelectionTextFieldDef = {
47555063 /**
47565064 * Aggregation function for the field
47575065 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4785,6 +5093,11 @@ export type ConditionalPredicateTextFieldDefClass = {
47855093 * determined automatically.
47865094 */
47875095 format?: string;
5096+ /**
5097+ * A [selection name](selection.html), or a series of [composed
5098+ * selections](selection.html#compose).
5099+ */
5100+ selection: SelectionOperand;
47885101 /**
47895102 * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
47905103 * or [a temporal field that gets casted as ordinal](type.html#cast).
@@ -4798,17 +5111,17 @@ export type ConditionalPredicateTextFieldDefClass = {
47985111 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47995112 * [geographic projection](projection.html) is applied.
48005113 */
4801- type?: Type;
5114+ type: Type;
48025115 };
48035116
48045117 /**
48055118 * X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
48065119 *
48075120 * Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
4808- *
4809- * Definition object for a constant value of an encoding channel.
48105121 */
4811-export type XClass = {
5122+export type X = PositionFieldDef | ValueDef;
5123+
5124+export type PositionFieldDef = {
48125125 /**
48135126 * Aggregation function for the field
48145127 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4897,12 +5210,7 @@ export type XClass = {
48975210 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
48985211 * [geographic projection](projection.html) is applied.
48995212 */
4900- type?: Type;
4901- /**
4902- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4903- * `0` to `1` for opacity).
4904- */
4905- value?: ConditionalValueDefValue;
5213+ type: Type;
49065214 };
49075215
49085216 export type Axis = {
@@ -5074,308 +5382,833 @@ export type Axis = {
50745382
50755383 export type AxisValue = DateTime | number;
50765384
5385+/**
5386+ * Definition object for a constant value of an encoding channel.
5387+ */
5388+export type ValueDef = {
5389+ /**
5390+ * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5391+ * `0` to `1` for opacity).
5392+ */
5393+ value: ConditionValue;
5394+};
5395+
50775396 /**
50785397 * X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
50795398 *
50805399 * Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
5081- *
5082- * Definition object for a data field, its type and transformation of an encoding channel.
5083- *
5084- * Definition object for a constant value of an encoding channel.
50855400 */
5086-export type X2Class = {
5401+export type X2 = FieldDef | ValueDef;
5402+
5403+/**
5404+ * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
5405+ * `"line"`,
5406+ * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
5407+ * object](mark.html#mark-def).
5408+ */
5409+export type AnyMark = MarkDef | Mark;
5410+
5411+export type MarkDef = {
50875412 /**
5088- * Aggregation function for the field
5089- * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
5090- *
5091- * __Default value:__ `undefined` (None)
5413+ * The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
50925414 */
5093- aggregate?: AggregateOp;
5415+ align?: HorizontalAlign;
50945416 /**
5095- * A flag for binning a `quantitative` field, or [an object defining binning
5096- * parameters](bin.html#params).
5097- * If `true`, default [binning parameters](bin.html) will be applied.
5098- *
5099- * __Default value:__ `false`
5417+ * The rotation angle of the text, in degrees.
51005418 */
5101- bin?: Bin;
5419+ angle?: number;
51025420 /**
5103- * __Required.__ A string defining the name of the field from which to pull a data value
5104- * or an object defining iterated values from the [`repeat`](repeat.html) operator.
5105- *
5106- * __Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects
5107- * (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
5108- * If field names contain dots or brackets but are not nested, you can use `\\` to escape
5109- * dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
5110- * See more details about escaping in the [field documentation](field.html).
5421+ * The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
51115422 *
5112- * __Note:__ `field` is not required if `aggregate` is `count`.
5423+ * __Default value:__ `"middle"`
51135424 */
5114- field?: Field;
5425+ baseline?: VerticalAlign;
51155426 /**
5116- * Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.
5117- * or [a temporal field that gets casted as ordinal](type.html#cast).
5118- *
5119- * __Default value:__ `undefined` (None)
5427+ * Whether a mark be clipped to the enclosing group’s width and height.
51205428 */
5121- timeUnit?: TimeUnit;
5429+ clip?: boolean;
51225430 /**
5123- * The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5124- * `"nominal"`).
5125- * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5126- * [geographic projection](projection.html) is applied.
5431+ * Default color. Note that `fill` and `stroke` have higher precedence than `color` and
5432+ * will override `color`.
5433+ *
5434+ * __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
5435+ *
5436+ * __Note:__ This property cannot be used in a [style config](mark.html#style-config).
51275437 */
5128- type?: Type;
5438+ color?: string;
51295439 /**
5130- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5131- * `0` to `1` for opacity).
5440+ * The mouse cursor used over the mark. Any valid [CSS cursor
5441+ * type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
51325442 */
5133- value?: ConditionalValueDefValue;
5134-};
5135-
5136-/**
5137- * An object that describes mappings between `row` and `column` channels and their field
5138- * definitions.
5139- */
5140-export type FacetMapping = {
5443+ cursor?: Cursor;
51415444 /**
5142- * Horizontal facets for trellis plots.
5445+ * The horizontal offset, in pixels, between the text label and its anchor point. The offset
5446+ * is applied after rotation by the _angle_ property.
51435447 */
5144- column?: FacetFieldDef;
5448+ dx?: number;
51455449 /**
5146- * Vertical facets for trellis plots.
5450+ * The vertical offset, in pixels, between the text label and its anchor point. The offset
5451+ * is applied after rotation by the _angle_ property.
51475452 */
5148- row?: FacetFieldDef;
5149-};
5150-
5151-/**
5152- * Unit spec that can have a composite mark.
5153- */
5154-export type Spec = {
5155- /**
5156- * An object describing the data source
5157- */
5158- data?: Data;
5453+ dy?: number;
51595454 /**
5160- * Description of this mark for commenting purpose.
5455+ * Default Fill Color. This has higher precedence than config.color
5456+ *
5457+ * __Default value:__ (None)
51615458 */
5162- description?: string;
5459+ fill?: string;
51635460 /**
5164- * The height of a visualization.
5461+ * Whether the mark's color should be used as fill color instead of stroke color.
51655462 *
5166- * __Default value:__
5167- * - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
5168- * [continuous scale](scale.html#continuous), the height will be the value of
5169- * [`config.view.height`](spec.html#config).
5170- * - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
5171- * value or unspecified, the height is [determined by the range step, paddings, and the
5172- * cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
5173- * `rangeStep` is `null`, the height will be the value of
5174- * [`config.view.height`](spec.html#config).
5175- * - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
5463+ * __Default value:__ `true` for all marks except `point` and `false` for `point`.
51765464 *
5177- * __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
5178- * represents the height of a single view.
5465+ * __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
51795466 *
5180- * __See also:__ The documentation for [width and height](size.html) contains more examples.
5467+ * __Note:__ This property cannot be used in a [style config](mark.html#style-config).
51815468 */
5182- height?: number;
5469+ filled?: boolean;
51835470 /**
5184- * Layer or single view specifications to be layered.
5471+ * The fill opacity (value between [0,1]).
51855472 *
5186- * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
5187- * layering facet specifications is not allowed.
5473+ * __Default value:__ `1`
51885474 */
5189- layer?: LayerSpec[];
5475+ fillOpacity?: number;
51905476 /**
5191- * Name of the visualization for later reference.
5477+ * The typeface to set the text in (e.g., `"Helvetica Neue"`).
51925478 */
5193- name?: string;
5479+ font?: string;
51945480 /**
5195- * Scale, axis, and legend resolutions for layers.
5196- *
5197- * Scale, axis, and legend resolutions for facets.
5198- *
5199- * Scale and legend resolutions for repeated charts.
5200- *
5201- * Scale, axis, and legend resolutions for vertically concatenated charts.
5202- *
5203- * Scale, axis, and legend resolutions for horizontally concatenated charts.
5481+ * The font size, in pixels.
52045482 */
5205- resolve?: Resolve;
5483+ fontSize?: number;
52065484 /**
5207- * Title for the plot.
5485+ * The font style (e.g., `"italic"`).
52085486 */
5209- title?: Title;
5487+ fontStyle?: FontStyle;
52105488 /**
5211- * An array of data transformations such as filter and new field calculation.
5489+ * The font weight (e.g., `"bold"`).
52125490 */
5213- transform?: Transform[];
5491+ fontWeight?: FontWeightUnion;
52145492 /**
5215- * The width of a visualization.
5216- *
5217- * __Default value:__ This will be determined by the following rules:
5218- *
5219- * - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
5220- * [continuous scale](scale.html#continuous), the width will be the value of
5221- * [`config.view.width`](spec.html#config).
5222- * - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
5223- * value or unspecified, the width is [determined by the range step, paddings, and the
5224- * cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
5225- * `rangeStep` is `null`, the width will be the value of
5226- * [`config.view.width`](spec.html#config).
5227- * - If no field is mapped to `x` channel, the `width` will be the value of
5228- * [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
5229- * the value of `rangeStep` for other marks.
5230- *
5231- * __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
5232- * represents the width of a single view.
5233- *
5234- * __See also:__ The documentation for [width and height](size.html) contains more examples.
5493+ * A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
52355494 */
5236- width?: number;
5495+ href?: string;
52375496 /**
5238- * A key-value mapping between encoding channels and definition of fields.
5497+ * The line interpolation method to use for line and area marks. One of the following:
5498+ * - `"linear"`: piecewise linear segments, as in a polyline.
5499+ * - `"linear-closed"`: close the linear segments to form a polygon.
5500+ * - `"step"`: alternate between horizontal and vertical segments, as in a step function.
5501+ * - `"step-before"`: alternate between vertical and horizontal segments, as in a step
5502+ * function.
5503+ * - `"step-after"`: alternate between horizontal and vertical segments, as in a step
5504+ * function.
5505+ * - `"basis"`: a B-spline, with control point duplication on the ends.
5506+ * - `"basis-open"`: an open B-spline; may not intersect the start or end.
5507+ * - `"basis-closed"`: a closed B-spline, as in a loop.
5508+ * - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
5509+ * - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
5510+ * will intersect other control points.
5511+ * - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
5512+ * - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
5513+ * spline.
5514+ * - `"monotone"`: cubic interpolation that preserves monotonicity in y.
52395515 */
5240- encoding?: Encoding;
5516+ interpolate?: Interpolate;
52415517 /**
5242- * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
5243- * `"line"`,
5244- * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
5245- * object](mark.html#mark-def).
5518+ * The maximum length of the text mark in pixels (default 0, indicating no limit). The text
5519+ * value will be automatically truncated if the rendered size exceeds the limit.
52465520 */
5247- mark?: AnyMark;
5521+ limit?: number;
52485522 /**
5249- * An object defining properties of geographic projection.
5523+ * The overall opacity (value between [0,1]).
52505524 *
5251- * Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
5252- * more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
5253- */
5254- projection?: Projection;
5255- /**
5256- * A key-value mapping between selection names and definitions.
5257- */
5258- selection?: { [key: string]: SelectionDef };
5259- /**
5260- * An object that describes mappings between `row` and `column` channels and their field
5261- * definitions.
5525+ * __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
5526+ * `square` marks or layered `bar` charts and `1` otherwise.
52625527 */
5263- facet?: FacetMapping;
5528+ opacity?: number;
52645529 /**
5265- * A specification of the view that gets faceted.
5530+ * The orientation of a non-stacked bar, tick, area, and line charts.
5531+ * The value is either horizontal (default) or vertical.
5532+ * - For bar, rule and tick, this determines whether the size of the bar and tick
5533+ * should be applied to x or y dimension.
5534+ * - For area, this property determines the orient property of the Vega output.
5535+ * - For line, this property determines the sort order of the points in the line
5536+ * if `config.sortLineBy` is not specified.
5537+ * For stacked charts, this is always determined by the orientation of the stack;
5538+ * therefore explicitly specified value will be ignored.
52665539 */
5267- spec?: Spec;
5540+ orient?: Orient;
52685541 /**
5269- * An object that describes what fields should be repeated into views that are laid out as a
5270- * `row` or `column`.
5542+ * Polar coordinate radial offset, in pixels, of the text label from the origin determined
5543+ * by the `x` and `y` properties.
52715544 */
5272- repeat?: Repeat;
5545+ radius?: number;
52735546 /**
5274- * A list of views that should be concatenated and put into a column.
5547+ * The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
5548+ * `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
5549+ *
5550+ * __Default value:__ `"circle"`
52755551 */
5276- vconcat?: Spec[];
5552+ shape?: string;
52775553 /**
5278- * A list of views that should be concatenated and put into a row.
5554+ * The pixel area each the point/circle/square.
5555+ * For example: in the case of circles, the radius is determined in part by the square root
5556+ * of the size value.
5557+ *
5558+ * __Default value:__ `30`
52795559 */
5280- hconcat?: Spec[];
5281-};
5282-
5283-/**
5284- * A key-value mapping between encoding channels and definition of fields.
5285- */
5286-export type Encoding = {
5560+ size?: number;
52875561 /**
5288- * Color of the marks – either fill or stroke color based on mark type.
5289- * By default, `color` represents fill color for `"area"`, `"bar"`, `"tick"`,
5290- * `"text"`, `"circle"`, and `"square"` / stroke color for `"line"` and `"point"`.
5291- *
5292- * __Default value:__ If undefined, the default color depends on [mark
5293- * config](config.html#mark)'s `color` property.
5562+ * Default Stroke Color. This has higher precedence than config.color
52945563 *
5295- * _Note:_ See the scale documentation for more information about customizing [color
5296- * scheme](scale.html#scheme).
5564+ * __Default value:__ (None)
52975565 */
5298- color?: MarkPropDefWithCondition;
5566+ stroke?: string;
52995567 /**
5300- * Additional levels of detail for grouping data in aggregate views and
5301- * in line and area marks without mapping data to a specific visual channel.
5568+ * An array of alternating stroke, space lengths for creating dashed or dotted lines.
53025569 */
5303- detail?: Detail;
5570+ strokeDash?: number[];
53045571 /**
5305- * A URL to load upon mouse click.
5572+ * The offset (in pixels) into which to begin drawing with the stroke dash array.
53065573 */
5307- href?: DefWithCondition;
5574+ strokeDashOffset?: number;
53085575 /**
5309- * Opacity of the marks – either can be a value or a range.
5576+ * The stroke opacity (value between [0,1]).
53105577 *
5311- * __Default value:__ If undefined, the default opacity depends on [mark
5312- * config](config.html#mark)'s `opacity` property.
5578+ * __Default value:__ `1`
53135579 */
5314- opacity?: MarkPropDefWithCondition;
5580+ strokeOpacity?: number;
53155581 /**
5316- * Stack order for stacked marks or order of data points in line marks for connected scatter
5317- * plots.
5318- *
5319- * __Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating
5320- * additional aggregation grouping.
5582+ * The stroke width, in pixels.
53215583 */
5322- order?: Order;
5584+ strokeWidth?: number;
53235585 /**
5324- * For `point` marks the supported values are
5325- * `"circle"` (default), `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`,
5326- * or `"triangle-down"`, or else a custom SVG path string.
5327- * For `geoshape` marks it should be a field definition of the geojson data
5586+ * A string or array of strings indicating the name of custom styles to apply to the mark. A
5587+ * style is a named collection of mark property defaults defined within the [style
5588+ * configuration](mark.html#style-config). If style is an array, later styles will override
5589+ * earlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within
5590+ * the `encoding` will override a style default.
53285591 *
5329- * __Default value:__ If undefined, the default shape depends on [mark
5330- * config](config.html#point-config)'s `shape` property.
5331- */
5332- shape?: MarkPropDefWithCondition;
5333- /**
5334- * Size of the mark.
5335- * - For `"point"`, `"square"` and `"circle"`, – the symbol size, or pixel area of the mark.
5336- * - For `"bar"` and `"tick"` – the bar and tick's size.
5337- * - For `"text"` – the text's font size.
5338- * - Size is currently unsupported for `"line"`, `"area"`, and `"rect"`.
5339- */
5340- size?: MarkPropDefWithCondition;
5341- /**
5342- * Text of the `text` mark.
5343- */
5344- text?: TextDefWithCondition;
5345- /**
5346- * The tooltip text to show upon mouse hover.
5592+ * __Default value:__ The mark's name. For example, a bar mark will have style `"bar"` by
5593+ * default.
5594+ * __Note:__ Any specified style will augment the default style. For example, a bar mark
5595+ * with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
5596+ * specified style `"foo"` has higher precedence).
53475597 */
5348- tooltip?: TextDefWithCondition;
5598+ style?: Style;
53495599 /**
5350- * X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
5600+ * Depending on the interpolation type, sets the tension parameter (for line and area marks).
53515601 */
5352- x?: XClass;
5602+ tension?: number;
53535603 /**
5354- * X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
5604+ * Placeholder text if the `text` channel is not specified
53555605 */
5356- x2?: X2Class;
5606+ text?: string;
53575607 /**
5358- * Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
5608+ * Polar coordinate angle, in radians, of the text label from the origin determined by the
5609+ * `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
5610+ * `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
5611+ * indicating "north".
53595612 */
5360- y?: XClass;
5613+ theta?: number;
53615614 /**
5362- * Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
5615+ * The mark type.
5616+ * One of `"bar"`, `"circle"`, `"square"`, `"tick"`, `"line"`,
5617+ * `"area"`, `"point"`, `"geoshape"`, `"rule"`, and `"text"`.
53635618 */
5364- y2?: X2Class;
5619+ type: Mark;
53655620 };
53665621
53675622 /**
5368- * Unit spec that can have a composite mark.
5369- */
5370-export type LayerSpec = {
5371- /**
5372- * An object describing the data source
5373- */
5374- data?: Data;
5375- /**
5376- * Description of this mark for commenting purpose.
5377- */
5378- description?: string;
5623+ * A string or array of strings indicating the name of custom styles to apply to the mark. A
5624+ * style is a named collection of mark property defaults defined within the [style
5625+ * configuration](mark.html#style-config). If style is an array, later styles will override
5626+ * earlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within
5627+ * the `encoding` will override a style default.
5628+ *
5629+ * __Default value:__ The mark's name. For example, a bar mark will have style `"bar"` by
5630+ * default.
5631+ * __Note:__ Any specified style will augment the default style. For example, a bar mark
5632+ * with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
5633+ * specified style `"foo"` has higher precedence).
5634+ *
5635+ * A [mark style property](config.html#style) to apply to the title text mark.
5636+ *
5637+ * __Default value:__ `"group-title"`.
5638+ *
5639+ * The field or fields for storing the computed formula value.
5640+ * If `from.fields` is specified, the transform will use the same names for `as`.
5641+ * If `from.fields` is not specified, `as` has to be a string and we put the whole object
5642+ * into the data under the specified name.
5643+ */
5644+export type Style = string[] | string;
5645+
5646+/**
5647+ * All types of primitive marks.
5648+ *
5649+ * The mark type.
5650+ * One of `"bar"`, `"circle"`, `"square"`, `"tick"`, `"line"`,
5651+ * `"area"`, `"point"`, `"geoshape"`, `"rule"`, and `"text"`.
5652+ */
5653+export type Mark =
5654+ "area"
5655+ | "bar"
5656+ | "line"
5657+ | "point"
5658+ | "text"
5659+ | "tick"
5660+ | "rect"
5661+ | "rule"
5662+ | "circle"
5663+ | "square"
5664+ | "geoshape";
5665+
5666+/**
5667+ * An object defining properties of geographic projection.
5668+ *
5669+ * Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
5670+ * more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
5671+ */
5672+export type Projection = {
5673+ /**
5674+ * Sets the projection’s center to the specified center, a two-element array of longitude
5675+ * and latitude in degrees.
5676+ *
5677+ * __Default value:__ `[0, 0]`
5678+ */
5679+ center?: number[];
5680+ /**
5681+ * Sets the projection’s clipping circle radius to the specified angle in degrees. If
5682+ * `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
5683+ * than small-circle clipping.
5684+ */
5685+ clipAngle?: number;
5686+ /**
5687+ * Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
5688+ * bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
5689+ * the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
5690+ * viewport clipping is performed.
5691+ */
5692+ clipExtent?: Array<number[]>;
5693+ coefficient?: number;
5694+ distance?: number;
5695+ fraction?: number;
5696+ lobes?: number;
5697+ parallel?: number;
5698+ /**
5699+ * Sets the threshold for the projection’s [adaptive
5700+ * resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
5701+ * value corresponds to the [Douglas–Peucker
5702+ * distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
5703+ * If precision is not specified, returns the projection’s current resampling precision
5704+ * which defaults to `√0.5 ≅ 0.70710…`.
5705+ */
5706+ precision?: FluffyPrecision;
5707+ radius?: number;
5708+ ratio?: number;
5709+ /**
5710+ * Sets the projection’s three-axis rotation to the specified angles, which must be a two-
5711+ * or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
5712+ * angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
5713+ *
5714+ * __Default value:__ `[0, 0, 0]`
5715+ */
5716+ rotate?: number[];
5717+ spacing?: number;
5718+ tilt?: number;
5719+ /**
5720+ * The cartographic projection to use. This value is case-insensitive, for example
5721+ * `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
5722+ * projection types [in the
5723+ * documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
5724+ *
5725+ * __Default value:__ `mercator`
5726+ */
5727+ type?: VGProjectionType;
5728+};
5729+
5730+/**
5731+ * Sets the threshold for the projection’s [adaptive
5732+ * resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
5733+ * value corresponds to the [Douglas–Peucker
5734+ * distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
5735+ * If precision is not specified, returns the projection’s current resampling precision
5736+ * which defaults to `√0.5 ≅ 0.70710…`.
5737+ */
5738+export type FluffyPrecision = {
5739+ /**
5740+ * Returns the length of a String object.
5741+ */
5742+ length: number;
5743+ [property: string]: string;
5744+};
5745+
5746+export type SelectionDef = SingleSelection | MultiSelection | IntervalSelection;
5747+
5748+export type SingleSelection = {
5749+ /**
5750+ * Establish a two-way binding between a single selection and input elements
5751+ * (also known as dynamic query widgets). A binding takes the form of
5752+ * Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)
5753+ * or can be a mapping between projected field/encodings and binding definitions.
5754+ *
5755+ * See the [bind transform](bind.html) documentation for more information.
5756+ */
5757+ bind?: { [key: string]: VGBinding };
5758+ /**
5759+ * By default, all data values are considered to lie within an empty selection.
5760+ * When set to `none`, empty selections contain no data values.
5761+ */
5762+ empty?: Empty;
5763+ /**
5764+ * An array of encoding channels. The corresponding data field values
5765+ * must match for a data tuple to fall within the selection.
5766+ */
5767+ encodings?: SingleDefChannel[];
5768+ /**
5769+ * An array of field names whose values must match for a data tuple to
5770+ * fall within the selection.
5771+ */
5772+ fields?: string[];
5773+ /**
5774+ * When true, an invisible voronoi diagram is computed to accelerate discrete
5775+ * selection. The data value _nearest_ the mouse cursor is added to the selection.
5776+ *
5777+ * See the [nearest transform](nearest.html) documentation for more information.
5778+ */
5779+ nearest?: boolean;
5780+ /**
5781+ * A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
5782+ * selector) that triggers the selection.
5783+ * For interval selections, the event stream must specify a [start and
5784+ * end](https://vega.github.io/vega/docs/event-streams/#between-filters).
5785+ */
5786+ on?: mixed;
5787+ /**
5788+ * With layered and multi-view displays, a strategy that determines how
5789+ * selections' data queries are resolved when applied in a filter transform,
5790+ * conditional encoding rule, or scale domain.
5791+ */
5792+ resolve?: SelectionResolution;
5793+ type: StickyType;
5794+};
5795+
5796+export type StickyType =
5797+ "single";
5798+
5799+export type MultiSelection = {
5800+ /**
5801+ * By default, all data values are considered to lie within an empty selection.
5802+ * When set to `none`, empty selections contain no data values.
5803+ */
5804+ empty?: Empty;
5805+ /**
5806+ * An array of encoding channels. The corresponding data field values
5807+ * must match for a data tuple to fall within the selection.
5808+ */
5809+ encodings?: SingleDefChannel[];
5810+ /**
5811+ * An array of field names whose values must match for a data tuple to
5812+ * fall within the selection.
5813+ */
5814+ fields?: string[];
5815+ /**
5816+ * When true, an invisible voronoi diagram is computed to accelerate discrete
5817+ * selection. The data value _nearest_ the mouse cursor is added to the selection.
5818+ *
5819+ * See the [nearest transform](nearest.html) documentation for more information.
5820+ */
5821+ nearest?: boolean;
5822+ /**
5823+ * A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
5824+ * selector) that triggers the selection.
5825+ * For interval selections, the event stream must specify a [start and
5826+ * end](https://vega.github.io/vega/docs/event-streams/#between-filters).
5827+ */
5828+ on?: mixed;
5829+ /**
5830+ * With layered and multi-view displays, a strategy that determines how
5831+ * selections' data queries are resolved when applied in a filter transform,
5832+ * conditional encoding rule, or scale domain.
5833+ */
5834+ resolve?: SelectionResolution;
5835+ /**
5836+ * Controls whether data values should be toggled or only ever inserted into
5837+ * multi selections. Can be `true`, `false` (for insertion only), or a
5838+ * [Vega expression](https://vega.github.io/vega/docs/expressions/).
5839+ *
5840+ * __Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,
5841+ * data values are toggled when a user interacts with the shift-key pressed).
5842+ *
5843+ * See the [toggle transform](toggle.html) documentation for more information.
5844+ */
5845+ toggle?: Translate;
5846+ type: IndigoType;
5847+};
5848+
5849+export type IndigoType =
5850+ "multi";
5851+
5852+export type IntervalSelection = {
5853+ /**
5854+ * Establishes a two-way binding between the interval selection and the scales
5855+ * used within the same view. This allows a user to interactively pan and
5856+ * zoom the view.
5857+ */
5858+ bind?: Bind;
5859+ /**
5860+ * By default, all data values are considered to lie within an empty selection.
5861+ * When set to `none`, empty selections contain no data values.
5862+ */
5863+ empty?: Empty;
5864+ /**
5865+ * An array of encoding channels. The corresponding data field values
5866+ * must match for a data tuple to fall within the selection.
5867+ */
5868+ encodings?: SingleDefChannel[];
5869+ /**
5870+ * An array of field names whose values must match for a data tuple to
5871+ * fall within the selection.
5872+ */
5873+ fields?: string[];
5874+ /**
5875+ * An interval selection also adds a rectangle mark to depict the
5876+ * extents of the interval. The `mark` property can be used to customize the
5877+ * appearance of the mark.
5878+ */
5879+ mark?: BrushConfig;
5880+ /**
5881+ * A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
5882+ * selector) that triggers the selection.
5883+ * For interval selections, the event stream must specify a [start and
5884+ * end](https://vega.github.io/vega/docs/event-streams/#between-filters).
5885+ */
5886+ on?: mixed;
5887+ /**
5888+ * With layered and multi-view displays, a strategy that determines how
5889+ * selections' data queries are resolved when applied in a filter transform,
5890+ * conditional encoding rule, or scale domain.
5891+ */
5892+ resolve?: SelectionResolution;
5893+ /**
5894+ * When truthy, allows a user to interactively move an interval selection
5895+ * back-and-forth. Can be `true`, `false` (to disable panning), or a
5896+ * [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)
5897+ * which must include a start and end event to trigger continuous panning.
5898+ *
5899+ * __Default value:__ `true`, which corresponds to
5900+ * `[mousedown, window:mouseup] > window:mousemove!` which corresponds to
5901+ * clicks and dragging within an interval selection to reposition it.
5902+ */
5903+ translate?: Translate;
5904+ type: IndecentType;
5905+ /**
5906+ * When truthy, allows a user to interactively resize an interval selection.
5907+ * Can be `true`, `false` (to disable zooming), or a [Vega event stream
5908+ * definition](https://vega.github.io/vega/docs/event-streams/). Currently,
5909+ * only `wheel` events are supported.
5910+ *
5911+ *
5912+ * __Default value:__ `true`, which corresponds to `wheel!`.
5913+ */
5914+ zoom?: Translate;
5915+};
5916+
5917+export type IndecentType =
5918+ "interval";
5919+
5920+export type Title = TitleParams | string;
5921+
5922+export type TitleParams = {
5923+ /**
5924+ * The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
5925+ * example, with an orientation of top these anchor positions map to a left-, center-, or
5926+ * right-aligned title.
5927+ *
5928+ * __Default value:__ `"middle"` for [single](spec.html) and [layered](layer.html) views.
5929+ * `"start"` for other composite views.
5930+ *
5931+ * __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
5932+ * customizable only for [single](spec.html) and [layered](layer.html) views. For other
5933+ * composite views, `anchor` is always `"start"`.
5934+ */
5935+ anchor?: Anchor;
5936+ /**
5937+ * The orthogonal offset in pixels by which to displace the title from its position along
5938+ * the edge of the chart.
5939+ */
5940+ offset?: number;
5941+ /**
5942+ * The orientation of the title relative to the chart. One of `"top"` (the default),
5943+ * `"bottom"`, `"left"`, or `"right"`.
5944+ */
5945+ orient?: TitleOrient;
5946+ /**
5947+ * A [mark style property](config.html#style) to apply to the title text mark.
5948+ *
5949+ * __Default value:__ `"group-title"`.
5950+ */
5951+ style?: Style;
5952+ /**
5953+ * The title text.
5954+ */
5955+ text: string;
5956+};
5957+
5958+export type Transform = FilterTransform | CalculateTransform | LookupTransform | BinTransform | TimeUnitTransform | AggregateTransform;
5959+
5960+export type FilterTransform = {
5961+ /**
5962+ * The `filter` property must be one of the predicate definitions:
5963+ * (1) an [expression](types.html#expression) string,
5964+ * where `datum` can be used to refer to the current data object;
5965+ * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
5966+ * [range predicate](filter.html#range-predicate), [one-of
5967+ * predicate](filter.html#one-of-predicate);
5968+ * (3) a [selection predicate](filter.html#selection-predicate);
5969+ * or (4) a logical operand that combines (1), (2), or (3).
5970+ */
5971+ filter: LogicalOperandPredicate;
5972+};
5973+
5974+export type CalculateTransform = {
5975+ /**
5976+ * The field for storing the computed formula value.
5977+ */
5978+ as: string;
5979+ /**
5980+ * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
5981+ * current data object.
5982+ */
5983+ calculate: string;
5984+};
5985+
5986+export type LookupTransform = {
5987+ /**
5988+ * The field or fields for storing the computed formula value.
5989+ * If `from.fields` is specified, the transform will use the same names for `as`.
5990+ * If `from.fields` is not specified, `as` has to be a string and we put the whole object
5991+ * into the data under the specified name.
5992+ */
5993+ as?: Style;
5994+ /**
5995+ * The default value to use if lookup fails.
5996+ *
5997+ * __Default value:__ `null`
5998+ */
5999+ default?: string;
6000+ /**
6001+ * Secondary data reference.
6002+ */
6003+ from: LookupData;
6004+ /**
6005+ * Key in primary data source.
6006+ */
6007+ lookup: string;
6008+};
6009+
6010+/**
6011+ * Secondary data reference.
6012+ */
6013+export type LookupData = {
6014+ /**
6015+ * Secondary data source to lookup in.
6016+ */
6017+ data: Data;
6018+ /**
6019+ * Fields in foreign data to lookup.
6020+ * If not specified, the entire object is queried.
6021+ */
6022+ fields?: string[];
6023+ /**
6024+ * Key in data to lookup.
6025+ */
6026+ key: string;
6027+};
6028+
6029+export type BinTransform = {
6030+ /**
6031+ * The output fields at which to write the start and end bin values.
6032+ */
6033+ as: string;
6034+ /**
6035+ * An object indicating bin properties, or simply `true` for using default bin parameters.
6036+ */
6037+ bin: Bin;
6038+ /**
6039+ * The data field to bin.
6040+ */
6041+ field: string;
6042+};
6043+
6044+export type TimeUnitTransform = {
6045+ /**
6046+ * The output field to write the timeUnit value.
6047+ */
6048+ as: string;
6049+ /**
6050+ * The data field to apply time unit.
6051+ */
6052+ field: string;
6053+ /**
6054+ * The timeUnit.
6055+ */
6056+ timeUnit: TimeUnit;
6057+};
6058+
6059+export type AggregateTransform = {
6060+ /**
6061+ * Array of objects that define fields to aggregate.
6062+ */
6063+ aggregate: AggregatedFieldDef[];
6064+ /**
6065+ * The data fields to group by. If not specified, a single group containing all data objects
6066+ * will be used.
6067+ */
6068+ groupby?: string[];
6069+};
6070+
6071+export type AggregatedFieldDef = {
6072+ /**
6073+ * The output field names to use for each aggregated field.
6074+ */
6075+ as: string;
6076+ /**
6077+ * The data field for which to compute aggregate function.
6078+ */
6079+ field: string;
6080+ /**
6081+ * The aggregation operations to apply to the fields, such as sum, average or count.
6082+ * See the [full list of supported aggregation
6083+ * operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)
6084+ * for more information.
6085+ */
6086+ op: AggregateOp;
6087+};
6088+
6089+export type TopLevelLayerSpec = {
6090+ /**
6091+ * URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
6092+ * have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
6093+ * Setting the `$schema` property allows automatic validation and autocomplete in editors
6094+ * that support JSON schema.
6095+ */
6096+ $schema?: string;
6097+ /**
6098+ * Sets how the visualization size should be determined. If a string, should be one of
6099+ * `"pad"`, `"fit"` or `"none"`.
6100+ * Object values can additionally specify parameters for content sizing and automatic
6101+ * resizing.
6102+ * `"fit"` is only supported for single and layered views that don't use `rangeStep`.
6103+ *
6104+ * __Default value__: `pad`
6105+ */
6106+ autosize?: Autosize;
6107+ /**
6108+ * CSS color property to use as the background of visualization.
6109+ *
6110+ * __Default value:__ none (transparent)
6111+ */
6112+ background?: string;
6113+ /**
6114+ * Vega-Lite configuration object. This property can only be defined at the top-level of a
6115+ * specification.
6116+ */
6117+ config?: Config;
6118+ /**
6119+ * An object describing the data source
6120+ */
6121+ data?: Data;
6122+ /**
6123+ * Description of this mark for commenting purpose.
6124+ */
6125+ description?: string;
6126+ /**
6127+ * The height of a visualization.
6128+ *
6129+ * __Default value:__
6130+ * - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
6131+ * [continuous scale](scale.html#continuous), the height will be the value of
6132+ * [`config.view.height`](spec.html#config).
6133+ * - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
6134+ * value or unspecified, the height is [determined by the range step, paddings, and the
6135+ * cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
6136+ * `rangeStep` is `null`, the height will be the value of
6137+ * [`config.view.height`](spec.html#config).
6138+ * - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
6139+ *
6140+ * __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
6141+ * represents the height of a single view.
6142+ *
6143+ * __See also:__ The documentation for [width and height](size.html) contains more examples.
6144+ */
6145+ height?: number;
6146+ /**
6147+ * Layer or single view specifications to be layered.
6148+ *
6149+ * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6150+ * layering facet specifications is not allowed.
6151+ */
6152+ layer: SpecElement[];
6153+ /**
6154+ * Name of the visualization for later reference.
6155+ */
6156+ name?: string;
6157+ /**
6158+ * The default visualization padding, in pixels, from the edge of the visualization canvas
6159+ * to the data rectangle. If a number, specifies padding for all sides.
6160+ * If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
6161+ * "bottom": 5}` to specify padding for each side of the visualization.
6162+ *
6163+ * __Default value__: `5`
6164+ */
6165+ padding?: Padding;
6166+ /**
6167+ * Scale, axis, and legend resolutions for layers.
6168+ */
6169+ resolve?: Resolve;
6170+ /**
6171+ * Title for the plot.
6172+ */
6173+ title?: Title;
6174+ /**
6175+ * An array of data transformations such as filter and new field calculation.
6176+ */
6177+ transform?: Transform[];
6178+ /**
6179+ * The width of a visualization.
6180+ *
6181+ * __Default value:__ This will be determined by the following rules:
6182+ *
6183+ * - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
6184+ * [continuous scale](scale.html#continuous), the width will be the value of
6185+ * [`config.view.width`](spec.html#config).
6186+ * - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
6187+ * value or unspecified, the width is [determined by the range step, paddings, and the
6188+ * cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
6189+ * `rangeStep` is `null`, the width will be the value of
6190+ * [`config.view.width`](spec.html#config).
6191+ * - If no field is mapped to `x` channel, the `width` will be the value of
6192+ * [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
6193+ * the value of `rangeStep` for other marks.
6194+ *
6195+ * __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
6196+ * represents the width of a single view.
6197+ *
6198+ * __See also:__ The documentation for [width and height](size.html) contains more examples.
6199+ */
6200+ width?: number;
6201+};
6202+
6203+export type LayerSpec = {
6204+ /**
6205+ * An object describing the data source
6206+ */
6207+ data?: Data;
6208+ /**
6209+ * Description of this mark for commenting purpose.
6210+ */
6211+ description?: string;
53796212 /**
53806213 * The height of a visualization.
53816214 *
@@ -5402,7 +6235,7 @@ export type LayerSpec = {
54026235 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
54036236 * layering facet specifications is not allowed.
54046237 */
5405- layer?: LayerSpec[];
6238+ layer: SpecElement[];
54066239 /**
54076240 * Name of the visualization for later reference.
54086241 */
@@ -5442,17 +6275,102 @@ export type LayerSpec = {
54426275 * __See also:__ The documentation for [width and height](size.html) contains more examples.
54436276 */
54446277 width?: number;
6278+};
6279+
6280+export type SpecElement = LayerSpec | CompositeUnitSpecAlias;
6281+
6282+/**
6283+ * Scale, axis, and legend resolutions for layers.
6284+ *
6285+ * Defines how scales, axes, and legends from different specs should be combined. Resolve is
6286+ * a mapping from `scale`, `axis`, and `legend` to a mapping from channels to resolutions.
6287+ *
6288+ * Scale, axis, and legend resolutions for facets.
6289+ *
6290+ * Scale and legend resolutions for repeated charts.
6291+ *
6292+ * Scale, axis, and legend resolutions for vertically concatenated charts.
6293+ *
6294+ * Scale, axis, and legend resolutions for horizontally concatenated charts.
6295+ */
6296+export type Resolve = {
6297+ axis?: AxisResolveMap;
6298+ legend?: LegendResolveMap;
6299+ scale?: ScaleResolveMap;
6300+};
6301+
6302+export type AxisResolveMap = {
6303+ x?: ResolveMode;
6304+ y?: ResolveMode;
6305+};
6306+
6307+export type ResolveMode =
6308+ "independent"
6309+ | "shared";
6310+
6311+export type LegendResolveMap = {
6312+ color?: ResolveMode;
6313+ opacity?: ResolveMode;
6314+ shape?: ResolveMode;
6315+ size?: ResolveMode;
6316+};
6317+
6318+export type ScaleResolveMap = {
6319+ color?: ResolveMode;
6320+ opacity?: ResolveMode;
6321+ shape?: ResolveMode;
6322+ size?: ResolveMode;
6323+ x?: ResolveMode;
6324+ y?: ResolveMode;
6325+};
6326+
6327+/**
6328+ * Unit spec that can have a composite mark.
6329+ */
6330+export type CompositeUnitSpecAlias = {
6331+ /**
6332+ * An object describing the data source
6333+ */
6334+ data?: Data;
6335+ /**
6336+ * Description of this mark for commenting purpose.
6337+ */
6338+ description?: string;
54456339 /**
54466340 * A key-value mapping between encoding channels and definition of fields.
54476341 */
5448- encoding?: Encoding;
6342+ encoding: Encoding;
6343+ /**
6344+ * The height of a visualization.
6345+ *
6346+ * __Default value:__
6347+ * - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
6348+ * [continuous scale](scale.html#continuous), the height will be the value of
6349+ * [`config.view.height`](spec.html#config).
6350+ * - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
6351+ * value or unspecified, the height is [determined by the range step, paddings, and the
6352+ * cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
6353+ * `rangeStep` is `null`, the height will be the value of
6354+ * [`config.view.height`](spec.html#config).
6355+ * - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
6356+ *
6357+ * __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
6358+ * represents the height of a single view.
6359+ *
6360+ * __See also:__ The documentation for [width and height](size.html) contains more examples.
6361+ */
6362+ height?: number;
54496363 /**
54506364 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
54516365 * `"line"`,
54526366 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
54536367 * object](mark.html#mark-def).
54546368 */
5455- mark?: AnyMark;
6369+ mark: AnyMark;
6370+ /**
6371+ * Name of the visualization for later reference.
6372+ */
6373+ name?: string;
54566374 /**
54576375 * An object defining properties of geographic projection.
54586376 *
@@ -5464,655 +6382,573 @@ export type LayerSpec = {
54646382 * A key-value mapping between selection names and definitions.
54656383 */
54666384 selection?: { [key: string]: SelectionDef };
5467-};
5468-
5469-/**
5470- * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
5471- * `"line"`,
5472- * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
5473- * object](mark.html#mark-def).
5474- */
5475-export type AnyMark = MarkDef | Mark;
5476-
5477-export type MarkDef = {
54786385 /**
5479- * The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
6386+ * Title for the plot.
54806387 */
5481- align?: HorizontalAlign;
6388+ title?: Title;
54826389 /**
5483- * The rotation angle of the text, in degrees.
6390+ * An array of data transformations such as filter and new field calculation.
54846391 */
5485- angle?: number;
6392+ transform?: Transform[];
54866393 /**
5487- * The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.
6394+ * The width of a visualization.
54886395 *
5489- * __Default value:__ `"middle"`
5490- */
5491- baseline?: VerticalAlign;
5492- /**
5493- * Whether a mark be clipped to the enclosing group’s width and height.
5494- */
5495- clip?: boolean;
5496- /**
5497- * Default color. Note that `fill` and `stroke` have higher precedence than `color` and
5498- * will override `color`.
6396+ * __Default value:__ This will be determined by the following rules:
54996397 *
5500- * __Default value:__ <span style="color: #4682b4;">&#9632;</span> `"#4682b4"`
6398+ * - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
6399+ * [continuous scale](scale.html#continuous), the width will be the value of
6400+ * [`config.view.width`](spec.html#config).
6401+ * - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
6402+ * value or unspecified, the width is [determined by the range step, paddings, and the
6403+ * cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
6404+ * `rangeStep` is `null`, the width will be the value of
6405+ * [`config.view.width`](spec.html#config).
6406+ * - If no field is mapped to `x` channel, the `width` will be the value of
6407+ * [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
6408+ * the value of `rangeStep` for other marks.
55016409 *
5502- * __Note:__ This property cannot be used in a [style config](mark.html#style-config).
5503- */
5504- color?: string;
5505- /**
5506- * The mouse cursor used over the mark. Any valid [CSS cursor
5507- * type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
5508- */
5509- cursor?: Cursor;
5510- /**
5511- * The horizontal offset, in pixels, between the text label and its anchor point. The offset
5512- * is applied after rotation by the _angle_ property.
6410+ * __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
6411+ * represents the width of a single view.
6412+ *
6413+ * __See also:__ The documentation for [width and height](size.html) contains more examples.
55136414 */
5514- dx?: number;
6415+ width?: number;
6416+};
6417+
6418+/**
6419+ * A key-value mapping between encoding channels and definition of fields.
6420+ */
6421+export type Encoding = {
55156422 /**
5516- * The vertical offset, in pixels, between the text label and its anchor point. The offset
5517- * is applied after rotation by the _angle_ property.
6423+ * Color of the marks – either fill or stroke color based on mark type.
6424+ * By default, `color` represents fill color for `"area"`, `"bar"`, `"tick"`,
6425+ * `"text"`, `"circle"`, and `"square"` / stroke color for `"line"` and `"point"`.
6426+ *
6427+ * __Default value:__ If undefined, the default color depends on [mark
6428+ * config](config.html#mark)'s `color` property.
6429+ *
6430+ * _Note:_ See the scale documentation for more information about customizing [color
6431+ * scheme](scale.html#scheme).
55186432 */
5519- dy?: number;
6433+ color?: Color;
55206434 /**
5521- * Default Fill Color. This has higher precedence than config.color
5522- *
5523- * __Default value:__ (None)
6435+ * Additional levels of detail for grouping data in aggregate views and
6436+ * in line and area marks without mapping data to a specific visual channel.
55246437 */
5525- fill?: string;
6438+ detail?: Detail;
55266439 /**
5527- * Whether the mark's color should be used as fill color instead of stroke color.
5528- *
5529- * __Default value:__ `true` for all marks except `point` and `false` for `point`.
5530- *
5531- * __Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.
5532- *
5533- * __Note:__ This property cannot be used in a [style config](mark.html#style-config).
6440+ * A URL to load upon mouse click.
55346441 */
5535- filled?: boolean;
6442+ href?: Href;
55366443 /**
5537- * The fill opacity (value between [0,1]).
6444+ * Opacity of the marks – either can be a value or a range.
55386445 *
5539- * __Default value:__ `1`
6446+ * __Default value:__ If undefined, the default opacity depends on [mark
6447+ * config](config.html#mark)'s `opacity` property.
55406448 */
5541- fillOpacity?: number;
6449+ opacity?: Color;
55426450 /**
5543- * The typeface to set the text in (e.g., `"Helvetica Neue"`).
6451+ * Stack order for stacked marks or order of data points in line marks for connected scatter
6452+ * plots.
6453+ *
6454+ * __Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating
6455+ * additional aggregation grouping.
55446456 */
5545- font?: string;
6457+ order?: Order;
55466458 /**
5547- * The font size, in pixels.
6459+ * For `point` marks the supported values are
6460+ * `"circle"` (default), `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`,
6461+ * or `"triangle-down"`, or else a custom SVG path string.
6462+ * For `geoshape` marks it should be a field definition of the geojson data
6463+ *
6464+ * __Default value:__ If undefined, the default shape depends on [mark
6465+ * config](config.html#point-config)'s `shape` property.
55486466 */
5549- fontSize?: number;
6467+ shape?: Color;
55506468 /**
5551- * The font style (e.g., `"italic"`).
6469+ * Size of the mark.
6470+ * - For `"point"`, `"square"` and `"circle"`, – the symbol size, or pixel area of the mark.
6471+ * - For `"bar"` and `"tick"` – the bar and tick's size.
6472+ * - For `"text"` – the text's font size.
6473+ * - Size is currently unsupported for `"line"`, `"area"`, and `"rect"`.
55526474 */
5553- fontStyle?: FontStyle;
6475+ size?: Color;
55546476 /**
5555- * The font weight (e.g., `"bold"`).
6477+ * Text of the `text` mark.
55566478 */
5557- fontWeight?: FontWeightUnion;
6479+ text?: Text;
55586480 /**
5559- * A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
6481+ * The tooltip text to show upon mouse hover.
55606482 */
5561- href?: string;
6483+ tooltip?: Text;
55626484 /**
5563- * The line interpolation method to use for line and area marks. One of the following:
5564- * - `"linear"`: piecewise linear segments, as in a polyline.
5565- * - `"linear-closed"`: close the linear segments to form a polygon.
5566- * - `"step"`: alternate between horizontal and vertical segments, as in a step function.
5567- * - `"step-before"`: alternate between vertical and horizontal segments, as in a step
5568- * function.
5569- * - `"step-after"`: alternate between horizontal and vertical segments, as in a step
5570- * function.
5571- * - `"basis"`: a B-spline, with control point duplication on the ends.
5572- * - `"basis-open"`: an open B-spline; may not intersect the start or end.
5573- * - `"basis-closed"`: a closed B-spline, as in a loop.
5574- * - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
5575- * - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but
5576- * will intersect other control points.
5577- * - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
5578- * - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the
5579- * spline.
5580- * - `"monotone"`: cubic interpolation that preserves monotonicity in y.
6485+ * X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
55816486 */
5582- interpolate?: Interpolate;
6487+ x?: X;
55836488 /**
5584- * The maximum length of the text mark in pixels (default 0, indicating no limit). The text
5585- * value will be automatically truncated if the rendered size exceeds the limit.
6489+ * X2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
55866490 */
5587- limit?: number;
6491+ x2?: X2;
55886492 /**
5589- * The overall opacity (value between [0,1]).
5590- *
5591- * __Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or
5592- * `square` marks or layered `bar` charts and `1` otherwise.
6493+ * Y coordinates of the marks, or height of vertical `"bar"` and `"area"`.
55936494 */
5594- opacity?: number;
6495+ y?: X;
55956496 /**
5596- * The orientation of a non-stacked bar, tick, area, and line charts.
5597- * The value is either horizontal (default) or vertical.
5598- * - For bar, rule and tick, this determines whether the size of the bar and tick
5599- * should be applied to x or y dimension.
5600- * - For area, this property determines the orient property of the Vega output.
5601- * - For line, this property determines the sort order of the points in the line
5602- * if `config.sortLineBy` is not specified.
5603- * For stacked charts, this is always determined by the orientation of the stack;
5604- * therefore explicitly specified value will be ignored.
6497+ * Y2 coordinates for ranged `"area"`, `"bar"`, `"rect"`, and `"rule"`.
56056498 */
5606- orient?: Orient;
6499+ y2?: X2;
6500+};
6501+
6502+export type TopLevelFacetSpec = {
56076503 /**
5608- * Polar coordinate radial offset, in pixels, of the text label from the origin determined
5609- * by the `x` and `y` properties.
6504+ * URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
6505+ * have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
6506+ * Setting the `$schema` property allows automatic validation and autocomplete in editors
6507+ * that support JSON schema.
56106508 */
5611- radius?: number;
6509+ $schema?: string;
56126510 /**
5613- * The default symbol shape to use. One of: `"circle"` (default), `"square"`, `"cross"`,
5614- * `"diamond"`, `"triangle-up"`, or `"triangle-down"`, or a custom SVG path.
6511+ * Sets how the visualization size should be determined. If a string, should be one of
6512+ * `"pad"`, `"fit"` or `"none"`.
6513+ * Object values can additionally specify parameters for content sizing and automatic
6514+ * resizing.
6515+ * `"fit"` is only supported for single and layered views that don't use `rangeStep`.
56156516 *
5616- * __Default value:__ `"circle"`
6517+ * __Default value__: `pad`
56176518 */
5618- shape?: string;
6519+ autosize?: Autosize;
56196520 /**
5620- * The pixel area each the point/circle/square.
5621- * For example: in the case of circles, the radius is determined in part by the square root
5622- * of the size value.
6521+ * CSS color property to use as the background of visualization.
56236522 *
5624- * __Default value:__ `30`
6523+ * __Default value:__ none (transparent)
56256524 */
5626- size?: number;
6525+ background?: string;
56276526 /**
5628- * Default Stroke Color. This has higher precedence than config.color
5629- *
5630- * __Default value:__ (None)
6527+ * Vega-Lite configuration object. This property can only be defined at the top-level of a
6528+ * specification.
56316529 */
5632- stroke?: string;
6530+ config?: Config;
56336531 /**
5634- * An array of alternating stroke, space lengths for creating dashed or dotted lines.
6532+ * An object describing the data source
56356533 */
5636- strokeDash?: number[];
6534+ data?: Data;
56376535 /**
5638- * The offset (in pixels) into which to begin drawing with the stroke dash array.
6536+ * Description of this mark for commenting purpose.
56396537 */
5640- strokeDashOffset?: number;
6538+ description?: string;
56416539 /**
5642- * The stroke opacity (value between [0,1]).
5643- *
5644- * __Default value:__ `1`
6540+ * An object that describes mappings between `row` and `column` channels and their field
6541+ * definitions.
56456542 */
5646- strokeOpacity?: number;
6543+ facet: FacetMapping;
56476544 /**
5648- * The stroke width, in pixels.
6545+ * Name of the visualization for later reference.
56496546 */
5650- strokeWidth?: number;
6547+ name?: string;
56516548 /**
5652- * A string or array of strings indicating the name of custom styles to apply to the mark. A
5653- * style is a named collection of mark property defaults defined within the [style
5654- * configuration](mark.html#style-config). If style is an array, later styles will override
5655- * earlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within
5656- * the `encoding` will override a style default.
6549+ * The default visualization padding, in pixels, from the edge of the visualization canvas
6550+ * to the data rectangle. If a number, specifies padding for all sides.
6551+ * If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
6552+ * "bottom": 5}` to specify padding for each side of the visualization.
56576553 *
5658- * __Default value:__ The mark's name. For example, a bar mark will have style `"bar"` by
5659- * default.
5660- * __Note:__ Any specified style will augment the default style. For example, a bar mark
5661- * with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
5662- * specified style `"foo"` has higher precedence).
6554+ * __Default value__: `5`
56636555 */
5664- style?: Style;
6556+ padding?: Padding;
56656557 /**
5666- * Depending on the interpolation type, sets the tension parameter (for line and area marks).
6558+ * Scale, axis, and legend resolutions for facets.
56676559 */
5668- tension?: number;
6560+ resolve?: Resolve;
56696561 /**
5670- * Placeholder text if the `text` channel is not specified
6562+ * A specification of the view that gets faceted.
56716563 */
5672- text?: string;
6564+ spec: SpecElement;
56736565 /**
5674- * Polar coordinate angle, in radians, of the text label from the origin determined by the
5675- * `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark
5676- * `startAngle` and `endAngle` properties: angles are measured in radians, with `0`
5677- * indicating "north".
6566+ * Title for the plot.
56786567 */
5679- theta?: number;
6568+ title?: Title;
56806569 /**
5681- * The mark type.
5682- * One of `"bar"`, `"circle"`, `"square"`, `"tick"`, `"line"`,
5683- * `"area"`, `"point"`, `"geoshape"`, `"rule"`, and `"text"`.
6570+ * An array of data transformations such as filter and new field calculation.
56846571 */
5685- type: Mark;
6572+ transform?: Transform[];
56866573 };
56876574
56886575 /**
5689- * A string or array of strings indicating the name of custom styles to apply to the mark. A
5690- * style is a named collection of mark property defaults defined within the [style
5691- * configuration](mark.html#style-config). If style is an array, later styles will override
5692- * earlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within
5693- * the `encoding` will override a style default.
5694- *
5695- * __Default value:__ The mark's name. For example, a bar mark will have style `"bar"` by
5696- * default.
5697- * __Note:__ Any specified style will augment the default style. For example, a bar mark
5698- * with `"style": "foo"` will receive from `config.style.bar` and `config.style.foo` (the
5699- * specified style `"foo"` has higher precedence).
5700- *
5701- * A [mark style property](config.html#style) to apply to the title text mark.
5702- *
5703- * __Default value:__ `"group-title"`.
5704- */
5705-export type Style = string[] | string;
5706-
5707-/**
5708- * All types of primitive marks.
5709- *
5710- * The mark type.
5711- * One of `"bar"`, `"circle"`, `"square"`, `"tick"`, `"line"`,
5712- * `"area"`, `"point"`, `"geoshape"`, `"rule"`, and `"text"`.
6576+ * An object that describes mappings between `row` and `column` channels and their field
6577+ * definitions.
57136578 */
5714-export type Mark =
5715- "area"
5716- | "bar"
5717- | "line"
5718- | "point"
5719- | "text"
5720- | "tick"
5721- | "rect"
5722- | "rule"
5723- | "circle"
5724- | "square"
5725- | "geoshape";
6579+export type FacetMapping = {
6580+ /**
6581+ * Horizontal facets for trellis plots.
6582+ */
6583+ column?: FacetFieldDef;
6584+ /**
6585+ * Vertical facets for trellis plots.
6586+ */
6587+ row?: FacetFieldDef;
6588+};
57266589
5727-/**
5728- * An object defining properties of geographic projection.
5729- *
5730- * Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
5731- * more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
5732- */
5733-export type Projection = {
6590+export type TopLevelRepeatSpec = {
57346591 /**
5735- * Sets the projection’s center to the specified center, a two-element array of longitude
5736- * and latitude in degrees.
6592+ * URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
6593+ * have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
6594+ * Setting the `$schema` property allows automatic validation and autocomplete in editors
6595+ * that support JSON schema.
6596+ */
6597+ $schema?: string;
6598+ /**
6599+ * Sets how the visualization size should be determined. If a string, should be one of
6600+ * `"pad"`, `"fit"` or `"none"`.
6601+ * Object values can additionally specify parameters for content sizing and automatic
6602+ * resizing.
6603+ * `"fit"` is only supported for single and layered views that don't use `rangeStep`.
57376604 *
5738- * __Default value:__ `[0, 0]`
6605+ * __Default value__: `pad`
6606+ */
6607+ autosize?: Autosize;
6608+ /**
6609+ * CSS color property to use as the background of visualization.
6610+ *
6611+ * __Default value:__ none (transparent)
6612+ */
6613+ background?: string;
6614+ /**
6615+ * Vega-Lite configuration object. This property can only be defined at the top-level of a
6616+ * specification.
6617+ */
6618+ config?: Config;
6619+ /**
6620+ * An object describing the data source
6621+ */
6622+ data?: Data;
6623+ /**
6624+ * Description of this mark for commenting purpose.
6625+ */
6626+ description?: string;
6627+ /**
6628+ * Name of the visualization for later reference.
57396629 */
5740- center?: number[];
6630+ name?: string;
57416631 /**
5742- * Sets the projection’s clipping circle radius to the specified angle in degrees. If
5743- * `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
5744- * than small-circle clipping.
6632+ * The default visualization padding, in pixels, from the edge of the visualization canvas
6633+ * to the data rectangle. If a number, specifies padding for all sides.
6634+ * If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
6635+ * "bottom": 5}` to specify padding for each side of the visualization.
6636+ *
6637+ * __Default value__: `5`
57456638 */
5746- clipAngle?: number;
6639+ padding?: Padding;
57476640 /**
5748- * Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
5749- * bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
5750- * the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
5751- * viewport clipping is performed.
6641+ * An object that describes what fields should be repeated into views that are laid out as a
6642+ * `row` or `column`.
57526643 */
5753- clipExtent?: Array<number[]>;
5754- coefficient?: number;
5755- distance?: number;
5756- fraction?: number;
5757- lobes?: number;
5758- parallel?: number;
6644+ repeat: Repeat;
57596645 /**
5760- * Sets the threshold for the projection’s [adaptive
5761- * resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
5762- * value corresponds to the [Douglas–Peucker
5763- * distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
5764- * If precision is not specified, returns the projection’s current resampling precision
5765- * which defaults to `√0.5 ≅ 0.70710…`.
6646+ * Scale and legend resolutions for repeated charts.
57666647 */
5767- precision?: FluffyPrecision;
5768- radius?: number;
5769- ratio?: number;
6648+ resolve?: Resolve;
6649+ spec: Spec;
57706650 /**
5771- * Sets the projection’s three-axis rotation to the specified angles, which must be a two-
5772- * or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
5773- * angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
5774- *
5775- * __Default value:__ `[0, 0, 0]`
6651+ * Title for the plot.
57766652 */
5777- rotate?: number[];
5778- spacing?: number;
5779- tilt?: number;
6653+ title?: Title;
57806654 /**
5781- * The cartographic projection to use. This value is case-insensitive, for example
5782- * `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
5783- * projection types [in the
5784- * documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
5785- *
5786- * __Default value:__ `mercator`
6655+ * An array of data transformations such as filter and new field calculation.
57876656 */
5788- type?: VGProjectionType;
6657+ transform?: Transform[];
57896658 };
57906659
57916660 /**
5792- * Sets the threshold for the projection’s [adaptive
5793- * resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
5794- * value corresponds to the [Douglas–Peucker
5795- * distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
5796- * If precision is not specified, returns the projection’s current resampling precision
5797- * which defaults to `√0.5 ≅ 0.70710…`.
6661+ * An object that describes what fields should be repeated into views that are laid out as a
6662+ * `row` or `column`.
57986663 */
5799-export type FluffyPrecision = {
6664+export type Repeat = {
58006665 /**
5801- * Returns the length of a String object.
6666+ * Horizontal repeated views.
58026667 */
5803- length: number;
5804- [property: string]: string;
5805-};
5806-
5807-/**
5808- * Scale, axis, and legend resolutions for layers.
5809- *
5810- * Defines how scales, axes, and legends from different specs should be combined. Resolve is
5811- * a mapping from `scale`, `axis`, and `legend` to a mapping from channels to resolutions.
5812- *
5813- * Scale, axis, and legend resolutions for facets.
5814- *
5815- * Scale and legend resolutions for repeated charts.
5816- *
5817- * Scale, axis, and legend resolutions for vertically concatenated charts.
5818- *
5819- * Scale, axis, and legend resolutions for horizontally concatenated charts.
5820- */
5821-export type Resolve = {
5822- axis?: AxisResolveMap;
5823- legend?: LegendResolveMap;
5824- scale?: ScaleResolveMap;
5825-};
5826-
5827-export type AxisResolveMap = {
5828- x?: ResolveMode;
5829- y?: ResolveMode;
5830-};
5831-
5832-export type ResolveMode =
5833- "independent"
5834- | "shared";
5835-
5836-export type LegendResolveMap = {
5837- color?: ResolveMode;
5838- opacity?: ResolveMode;
5839- shape?: ResolveMode;
5840- size?: ResolveMode;
6668+ column?: string[];
6669+ /**
6670+ * Vertical repeated views.
6671+ */
6672+ row?: string[];
58416673 };
58426674
5843-export type ScaleResolveMap = {
5844- color?: ResolveMode;
5845- opacity?: ResolveMode;
5846- shape?: ResolveMode;
5847- size?: ResolveMode;
5848- x?: ResolveMode;
5849- y?: ResolveMode;
6675+export type HConcatSpec = {
6676+ /**
6677+ * An object describing the data source
6678+ */
6679+ data?: Data;
6680+ /**
6681+ * Description of this mark for commenting purpose.
6682+ */
6683+ description?: string;
6684+ /**
6685+ * A list of views that should be concatenated and put into a row.
6686+ */
6687+ hconcat: Spec[];
6688+ /**
6689+ * Name of the visualization for later reference.
6690+ */
6691+ name?: string;
6692+ /**
6693+ * Scale, axis, and legend resolutions for horizontally concatenated charts.
6694+ */
6695+ resolve?: Resolve;
6696+ /**
6697+ * Title for the plot.
6698+ */
6699+ title?: Title;
6700+ /**
6701+ * An array of data transformations such as filter and new field calculation.
6702+ */
6703+ transform?: Transform[];
58506704 };
58516705
5852-export type SelectionDef = {
6706+export type VConcatSpec = {
58536707 /**
5854- * Establish a two-way binding between a single selection and input elements
5855- * (also known as dynamic query widgets). A binding takes the form of
5856- * Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)
5857- * or can be a mapping between projected field/encodings and binding definitions.
5858- *
5859- * See the [bind transform](bind.html) documentation for more information.
5860- *
5861- * Establishes a two-way binding between the interval selection and the scales
5862- * used within the same view. This allows a user to interactively pan and
5863- * zoom the view.
6708+ * An object describing the data source
58646709 */
5865- bind?: BindUnion;
6710+ data?: Data;
58666711 /**
5867- * By default, all data values are considered to lie within an empty selection.
5868- * When set to `none`, empty selections contain no data values.
6712+ * Description of this mark for commenting purpose.
58696713 */
5870- empty?: Empty;
6714+ description?: string;
58716715 /**
5872- * An array of encoding channels. The corresponding data field values
5873- * must match for a data tuple to fall within the selection.
6716+ * Name of the visualization for later reference.
58746717 */
5875- encodings?: SingleDefChannel[];
6718+ name?: string;
58766719 /**
5877- * An array of field names whose values must match for a data tuple to
5878- * fall within the selection.
6720+ * Scale, axis, and legend resolutions for vertically concatenated charts.
58796721 */
5880- fields?: string[];
6722+ resolve?: Resolve;
58816723 /**
5882- * When true, an invisible voronoi diagram is computed to accelerate discrete
5883- * selection. The data value _nearest_ the mouse cursor is added to the selection.
5884- *
5885- * See the [nearest transform](nearest.html) documentation for more information.
6724+ * Title for the plot.
58866725 */
5887- nearest?: boolean;
6726+ title?: Title;
58886727 /**
5889- * A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
5890- * selector) that triggers the selection.
5891- * For interval selections, the event stream must specify a [start and
5892- * end](https://vega.github.io/vega/docs/event-streams/#between-filters).
6728+ * An array of data transformations such as filter and new field calculation.
58936729 */
5894- on?: mixed;
6730+ transform?: Transform[];
58956731 /**
5896- * With layered and multi-view displays, a strategy that determines how
5897- * selections' data queries are resolved when applied in a filter transform,
5898- * conditional encoding rule, or scale domain.
6732+ * A list of views that should be concatenated and put into a column.
58996733 */
5900- resolve?: SelectionResolution;
5901- type: SelectionDefType;
6734+ vconcat: Spec[];
6735+};
6736+
6737+export type RepeatSpec = {
59026738 /**
5903- * Controls whether data values should be toggled or only ever inserted into
5904- * multi selections. Can be `true`, `false` (for insertion only), or a
5905- * [Vega expression](https://vega.github.io/vega/docs/expressions/).
5906- *
5907- * __Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,
5908- * data values are toggled when a user interacts with the shift-key pressed).
5909- *
5910- * See the [toggle transform](toggle.html) documentation for more information.
6739+ * An object describing the data source
59116740 */
5912- toggle?: Translate;
6741+ data?: Data;
59136742 /**
5914- * An interval selection also adds a rectangle mark to depict the
5915- * extents of the interval. The `mark` property can be used to customize the
5916- * appearance of the mark.
6743+ * Description of this mark for commenting purpose.
59176744 */
5918- mark?: BrushConfig;
6745+ description?: string;
59196746 /**
5920- * When truthy, allows a user to interactively move an interval selection
5921- * back-and-forth. Can be `true`, `false` (to disable panning), or a
5922- * [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)
5923- * which must include a start and end event to trigger continuous panning.
5924- *
5925- * __Default value:__ `true`, which corresponds to
5926- * `[mousedown, window:mouseup] > window:mousemove!` which corresponds to
5927- * clicks and dragging within an interval selection to reposition it.
6747+ * Name of the visualization for later reference.
59286748 */
5929- translate?: Translate;
6749+ name?: string;
59306750 /**
5931- * When truthy, allows a user to interactively resize an interval selection.
5932- * Can be `true`, `false` (to disable zooming), or a [Vega event stream
5933- * definition](https://vega.github.io/vega/docs/event-streams/). Currently,
5934- * only `wheel` events are supported.
5935- *
5936- *
5937- * __Default value:__ `true`, which corresponds to `wheel!`.
6751+ * An object that describes what fields should be repeated into views that are laid out as a
6752+ * `row` or `column`.
6753+ */
6754+ repeat: Repeat;
6755+ /**
6756+ * Scale and legend resolutions for repeated charts.
6757+ */
6758+ resolve?: Resolve;
6759+ spec: Spec;
6760+ /**
6761+ * Title for the plot.
6762+ */
6763+ title?: Title;
6764+ /**
6765+ * An array of data transformations such as filter and new field calculation.
6766+ */
6767+ transform?: Transform[];
6768+};
6769+
6770+export type Spec = CompositeUnitSpecAlias | LayerSpec | FacetSpec | RepeatSpec | VConcatSpec | HConcatSpec;
6771+
6772+export type FacetSpec = {
6773+ /**
6774+ * An object describing the data source
6775+ */
6776+ data?: Data;
6777+ /**
6778+ * Description of this mark for commenting purpose.
6779+ */
6780+ description?: string;
6781+ /**
6782+ * An object that describes mappings between `row` and `column` channels and their field
6783+ * definitions.
59386784 */
5939- zoom?: Translate;
5940-};
5941-
5942-export type BindUnion = BindEnum | { [key: string]: VGBinding };
5943-
5944-export type SelectionDefType =
5945- "single"
5946- | "multi"
5947- | "interval";
5948-
5949-export type Title = TitleParams | string;
5950-
5951-export type TitleParams = {
6785+ facet: FacetMapping;
59526786 /**
5953- * The anchor position for placing the title. One of `"start"`, `"middle"`, or `"end"`. For
5954- * example, with an orientation of top these anchor positions map to a left-, center-, or
5955- * right-aligned title.
5956- *
5957- * __Default value:__ `"middle"` for [single](spec.html) and [layered](layer.html) views.
5958- * `"start"` for other composite views.
5959- *
5960- * __Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only
5961- * customizable only for [single](spec.html) and [layered](layer.html) views. For other
5962- * composite views, `anchor` is always `"start"`.
6787+ * Name of the visualization for later reference.
59636788 */
5964- anchor?: Anchor;
6789+ name?: string;
59656790 /**
5966- * The orthogonal offset in pixels by which to displace the title from its position along
5967- * the edge of the chart.
6791+ * Scale, axis, and legend resolutions for facets.
59686792 */
5969- offset?: number;
6793+ resolve?: Resolve;
59706794 /**
5971- * The orientation of the title relative to the chart. One of `"top"` (the default),
5972- * `"bottom"`, `"left"`, or `"right"`.
6795+ * A specification of the view that gets faceted.
59736796 */
5974- orient?: TitleOrient;
6797+ spec: SpecElement;
59756798 /**
5976- * A [mark style property](config.html#style) to apply to the title text mark.
5977- *
5978- * __Default value:__ `"group-title"`.
6799+ * Title for the plot.
59796800 */
5980- style?: Style;
6801+ title?: Title;
59816802 /**
5982- * The title text.
6803+ * An array of data transformations such as filter and new field calculation.
59836804 */
5984- text: string;
6805+ transform?: Transform[];
59856806 };
59866807
5987-export type Transform = {
6808+export type TopLevelVConcatSpec = {
59886809 /**
5989- * The `filter` property must be one of the predicate definitions:
5990- * (1) an [expression](types.html#expression) string,
5991- * where `datum` can be used to refer to the current data object;
5992- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
5993- * [range predicate](filter.html#range-predicate), [one-of
5994- * predicate](filter.html#one-of-predicate);
5995- * (3) a [selection predicate](filter.html#selection-predicate);
5996- * or (4) a logical operand that combines (1), (2), or (3).
6810+ * URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
6811+ * have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
6812+ * Setting the `$schema` property allows automatic validation and autocomplete in editors
6813+ * that support JSON schema.
59976814 */
5998- filter?: LogicalOperandPredicate;
6815+ $schema?: string;
59996816 /**
6000- * The field for storing the computed formula value.
6001- *
6002- * The field or fields for storing the computed formula value.
6003- * If `from.fields` is specified, the transform will use the same names for `as`.
6004- * If `from.fields` is not specified, `as` has to be a string and we put the whole object
6005- * into the data under the specified name.
6006- *
6007- * The output fields at which to write the start and end bin values.
6817+ * Sets how the visualization size should be determined. If a string, should be one of
6818+ * `"pad"`, `"fit"` or `"none"`.
6819+ * Object values can additionally specify parameters for content sizing and automatic
6820+ * resizing.
6821+ * `"fit"` is only supported for single and layered views that don't use `rangeStep`.
60086822 *
6009- * The output field to write the timeUnit value.
6823+ * __Default value__: `pad`
60106824 */
6011- as?: Style;
6825+ autosize?: Autosize;
60126826 /**
6013- * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
6014- * current data object.
6827+ * CSS color property to use as the background of visualization.
6828+ *
6829+ * __Default value:__ none (transparent)
60156830 */
6016- calculate?: string;
6831+ background?: string;
60176832 /**
6018- * The default value to use if lookup fails.
6019- *
6020- * __Default value:__ `null`
6833+ * Vega-Lite configuration object. This property can only be defined at the top-level of a
6834+ * specification.
60216835 */
6022- default?: string;
6836+ config?: Config;
60236837 /**
6024- * Secondary data reference.
6838+ * An object describing the data source
60256839 */
6026- from?: LookupData;
6840+ data?: Data;
60276841 /**
6028- * Key in primary data source.
6842+ * Description of this mark for commenting purpose.
60296843 */
6030- lookup?: string;
6844+ description?: string;
60316845 /**
6032- * An object indicating bin properties, or simply `true` for using default bin parameters.
6846+ * Name of the visualization for later reference.
60336847 */
6034- bin?: Bin;
6848+ name?: string;
60356849 /**
6036- * The data field to bin.
6850+ * The default visualization padding, in pixels, from the edge of the visualization canvas
6851+ * to the data rectangle. If a number, specifies padding for all sides.
6852+ * If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
6853+ * "bottom": 5}` to specify padding for each side of the visualization.
60376854 *
6038- * The data field to apply time unit.
6855+ * __Default value__: `5`
60396856 */
6040- field?: string;
6857+ padding?: Padding;
60416858 /**
6042- * The timeUnit.
6859+ * Scale, axis, and legend resolutions for vertically concatenated charts.
60436860 */
6044- timeUnit?: TimeUnit;
6861+ resolve?: Resolve;
60456862 /**
6046- * Array of objects that define fields to aggregate.
6863+ * Title for the plot.
6864+ */
6865+ title?: Title;
6866+ /**
6867+ * An array of data transformations such as filter and new field calculation.
60476868 */
6048- aggregate?: AggregatedFieldDef[];
6869+ transform?: Transform[];
60496870 /**
6050- * The data fields to group by. If not specified, a single group containing all data objects
6051- * will be used.
6871+ * A list of views that should be concatenated and put into a column.
60526872 */
6053- groupby?: string[];
6873+ vconcat: Spec[];
60546874 };
60556875
6056-export type AggregatedFieldDef = {
6876+export type TopLevelHConcatSpec = {
60576877 /**
6058- * The output field names to use for each aggregated field.
6878+ * URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
6879+ * have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
6880+ * Setting the `$schema` property allows automatic validation and autocomplete in editors
6881+ * that support JSON schema.
60596882 */
6060- as: string;
6883+ $schema?: string;
60616884 /**
6062- * The data field for which to compute aggregate function.
6885+ * Sets how the visualization size should be determined. If a string, should be one of
6886+ * `"pad"`, `"fit"` or `"none"`.
6887+ * Object values can additionally specify parameters for content sizing and automatic
6888+ * resizing.
6889+ * `"fit"` is only supported for single and layered views that don't use `rangeStep`.
6890+ *
6891+ * __Default value__: `pad`
60636892 */
6064- field: string;
6893+ autosize?: Autosize;
60656894 /**
6066- * The aggregation operations to apply to the fields, such as sum, average or count.
6067- * See the [full list of supported aggregation
6068- * operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)
6069- * for more information.
6895+ * CSS color property to use as the background of visualization.
6896+ *
6897+ * __Default value:__ none (transparent)
60706898 */
6071- op: AggregateOp;
6072-};
6073-
6074-/**
6075- * Secondary data reference.
6076- */
6077-export type LookupData = {
6899+ background?: string;
60786900 /**
6079- * Secondary data source to lookup in.
6901+ * Vega-Lite configuration object. This property can only be defined at the top-level of a
6902+ * specification.
60806903 */
6081- data: Data;
6904+ config?: Config;
60826905 /**
6083- * Fields in foreign data to lookup.
6084- * If not specified, the entire object is queried.
6906+ * An object describing the data source
60856907 */
6086- fields?: string[];
6908+ data?: Data;
60876909 /**
6088- * Key in data to lookup.
6910+ * Description of this mark for commenting purpose.
60896911 */
6090- key: string;
6091-};
6092-
6093-/**
6094- * An object that describes what fields should be repeated into views that are laid out as a
6095- * `row` or `column`.
6096- */
6097-export type Repeat = {
6912+ description?: string;
60986913 /**
6099- * Horizontal repeated views.
6914+ * A list of views that should be concatenated and put into a row.
61006915 */
6101- column?: string[];
6916+ hconcat: Spec[];
61026917 /**
6103- * Vertical repeated views.
6918+ * Name of the visualization for later reference.
61046919 */
6105- row?: string[];
6920+ name?: string;
6921+ /**
6922+ * The default visualization padding, in pixels, from the edge of the visualization canvas
6923+ * to the data rectangle. If a number, specifies padding for all sides.
6924+ * If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
6925+ * "bottom": 5}` to specify padding for each side of the visualization.
6926+ *
6927+ * __Default value__: `5`
6928+ */
6929+ padding?: Padding;
6930+ /**
6931+ * Scale, axis, and legend resolutions for horizontally concatenated charts.
6932+ */
6933+ resolve?: Resolve;
6934+ /**
6935+ * Title for the plot.
6936+ */
6937+ title?: Title;
6938+ /**
6939+ * An array of data transformations such as filter and new field calculation.
6940+ */
6941+ transform?: Transform[];
61066942 };
61076943
61086944 // Converts JSON strings to/from your types
61096945 // and asserts the results of JSON.parse at runtime
61106946 function toTopLevel(json: string): TopLevel {
6111- return cast(JSON.parse(json), r("TopLevel"));
6947+ return cast(JSON.parse(json), u(r("TopLevelFacetedUnitSpec"), r("TopLevelLayerSpec"), r("TopLevelFacetSpec"), r("TopLevelRepeatSpec"), r("TopLevelVConcatSpec"), r("TopLevelHConcatSpec")));
61126948 }
61136949
61146950 function topLevelToJson(value: TopLevel): string {
6115- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
6951+ return JSON.stringify(uncast(value, u(r("TopLevelFacetedUnitSpec"), r("TopLevelLayerSpec"), r("TopLevelFacetSpec"), r("TopLevelRepeatSpec"), r("TopLevelVConcatSpec"), r("TopLevelHConcatSpec"))), null, 2);
61166952 }
61176953
61186954 function invalidValue(typ: any, val: any, key: any, parent: any = '') {
@@ -6269,30 +7105,23 @@ function r(name: string) {
62697105 }
62707106
62717107 const typeMap: any = {
6272- "TopLevel": o([
7108+ "TopLevelFacetedUnitSpec": o([
62737109 { json: "$schema", js: "$schema", typ: u(undefined, "") },
62747110 { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
62757111 { json: "background", js: "background", typ: u(undefined, "") },
62767112 { json: "config", js: "config", typ: u(undefined, r("Config")) },
6277- { json: "data", js: "data", typ: u(undefined, r("Data")) },
7113+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
62787114 { json: "description", js: "description", typ: u(undefined, "") },
6279- { json: "encoding", js: "encoding", typ: u(undefined, r("EncodingWithFacet")) },
7115+ { json: "encoding", js: "encoding", typ: r("EncodingWithFacet") },
62807116 { json: "height", js: "height", typ: u(undefined, 3.14) },
6281- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
7117+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
62827118 { json: "name", js: "name", typ: u(undefined, "") },
62837119 { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
62847120 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
6285- { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
7121+ { json: "selection", js: "selection", typ: u(undefined, m(u(r("SingleSelection"), r("MultiSelection"), r("IntervalSelection")))) },
62867122 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
6287- { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
7123+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
62887124 { json: "width", js: "width", typ: u(undefined, 3.14) },
6289- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
6290- { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
6291- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
6292- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
6293- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
6294- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
6295- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
62967125 ], false),
62977126 "AutoSizeParams": o([
62987127 { json: "contains", js: "contains", typ: u(undefined, r("Contains")) },
@@ -6551,23 +7380,20 @@ const typeMap: any = {
65517380 { json: "length", js: "length", typ: 3.14 },
65527381 ], ""),
65537382 "RangeConfig": o([
6554- { json: "category", js: "category", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
6555- { json: "diverging", js: "diverging", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
6556- { json: "heatmap", js: "heatmap", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
6557- { json: "ordinal", js: "ordinal", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
6558- { json: "ramp", js: "ramp", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
7383+ { json: "category", js: "category", typ: u(undefined, u(a(""), r("VGScheme"))) },
7384+ { json: "diverging", js: "diverging", typ: u(undefined, u(a(""), r("VGScheme"))) },
7385+ { json: "heatmap", js: "heatmap", typ: u(undefined, u(a(""), r("VGScheme"))) },
7386+ { json: "ordinal", js: "ordinal", typ: u(undefined, u(a(""), r("VGScheme"))) },
7387+ { json: "ramp", js: "ramp", typ: u(undefined, u(a(""), r("VGScheme"))) },
65597388 { json: "symbol", js: "symbol", typ: u(undefined, a("")) },
6560- ], u(a(u(3.14, "")), r("RangeConfigValueVGScheme"))),
6561- "CategoryVGScheme": o([
7389+ ], u(a(u(3.14, "")), r("VGScheme"), r("RangeConfigValueClass"))),
7390+ "VGScheme": o([
65627391 { json: "count", js: "count", typ: u(undefined, 3.14) },
65637392 { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
65647393 { json: "scheme", js: "scheme", typ: "" },
65657394 ], false),
6566- "RangeConfigValueVGScheme": o([
6567- { json: "count", js: "count", typ: u(undefined, 3.14) },
6568- { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
6569- { json: "scheme", js: "scheme", typ: u(undefined, "") },
6570- { json: "step", js: "step", typ: u(undefined, 3.14) },
7395+ "RangeConfigValueClass": o([
7396+ { json: "step", js: "step", typ: 3.14 },
65717397 ], false),
65727398 "ScaleConfig": o([
65737399 { json: "bandPaddingInner", js: "bandPaddingInner", typ: u(undefined, 3.14) },
@@ -6596,7 +7422,7 @@ const typeMap: any = {
65967422 { json: "single", js: "single", typ: u(undefined, r("SingleSelectionConfig")) },
65977423 ], false),
65987424 "IntervalSelectionConfig": o([
6599- { json: "bind", js: "bind", typ: u(undefined, r("BindEnum")) },
7425+ { json: "bind", js: "bind", typ: u(undefined, r("Bind")) },
66007426 { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
66017427 { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
66027428 { json: "fields", js: "fields", typ: u(undefined, a("")) },
@@ -6625,7 +7451,7 @@ const typeMap: any = {
66257451 { json: "toggle", js: "toggle", typ: u(undefined, u(true, "")) },
66267452 ], false),
66277453 "SingleSelectionConfig": o([
6628- { json: "bind", js: "bind", typ: u(undefined, m(r("VGBinding"))) },
7454+ { json: "bind", js: "bind", typ: u(undefined, m(u(r("VGCheckboxBinding"), r("VGRadioBinding"), r("VGSelectBinding"), r("VGRangeBinding"), r("VGGenericBinding")))) },
66297455 { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
66307456 { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
66317457 { json: "fields", js: "fields", typ: u(undefined, a("")) },
@@ -6633,14 +7459,31 @@ const typeMap: any = {
66337459 { json: "on", js: "on", typ: u(undefined, "any") },
66347460 { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
66357461 ], false),
6636- "VGBinding": o([
7462+ "VGCheckboxBinding": o([
66377463 { json: "element", js: "element", typ: u(undefined, "") },
6638- { json: "input", js: "input", typ: "" },
6639- { json: "options", js: "options", typ: u(undefined, a("")) },
7464+ { json: "input", js: "input", typ: r("PurpleInput") },
7465+ ], false),
7466+ "VGRadioBinding": o([
7467+ { json: "element", js: "element", typ: u(undefined, "") },
7468+ { json: "input", js: "input", typ: r("FluffyInput") },
7469+ { json: "options", js: "options", typ: a("") },
7470+ ], false),
7471+ "VGSelectBinding": o([
7472+ { json: "element", js: "element", typ: u(undefined, "") },
7473+ { json: "input", js: "input", typ: r("TentacledInput") },
7474+ { json: "options", js: "options", typ: a("") },
7475+ ], false),
7476+ "VGRangeBinding": o([
7477+ { json: "element", js: "element", typ: u(undefined, "") },
7478+ { json: "input", js: "input", typ: r("StickyInput") },
66407479 { json: "max", js: "max", typ: u(undefined, 3.14) },
66417480 { json: "min", js: "min", typ: u(undefined, 3.14) },
66427481 { json: "step", js: "step", typ: u(undefined, 3.14) },
66437482 ], false),
7483+ "VGGenericBinding": o([
7484+ { json: "element", js: "element", typ: u(undefined, "") },
7485+ { json: "input", js: "input", typ: "" },
7486+ ], false),
66447487 "VGMarkConfig": o([
66457488 { json: "align", js: "align", typ: u(undefined, r("HorizontalAlign")) },
66467489 { json: "angle", js: "angle", typ: u(undefined, 3.14) },
@@ -6762,47 +7605,60 @@ const typeMap: any = {
67627605 { json: "strokeWidth", js: "strokeWidth", typ: u(undefined, 3.14) },
67637606 { json: "width", js: "width", typ: u(undefined, 3.14) },
67647607 ], false),
6765- "Data": o([
6766- { json: "format", js: "format", typ: u(undefined, r("DataFormat")) },
6767- { json: "url", js: "url", typ: u(undefined, "") },
6768- { json: "values", js: "values", typ: u(undefined, u(a(u(true, 3.14, m("any"), "")), m("any"), "")) },
6769- { json: "name", js: "name", typ: u(undefined, "") },
7608+ "URLData": o([
7609+ { json: "format", js: "format", typ: u(undefined, u(r("CSVDataFormat"), r("JSONDataFormat"), r("TopoDataFormat"))) },
7610+ { json: "url", js: "url", typ: "" },
7611+ ], false),
7612+ "CSVDataFormat": o([
7613+ { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
7614+ { json: "type", js: "type", typ: u(undefined, r("PurpleType")) },
67707615 ], false),
6771- "DataFormat": o([
7616+ "JSONDataFormat": o([
67727617 { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
6773- { json: "type", js: "type", typ: u(undefined, r("DataFormatType")) },
67747618 { json: "property", js: "property", typ: u(undefined, "") },
7619+ { json: "type", js: "type", typ: u(undefined, r("FluffyType")) },
7620+ ], false),
7621+ "TopoDataFormat": o([
67757622 { json: "feature", js: "feature", typ: u(undefined, "") },
67767623 { json: "mesh", js: "mesh", typ: u(undefined, "") },
7624+ { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
7625+ { json: "type", js: "type", typ: u(undefined, r("TentacledType")) },
7626+ ], false),
7627+ "InlineData": o([
7628+ { json: "format", js: "format", typ: u(undefined, u(r("CSVDataFormat"), r("JSONDataFormat"), r("TopoDataFormat"))) },
7629+ { json: "values", js: "values", typ: u(a(u(true, 3.14, m("any"), "")), m("any"), "") },
7630+ ], false),
7631+ "NamedData": o([
7632+ { json: "format", js: "format", typ: u(undefined, u(r("CSVDataFormat"), r("JSONDataFormat"), r("TopoDataFormat"))) },
7633+ { json: "name", js: "name", typ: "" },
67777634 ], false),
67787635 "EncodingWithFacet": o([
6779- { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) },
7636+ { json: "color", js: "color", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
67807637 { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
67817638 { json: "detail", js: "detail", typ: u(undefined, u(a(r("FieldDef")), r("FieldDef"))) },
6782- { json: "href", js: "href", typ: u(undefined, r("DefWithCondition")) },
6783- { json: "opacity", js: "opacity", typ: u(undefined, r("MarkPropDefWithCondition")) },
7639+ { json: "href", js: "href", typ: u(undefined, u(r("FieldDefWithCondition"), r("ValueDefWithCondition"))) },
7640+ { json: "opacity", js: "opacity", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
67847641 { json: "order", js: "order", typ: u(undefined, u(a(r("OrderFieldDef")), r("OrderFieldDef"))) },
67857642 { json: "row", js: "row", typ: u(undefined, r("FacetFieldDef")) },
6786- { json: "shape", js: "shape", typ: u(undefined, r("MarkPropDefWithCondition")) },
6787- { json: "size", js: "size", typ: u(undefined, r("MarkPropDefWithCondition")) },
6788- { json: "text", js: "text", typ: u(undefined, r("TextDefWithCondition")) },
6789- { json: "tooltip", js: "tooltip", typ: u(undefined, r("TextDefWithCondition")) },
6790- { json: "x", js: "x", typ: u(undefined, r("XClass")) },
6791- { json: "x2", js: "x2", typ: u(undefined, r("X2Class")) },
6792- { json: "y", js: "y", typ: u(undefined, r("XClass")) },
6793- { json: "y2", js: "y2", typ: u(undefined, r("X2Class")) },
7643+ { json: "shape", js: "shape", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
7644+ { json: "size", js: "size", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
7645+ { json: "text", js: "text", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
7646+ { json: "tooltip", js: "tooltip", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
7647+ { json: "x", js: "x", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
7648+ { json: "x2", js: "x2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
7649+ { json: "y", js: "y", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
7650+ { json: "y2", js: "y2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
67947651 ], false),
6795- "MarkPropDefWithCondition": o([
7652+ "MarkPropFieldDefWithCondition": o([
67967653 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
67977654 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
6798- { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateMarkPropFieldDefClass"))) },
7655+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
67997656 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
68007657 { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
68017658 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
6802- { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
7659+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
68037660 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6804- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6805- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7661+ { json: "type", js: "type", typ: r("Type") },
68067662 ], false),
68077663 "BinParams": o([
68087664 { json: "base", js: "base", typ: u(undefined, 3.14) },
@@ -6814,26 +7670,23 @@ const typeMap: any = {
68147670 { json: "step", js: "step", typ: u(undefined, 3.14) },
68157671 { json: "steps", js: "steps", typ: u(undefined, a(3.14)) },
68167672 ], false),
6817- "ConditionalValueDef": o([
6818- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
7673+ "ConditionalPredicateValueDef": o([
7674+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
68197675 { json: "value", js: "value", typ: u(true, 3.14, "") },
6820- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
68217676 ], false),
6822- "Selection": o([
6823- { json: "not", js: "not", typ: u(undefined, u(r("Selection"), "")) },
6824- { json: "and", js: "and", typ: u(undefined, a(u(r("Selection"), ""))) },
6825- { json: "or", js: "or", typ: u(undefined, a(u(r("Selection"), ""))) },
7677+ "LogicalOrPredicate": o([
7678+ { json: "or", js: "or", typ: a(u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "")) },
68267679 ], false),
6827- "Predicate": o([
6828- { json: "not", js: "not", typ: u(undefined, u(r("Predicate"), "")) },
6829- { json: "and", js: "and", typ: u(undefined, a(u(r("Predicate"), ""))) },
6830- { json: "or", js: "or", typ: u(undefined, a(u(r("Predicate"), ""))) },
6831- { json: "equal", js: "equal", typ: u(undefined, u(true, r("DateTime"), 3.14, "")) },
6832- { json: "field", js: "field", typ: u(undefined, "") },
7680+ "LogicalAndPredicate": o([
7681+ { json: "and", js: "and", typ: a(u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "")) },
7682+ ], false),
7683+ "LogicalNotPredicate": o([
7684+ { json: "not", js: "not", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
7685+ ], false),
7686+ "FieldEqualPredicate": o([
7687+ { json: "equal", js: "equal", typ: u(true, r("DateTime"), 3.14, "") },
7688+ { json: "field", js: "field", typ: "" },
68337689 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6834- { json: "range", js: "range", typ: u(undefined, a(u(r("DateTime"), 3.14, null))) },
6835- { json: "oneOf", js: "oneOf", typ: u(undefined, a(u(true, r("DateTime"), 3.14, ""))) },
6836- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
68377690 ], false),
68387691 "DateTime": o([
68397692 { json: "date", js: "date", typ: u(undefined, 3.14) },
@@ -6847,18 +7700,31 @@ const typeMap: any = {
68477700 { json: "utc", js: "utc", typ: u(undefined, true) },
68487701 { json: "year", js: "year", typ: u(undefined, 3.14) },
68497702 ], false),
6850- "ConditionalPredicateMarkPropFieldDefClass": o([
6851- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
6852- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6853- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
6854- { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
6855- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
6856- { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
6857- { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
6858- { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
6859- { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
7703+ "FieldRangePredicate": o([
7704+ { json: "field", js: "field", typ: "" },
7705+ { json: "range", js: "range", typ: a(u(r("DateTime"), 3.14, null)) },
7706+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7707+ ], false),
7708+ "FieldOneOfPredicate": o([
7709+ { json: "field", js: "field", typ: "" },
7710+ { json: "oneOf", js: "oneOf", typ: a(u(true, r("DateTime"), 3.14, "")) },
68607711 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6861- { json: "type", js: "type", typ: u(undefined, r("Type")) },
7712+ ], false),
7713+ "SelectionPredicate": o([
7714+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
7715+ ], false),
7716+ "SelectionOr": o([
7717+ { json: "or", js: "or", typ: a(u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "")) },
7718+ ], false),
7719+ "SelectionAnd": o([
7720+ { json: "and", js: "and", typ: a(u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "")) },
7721+ ], false),
7722+ "SelectionNot": o([
7723+ { json: "not", js: "not", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
7724+ ], false),
7725+ "ConditionalSelectionValueDef": o([
7726+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
7727+ { json: "value", js: "value", typ: u(true, 3.14, "") },
68627728 ], false),
68637729 "RepeatRef": o([
68647730 { json: "repeat", js: "repeat", typ: r("RepeatEnum") },
@@ -6878,7 +7744,7 @@ const typeMap: any = {
68787744 "Scale": o([
68797745 { json: "base", js: "base", typ: u(undefined, 3.14) },
68807746 { json: "clamp", js: "clamp", typ: u(undefined, true) },
6881- { json: "domain", js: "domain", typ: u(undefined, u(a(u(true, r("DateTime"), 3.14, "")), r("DomainClass"), r("Domain"))) },
7747+ { json: "domain", js: "domain", typ: u(undefined, u(a(u(true, r("DateTime"), 3.14, "")), r("PurpleSelectionDomain"), r("FluffySelectionDomain"), r("Domain"))) },
68827748 { json: "exponent", js: "exponent", typ: u(undefined, 3.14) },
68837749 { json: "interpolate", js: "interpolate", typ: u(undefined, u(r("InterpolateParams"), r("Interpolate"))) },
68847750 { json: "nice", js: "nice", typ: u(undefined, u(true, r("NiceClass"), 3.14, r("NiceTime"))) },
@@ -6892,10 +7758,13 @@ const typeMap: any = {
68927758 { json: "type", js: "type", typ: u(undefined, r("ScaleType")) },
68937759 { json: "zero", js: "zero", typ: u(undefined, true) },
68947760 ], false),
6895- "DomainClass": o([
7761+ "PurpleSelectionDomain": o([
68967762 { json: "field", js: "field", typ: u(undefined, "") },
68977763 { json: "selection", js: "selection", typ: "" },
7764+ ], false),
7765+ "FluffySelectionDomain": o([
68987766 { json: "encoding", js: "encoding", typ: u(undefined, "") },
7767+ { json: "selection", js: "selection", typ: "" },
68997768 ], false),
69007769 "InterpolateParams": o([
69017770 { json: "gamma", js: "gamma", typ: u(undefined, 3.14) },
@@ -6909,17 +7778,43 @@ const typeMap: any = {
69097778 { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
69107779 { json: "name", js: "name", typ: "" },
69117780 ], false),
6912- "SortField": o([
7781+ "SortField": o([
7782+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
7783+ { json: "op", js: "op", typ: r("AggregateOp") },
7784+ { json: "order", js: "order", typ: u(undefined, u(r("SortOrderEnum"), null)) },
7785+ ], false),
7786+ "MarkPropValueDefWithCondition": o([
7787+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateMarkPropFieldDef"), r("ConditionalSelectionMarkPropFieldDef"), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
7788+ { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7789+ ], false),
7790+ "ConditionalPredicateMarkPropFieldDef": o([
7791+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
7792+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
7793+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
7794+ { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
7795+ { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
7796+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
7797+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
7798+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7799+ { json: "type", js: "type", typ: r("Type") },
7800+ ], false),
7801+ "ConditionalSelectionMarkPropFieldDef": o([
7802+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
7803+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69137804 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
6914- { json: "op", js: "op", typ: r("AggregateOp") },
6915- { json: "order", js: "order", typ: u(undefined, u(r("SortEnum"), null)) },
7805+ { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
7806+ { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
7807+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
7808+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
7809+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7810+ { json: "type", js: "type", typ: r("Type") },
69167811 ], false),
69177812 "FacetFieldDef": o([
69187813 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69197814 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69207815 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69217816 { json: "header", js: "header", typ: u(undefined, r("Header")) },
6922- { json: "sort", js: "sort", typ: u(undefined, u(r("SortEnum"), null)) },
7817+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortOrderEnum"), null)) },
69237818 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
69247819 { json: "type", js: "type", typ: r("Type") },
69257820 ], false),
@@ -6935,65 +7830,83 @@ const typeMap: any = {
69357830 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
69367831 { json: "type", js: "type", typ: r("Type") },
69377832 ], false),
6938- "DefWithCondition": o([
7833+ "FieldDefWithCondition": o([
69397834 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69407835 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
6941- { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateFieldDefClass"))) },
7836+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
69427837 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69437838 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6944- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6945- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7839+ { json: "type", js: "type", typ: r("Type") },
69467840 ], false),
6947- "ConditionalPredicateFieldDefClass": o([
6948- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
7841+ "ValueDefWithCondition": o([
7842+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateFieldDef"), r("ConditionalSelectionFieldDef"), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
69497843 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6950- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
7844+ ], false),
7845+ "ConditionalPredicateFieldDef": o([
7846+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
7847+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
7848+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
7849+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
7850+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7851+ { json: "type", js: "type", typ: r("Type") },
7852+ ], false),
7853+ "ConditionalSelectionFieldDef": o([
69517854 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69527855 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69537856 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
7857+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
69547858 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6955- { json: "type", js: "type", typ: u(undefined, r("Type")) },
7859+ { json: "type", js: "type", typ: r("Type") },
69567860 ], false),
69577861 "OrderFieldDef": o([
69587862 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69597863 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69607864 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
6961- { json: "sort", js: "sort", typ: u(undefined, u(r("SortEnum"), null)) },
7865+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortOrderEnum"), null)) },
69627866 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
69637867 { json: "type", js: "type", typ: r("Type") },
69647868 ], false),
6965- "TextDefWithCondition": o([
7869+ "TextFieldDefWithCondition": o([
69667870 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69677871 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
6968- { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateTextFieldDefClass"))) },
7872+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
69697873 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69707874 { json: "format", js: "format", typ: u(undefined, "") },
69717875 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6972- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6973- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7876+ { json: "type", js: "type", typ: r("Type") },
69747877 ], false),
6975- "ConditionalPredicateTextFieldDefClass": o([
6976- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
7878+ "TextValueDefWithCondition": o([
7879+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateTextFieldDef"), r("ConditionalSelectionTextFieldDef"), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
69777880 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6978- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
7881+ ], false),
7882+ "ConditionalPredicateTextFieldDef": o([
7883+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
7884+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
7885+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
7886+ { json: "format", js: "format", typ: u(undefined, "") },
7887+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
7888+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7889+ { json: "type", js: "type", typ: r("Type") },
7890+ ], false),
7891+ "ConditionalSelectionTextFieldDef": o([
69797892 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69807893 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69817894 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69827895 { json: "format", js: "format", typ: u(undefined, "") },
7896+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
69837897 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6984- { json: "type", js: "type", typ: u(undefined, r("Type")) },
7898+ { json: "type", js: "type", typ: r("Type") },
69857899 ], false),
6986- "XClass": o([
7900+ "PositionFieldDef": o([
69877901 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69887902 { json: "axis", js: "axis", typ: u(undefined, u(r("Axis"), null)) },
69897903 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69907904 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69917905 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
6992- { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
7906+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
69937907 { json: "stack", js: "stack", typ: u(undefined, u(r("StackOffset"), null)) },
69947908 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6995- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6996- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7909+ { json: "type", js: "type", typ: r("Type") },
69977910 ], false),
69987911 "Axis": o([
69997912 { json: "domain", js: "domain", typ: u(undefined, true) },
@@ -7019,67 +7932,8 @@ const typeMap: any = {
70197932 { json: "values", js: "values", typ: u(undefined, a(u(r("DateTime"), 3.14))) },
70207933 { json: "zindex", js: "zindex", typ: u(undefined, 3.14) },
70217934 ], false),
7022- "X2Class": o([
7023- { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
7024- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
7025- { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
7026- { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7027- { json: "type", js: "type", typ: u(undefined, r("Type")) },
7028- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7029- ], false),
7030- "FacetMapping": o([
7031- { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
7032- { json: "row", js: "row", typ: u(undefined, r("FacetFieldDef")) },
7033- ], false),
7034- "Spec": o([
7035- { json: "data", js: "data", typ: u(undefined, r("Data")) },
7036- { json: "description", js: "description", typ: u(undefined, "") },
7037- { json: "height", js: "height", typ: u(undefined, 3.14) },
7038- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
7039- { json: "name", js: "name", typ: u(undefined, "") },
7040- { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
7041- { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
7042- { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
7043- { json: "width", js: "width", typ: u(undefined, 3.14) },
7044- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
7045- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
7046- { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
7047- { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
7048- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
7049- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
7050- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
7051- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
7052- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
7053- ], false),
7054- "Encoding": o([
7055- { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) },
7056- { json: "detail", js: "detail", typ: u(undefined, u(a(r("FieldDef")), r("FieldDef"))) },
7057- { json: "href", js: "href", typ: u(undefined, r("DefWithCondition")) },
7058- { json: "opacity", js: "opacity", typ: u(undefined, r("MarkPropDefWithCondition")) },
7059- { json: "order", js: "order", typ: u(undefined, u(a(r("OrderFieldDef")), r("OrderFieldDef"))) },
7060- { json: "shape", js: "shape", typ: u(undefined, r("MarkPropDefWithCondition")) },
7061- { json: "size", js: "size", typ: u(undefined, r("MarkPropDefWithCondition")) },
7062- { json: "text", js: "text", typ: u(undefined, r("TextDefWithCondition")) },
7063- { json: "tooltip", js: "tooltip", typ: u(undefined, r("TextDefWithCondition")) },
7064- { json: "x", js: "x", typ: u(undefined, r("XClass")) },
7065- { json: "x2", js: "x2", typ: u(undefined, r("X2Class")) },
7066- { json: "y", js: "y", typ: u(undefined, r("XClass")) },
7067- { json: "y2", js: "y2", typ: u(undefined, r("X2Class")) },
7068- ], false),
7069- "LayerSpec": o([
7070- { json: "data", js: "data", typ: u(undefined, r("Data")) },
7071- { json: "description", js: "description", typ: u(undefined, "") },
7072- { json: "height", js: "height", typ: u(undefined, 3.14) },
7073- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
7074- { json: "name", js: "name", typ: u(undefined, "") },
7075- { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
7076- { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
7077- { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
7078- { json: "width", js: "width", typ: u(undefined, 3.14) },
7079- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
7080- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
7081- { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
7082- { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
7935+ "ValueDef": o([
7936+ { json: "value", js: "value", typ: u(true, 3.14, "") },
70837937 ], false),
70847938 "MarkDef": o([
70857939 { json: "align", js: "align", typ: u(undefined, r("HorizontalAlign")) },
@@ -7136,41 +7990,36 @@ const typeMap: any = {
71367990 "FluffyPrecision": o([
71377991 { json: "length", js: "length", typ: 3.14 },
71387992 ], ""),
7139- "Resolve": o([
7140- { json: "axis", js: "axis", typ: u(undefined, r("AxisResolveMap")) },
7141- { json: "legend", js: "legend", typ: u(undefined, r("LegendResolveMap")) },
7142- { json: "scale", js: "scale", typ: u(undefined, r("ScaleResolveMap")) },
7143- ], false),
7144- "AxisResolveMap": o([
7145- { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
7146- { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
7147- ], false),
7148- "LegendResolveMap": o([
7149- { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
7150- { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
7151- { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
7152- { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
7153- ], false),
7154- "ScaleResolveMap": o([
7155- { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
7156- { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
7157- { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
7158- { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
7159- { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
7160- { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
7993+ "SingleSelection": o([
7994+ { json: "bind", js: "bind", typ: u(undefined, m(u(r("VGCheckboxBinding"), r("VGRadioBinding"), r("VGSelectBinding"), r("VGRangeBinding"), r("VGGenericBinding")))) },
7995+ { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
7996+ { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
7997+ { json: "fields", js: "fields", typ: u(undefined, a("")) },
7998+ { json: "nearest", js: "nearest", typ: u(undefined, true) },
7999+ { json: "on", js: "on", typ: u(undefined, "any") },
8000+ { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
8001+ { json: "type", js: "type", typ: r("StickyType") },
71618002 ], false),
7162- "SelectionDef": o([
7163- { json: "bind", js: "bind", typ: u(undefined, u(r("BindEnum"), m(r("VGBinding")))) },
8003+ "MultiSelection": o([
71648004 { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
71658005 { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
71668006 { json: "fields", js: "fields", typ: u(undefined, a("")) },
71678007 { json: "nearest", js: "nearest", typ: u(undefined, true) },
71688008 { json: "on", js: "on", typ: u(undefined, "any") },
71698009 { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
7170- { json: "type", js: "type", typ: r("SelectionDefType") },
71718010 { json: "toggle", js: "toggle", typ: u(undefined, u(true, "")) },
8011+ { json: "type", js: "type", typ: r("IndigoType") },
8012+ ], false),
8013+ "IntervalSelection": o([
8014+ { json: "bind", js: "bind", typ: u(undefined, r("Bind")) },
8015+ { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
8016+ { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
8017+ { json: "fields", js: "fields", typ: u(undefined, a("")) },
71728018 { json: "mark", js: "mark", typ: u(undefined, r("BrushConfig")) },
8019+ { json: "on", js: "on", typ: u(undefined, "any") },
8020+ { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
71738021 { json: "translate", js: "translate", typ: u(undefined, u(true, "")) },
8022+ { json: "type", js: "type", typ: r("IndecentType") },
71748023 { json: "zoom", js: "zoom", typ: u(undefined, u(true, "")) },
71758024 ], false),
71768025 "TitleParams": o([
@@ -7180,17 +8029,36 @@ const typeMap: any = {
71808029 { json: "style", js: "style", typ: u(undefined, u(a(""), "")) },
71818030 { json: "text", js: "text", typ: "" },
71828031 ], false),
7183- "Transform": o([
7184- { json: "filter", js: "filter", typ: u(undefined, u(r("Predicate"), "")) },
8032+ "FilterTransform": o([
8033+ { json: "filter", js: "filter", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
8034+ ], false),
8035+ "CalculateTransform": o([
8036+ { json: "as", js: "as", typ: "" },
8037+ { json: "calculate", js: "calculate", typ: "" },
8038+ ], false),
8039+ "LookupTransform": o([
71858040 { json: "as", js: "as", typ: u(undefined, u(a(""), "")) },
7186- { json: "calculate", js: "calculate", typ: u(undefined, "") },
71878041 { json: "default", js: "default", typ: u(undefined, "") },
7188- { json: "from", js: "from", typ: u(undefined, r("LookupData")) },
7189- { json: "lookup", js: "lookup", typ: u(undefined, "") },
7190- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
7191- { json: "field", js: "field", typ: u(undefined, "") },
7192- { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7193- { json: "aggregate", js: "aggregate", typ: u(undefined, a(r("AggregatedFieldDef"))) },
8042+ { json: "from", js: "from", typ: r("LookupData") },
8043+ { json: "lookup", js: "lookup", typ: "" },
8044+ ], false),
8045+ "LookupData": o([
8046+ { json: "data", js: "data", typ: u(r("URLData"), r("InlineData"), r("NamedData")) },
8047+ { json: "fields", js: "fields", typ: u(undefined, a("")) },
8048+ { json: "key", js: "key", typ: "" },
8049+ ], false),
8050+ "BinTransform": o([
8051+ { json: "as", js: "as", typ: "" },
8052+ { json: "bin", js: "bin", typ: u(true, r("BinParams")) },
8053+ { json: "field", js: "field", typ: "" },
8054+ ], false),
8055+ "TimeUnitTransform": o([
8056+ { json: "as", js: "as", typ: "" },
8057+ { json: "field", js: "field", typ: "" },
8058+ { json: "timeUnit", js: "timeUnit", typ: r("TimeUnit") },
8059+ ], false),
8060+ "AggregateTransform": o([
8061+ { json: "aggregate", js: "aggregate", typ: a(r("AggregatedFieldDef")) },
71948062 { json: "groupby", js: "groupby", typ: u(undefined, a("")) },
71958063 ], false),
71968064 "AggregatedFieldDef": o([
@@ -7198,15 +8066,188 @@ const typeMap: any = {
71988066 { json: "field", js: "field", typ: "" },
71998067 { json: "op", js: "op", typ: r("AggregateOp") },
72008068 ], false),
7201- "LookupData": o([
7202- { json: "data", js: "data", typ: r("Data") },
7203- { json: "fields", js: "fields", typ: u(undefined, a("")) },
7204- { json: "key", js: "key", typ: "" },
8069+ "TopLevelLayerSpec": o([
8070+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
8071+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
8072+ { json: "background", js: "background", typ: u(undefined, "") },
8073+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
8074+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8075+ { json: "description", js: "description", typ: u(undefined, "") },
8076+ { json: "height", js: "height", typ: u(undefined, 3.14) },
8077+ { json: "layer", js: "layer", typ: a(u(r("LayerSpec"), r("CompositeUnitSpecAlias"))) },
8078+ { json: "name", js: "name", typ: u(undefined, "") },
8079+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
8080+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8081+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8082+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8083+ { json: "width", js: "width", typ: u(undefined, 3.14) },
8084+ ], false),
8085+ "LayerSpec": o([
8086+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8087+ { json: "description", js: "description", typ: u(undefined, "") },
8088+ { json: "height", js: "height", typ: u(undefined, 3.14) },
8089+ { json: "layer", js: "layer", typ: a(u(r("LayerSpec"), r("CompositeUnitSpecAlias"))) },
8090+ { json: "name", js: "name", typ: u(undefined, "") },
8091+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8092+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8093+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8094+ { json: "width", js: "width", typ: u(undefined, 3.14) },
8095+ ], false),
8096+ "Resolve": o([
8097+ { json: "axis", js: "axis", typ: u(undefined, r("AxisResolveMap")) },
8098+ { json: "legend", js: "legend", typ: u(undefined, r("LegendResolveMap")) },
8099+ { json: "scale", js: "scale", typ: u(undefined, r("ScaleResolveMap")) },
8100+ ], false),
8101+ "AxisResolveMap": o([
8102+ { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
8103+ { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
8104+ ], false),
8105+ "LegendResolveMap": o([
8106+ { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
8107+ { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
8108+ { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
8109+ { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
8110+ ], false),
8111+ "ScaleResolveMap": o([
8112+ { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
8113+ { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
8114+ { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
8115+ { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
8116+ { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
8117+ { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
8118+ ], false),
8119+ "CompositeUnitSpecAlias": o([
8120+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8121+ { json: "description", js: "description", typ: u(undefined, "") },
8122+ { json: "encoding", js: "encoding", typ: r("Encoding") },
8123+ { json: "height", js: "height", typ: u(undefined, 3.14) },
8124+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
8125+ { json: "name", js: "name", typ: u(undefined, "") },
8126+ { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
8127+ { json: "selection", js: "selection", typ: u(undefined, m(u(r("SingleSelection"), r("MultiSelection"), r("IntervalSelection")))) },
8128+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8129+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8130+ { json: "width", js: "width", typ: u(undefined, 3.14) },
8131+ ], false),
8132+ "Encoding": o([
8133+ { json: "color", js: "color", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
8134+ { json: "detail", js: "detail", typ: u(undefined, u(a(r("FieldDef")), r("FieldDef"))) },
8135+ { json: "href", js: "href", typ: u(undefined, u(r("FieldDefWithCondition"), r("ValueDefWithCondition"))) },
8136+ { json: "opacity", js: "opacity", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
8137+ { json: "order", js: "order", typ: u(undefined, u(a(r("OrderFieldDef")), r("OrderFieldDef"))) },
8138+ { json: "shape", js: "shape", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
8139+ { json: "size", js: "size", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
8140+ { json: "text", js: "text", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
8141+ { json: "tooltip", js: "tooltip", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
8142+ { json: "x", js: "x", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
8143+ { json: "x2", js: "x2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
8144+ { json: "y", js: "y", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
8145+ { json: "y2", js: "y2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
8146+ ], false),
8147+ "TopLevelFacetSpec": o([
8148+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
8149+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
8150+ { json: "background", js: "background", typ: u(undefined, "") },
8151+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
8152+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8153+ { json: "description", js: "description", typ: u(undefined, "") },
8154+ { json: "facet", js: "facet", typ: r("FacetMapping") },
8155+ { json: "name", js: "name", typ: u(undefined, "") },
8156+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
8157+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8158+ { json: "spec", js: "spec", typ: u(r("LayerSpec"), r("CompositeUnitSpecAlias")) },
8159+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8160+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8161+ ], false),
8162+ "FacetMapping": o([
8163+ { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
8164+ { json: "row", js: "row", typ: u(undefined, r("FacetFieldDef")) },
8165+ ], false),
8166+ "TopLevelRepeatSpec": o([
8167+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
8168+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
8169+ { json: "background", js: "background", typ: u(undefined, "") },
8170+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
8171+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8172+ { json: "description", js: "description", typ: u(undefined, "") },
8173+ { json: "name", js: "name", typ: u(undefined, "") },
8174+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
8175+ { json: "repeat", js: "repeat", typ: r("Repeat") },
8176+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8177+ { json: "spec", js: "spec", typ: u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec")) },
8178+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8179+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
72058180 ], false),
72068181 "Repeat": o([
72078182 { json: "column", js: "column", typ: u(undefined, a("")) },
72088183 { json: "row", js: "row", typ: u(undefined, a("")) },
72098184 ], false),
8185+ "HConcatSpec": o([
8186+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8187+ { json: "description", js: "description", typ: u(undefined, "") },
8188+ { json: "hconcat", js: "hconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
8189+ { json: "name", js: "name", typ: u(undefined, "") },
8190+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8191+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8192+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8193+ ], false),
8194+ "VConcatSpec": o([
8195+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8196+ { json: "description", js: "description", typ: u(undefined, "") },
8197+ { json: "name", js: "name", typ: u(undefined, "") },
8198+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8199+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8200+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8201+ { json: "vconcat", js: "vconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
8202+ ], false),
8203+ "RepeatSpec": o([
8204+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8205+ { json: "description", js: "description", typ: u(undefined, "") },
8206+ { json: "name", js: "name", typ: u(undefined, "") },
8207+ { json: "repeat", js: "repeat", typ: r("Repeat") },
8208+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8209+ { json: "spec", js: "spec", typ: u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec")) },
8210+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8211+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8212+ ], false),
8213+ "FacetSpec": o([
8214+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8215+ { json: "description", js: "description", typ: u(undefined, "") },
8216+ { json: "facet", js: "facet", typ: r("FacetMapping") },
8217+ { json: "name", js: "name", typ: u(undefined, "") },
8218+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8219+ { json: "spec", js: "spec", typ: u(r("LayerSpec"), r("CompositeUnitSpecAlias")) },
8220+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8221+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8222+ ], false),
8223+ "TopLevelVConcatSpec": o([
8224+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
8225+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
8226+ { json: "background", js: "background", typ: u(undefined, "") },
8227+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
8228+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8229+ { json: "description", js: "description", typ: u(undefined, "") },
8230+ { json: "name", js: "name", typ: u(undefined, "") },
8231+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
8232+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8233+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8234+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8235+ { json: "vconcat", js: "vconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
8236+ ], false),
8237+ "TopLevelHConcatSpec": o([
8238+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
8239+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
8240+ { json: "background", js: "background", typ: u(undefined, "") },
8241+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
8242+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
8243+ { json: "description", js: "description", typ: u(undefined, "") },
8244+ { json: "hconcat", js: "hconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
8245+ { json: "name", js: "name", typ: u(undefined, "") },
8246+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
8247+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
8248+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
8249+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
8250+ ], false),
72108251 "Contains": [
72118252 "content",
72128253 "padding",
@@ -7327,7 +8368,7 @@ const typeMap: any = {
73278368 "stereographic",
73288369 "transverseMercator",
73298370 ],
7330- "BindEnum": [
8371+ "Bind": [
73318372 "scales",
73328373 ],
73338374 "Empty": [
@@ -7354,6 +8395,18 @@ const typeMap: any = {
73548395 "union",
73558396 "intersect",
73568397 ],
8398+ "PurpleInput": [
8399+ "checkbox",
8400+ ],
8401+ "FluffyInput": [
8402+ "radio",
8403+ ],
8404+ "TentacledInput": [
8405+ "select",
8406+ ],
8407+ "StickyInput": [
8408+ "range",
8409+ ],
73578410 "StackOffset": [
73588411 "zero",
73598412 "center",
@@ -7373,10 +8426,14 @@ const typeMap: any = {
73738426 "ParseEnum": [
73748427 "auto",
73758428 ],
7376- "DataFormatType": [
8429+ "PurpleType": [
73778430 "csv",
73788431 "tsv",
8432+ ],
8433+ "FluffyType": [
73798434 "json",
8435+ ],
8436+ "TentacledType": [
73808437 "topojson",
73818438 ],
73828439 "AggregateOp": [
@@ -7487,7 +8544,7 @@ const typeMap: any = {
74878544 "point",
74888545 "band",
74898546 ],
7490- "SortEnum": [
8547+ "SortOrderEnum": [
74918548 "ascending",
74928549 "descending",
74938550 ],
@@ -7513,15 +8570,19 @@ const typeMap: any = {
75138570 "square",
75148571 "geoshape",
75158572 ],
7516- "ResolveMode": [
7517- "independent",
7518- "shared",
7519- ],
7520- "SelectionDefType": [
8573+ "StickyType": [
75218574 "single",
8575+ ],
8576+ "IndigoType": [
75228577 "multi",
8578+ ],
8579+ "IndecentType": [
75238580 "interval",
75248581 ],
8582+ "ResolveMode": [
8583+ "independent",
8584+ "shared",
8585+ ],
75258586 };
75268587
75278588 module.exports = {
Aschema-golang/test/inputs/schema/one-of-objects.schema/default/quicktype.go+30 −0
@@ -0,0 +1,30 @@
1+// Code generated from JSON Schema using quicktype. DO NOT EDIT.
2+// To parse and unparse this JSON data, add this code to your project and do:
3+//
4+// topLevel, err := UnmarshalTopLevel(bytes)
5+// bytes, err = topLevel.Marshal()
6+
7+package main
8+
9+import "encoding/json"
10+
11+func UnmarshalTopLevel(data []byte) (TopLevel, error) {
12+ var r TopLevel
13+ err := json.Unmarshal(data, &r)
14+ return r, err
15+}
16+
17+func (r *TopLevel) Marshal() ([]byte, error) {
18+ return json.Marshal(r)
19+}
20+
21+type TopLevel struct {
22+ Items []Item `json:"items"`
23+}
24+
25+type Item struct {
26+ Aa *string `json:"aa,omitempty"`
27+ Bb *string `json:"bb,omitempty"`
28+ Cc *string `json:"cc,omitempty"`
29+ DD *string `json:"dd,omitempty"`
30+}
Aschema-haskell/test/inputs/schema/one-of-objects.schema/default/QuickType.hs+54 −0
@@ -0,0 +1,54 @@
1+{-# LANGUAGE StrictData #-}
2+{-# LANGUAGE OverloadedStrings #-}
3+
4+module QuickType
5+ ( QuickType (..)
6+ , Item (..)
7+ , decodeTopLevel
8+ ) where
9+
10+import Data.Aeson
11+import Data.Aeson.Types (emptyObject)
12+import Data.ByteString.Lazy (ByteString)
13+import Data.HashMap.Strict (HashMap)
14+import Data.Text (Text)
15+
16+data QuickType = QuickType
17+ { itemsQuickType :: [Item]
18+ } deriving (Show)
19+
20+data Item = Item
21+ { aaItem :: Maybe Text
22+ , bbItem :: Maybe Text
23+ , ccItem :: Maybe Text
24+ , ddItem :: Maybe Text
25+ } deriving (Show)
26+
27+decodeTopLevel :: ByteString -> Maybe QuickType
28+decodeTopLevel = decode
29+
30+instance ToJSON QuickType where
31+ toJSON (QuickType itemsQuickType) =
32+ object
33+ [ "items" .= itemsQuickType
34+ ]
35+
36+instance FromJSON QuickType where
37+ parseJSON (Object v) = QuickType
38+ <$> v .: "items"
39+
40+instance ToJSON Item where
41+ toJSON (Item aaItem bbItem ccItem ddItem) =
42+ object
43+ [ "aa" .= aaItem
44+ , "bb" .= bbItem
45+ , "cc" .= ccItem
46+ , "dd" .= ddItem
47+ ]
48+
49+instance FromJSON Item where
50+ parseJSON (Object v) = Item
51+ <$> v .:? "aa"
52+ <*> v .:? "bb"
53+ <*> v .:? "cc"
54+ <*> v .:? "dd"
Aschema-java-datetime-legacy/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/Converter.java+101 −0
@@ -0,0 +1,101 @@
1+// To use this code, add the following Maven dependency to your project:
2+//
3+//
4+// com.fasterxml.jackson.core : jackson-databind : 2.9.0
5+// com.fasterxml.jackson.datatype : jackson-datatype-jsr310 : 2.9.0
6+//
7+// Import this package:
8+//
9+// import io.quicktype.Converter;
10+//
11+// Then you can deserialize a JSON string with
12+//
13+// TopLevel data = Converter.fromJsonString(jsonString);
14+
15+package io.quicktype;
16+
17+import java.io.IOException;
18+import com.fasterxml.jackson.databind.*;
19+import com.fasterxml.jackson.databind.module.SimpleModule;
20+import com.fasterxml.jackson.core.JsonParser;
21+import com.fasterxml.jackson.core.JsonProcessingException;
22+import java.util.*;
23+import java.time.LocalDate;
24+import java.time.OffsetDateTime;
25+import java.time.OffsetTime;
26+import java.time.ZoneOffset;
27+import java.time.ZonedDateTime;
28+import java.time.format.DateTimeFormatter;
29+import java.time.format.DateTimeFormatterBuilder;
30+import java.time.temporal.ChronoField;
31+
32+public class Converter {
33+ // Date-time helpers
34+
35+ private static final DateTimeFormatter DATE_TIME_FORMATTER = new DateTimeFormatterBuilder()
36+ .appendOptional(DateTimeFormatter.ISO_DATE_TIME)
37+ .appendOptional(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
38+ .appendOptional(DateTimeFormatter.ISO_INSTANT)
39+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SX"))
40+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssX"))
41+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
42+ .toFormatter()
43+ .withZone(ZoneOffset.UTC);
44+
45+ public static OffsetDateTime parseDateTimeString(String str) {
46+ return ZonedDateTime.from(Converter.DATE_TIME_FORMATTER.parse(str)).toOffsetDateTime();
47+ }
48+
49+ private static final DateTimeFormatter TIME_FORMATTER = new DateTimeFormatterBuilder()
50+ .appendOptional(DateTimeFormatter.ISO_TIME)
51+ .appendOptional(DateTimeFormatter.ISO_OFFSET_TIME)
52+ .parseDefaulting(ChronoField.YEAR, 2020)
53+ .parseDefaulting(ChronoField.MONTH_OF_YEAR, 1)
54+ .parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
55+ .toFormatter()
56+ .withZone(ZoneOffset.UTC);
57+
58+ public static OffsetTime parseTimeString(String str) {
59+ return ZonedDateTime.from(Converter.TIME_FORMATTER.parse(str)).toOffsetDateTime().toOffsetTime();
60+ }
61+ // Serialize/deserialize helpers
62+
63+ public static TopLevel fromJsonString(String json) throws IOException {
64+ return getObjectReader().readValue(json);
65+ }
66+
67+ public static String toJsonString(TopLevel obj) throws JsonProcessingException {
68+ return getObjectWriter().writeValueAsString(obj);
69+ }
70+
71+ private static ObjectReader reader;
72+ private static ObjectWriter writer;
73+
74+ private static void instantiateMapper() {
75+ ObjectMapper mapper = new ObjectMapper();
76+ mapper.findAndRegisterModules();
77+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
78+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
79+ SimpleModule module = new SimpleModule();
80+ module.addDeserializer(OffsetDateTime.class, new JsonDeserializer<OffsetDateTime>() {
81+ @Override
82+ public OffsetDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
83+ String value = jsonParser.getText();
84+ return Converter.parseDateTimeString(value);
85+ }
86+ });
87+ mapper.registerModule(module);
88+ reader = mapper.readerFor(TopLevel.class);
89+ writer = mapper.writerFor(TopLevel.class);
90+ }
91+
92+ private static ObjectReader getObjectReader() {
93+ if (reader == null) instantiateMapper();
94+ return reader;
95+ }
96+
97+ private static ObjectWriter getObjectWriter() {
98+ if (writer == null) instantiateMapper();
99+ return writer;
100+ }
101+}
Aschema-java-datetime-legacy/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/Item.java+30 −0
@@ -0,0 +1,30 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class Item {
6+ private String aa;
7+ private String bb;
8+ private String cc;
9+ private String dd;
10+
11+ @JsonProperty("aa")
12+ public String getAa() { return aa; }
13+ @JsonProperty("aa")
14+ public void setAa(String value) { this.aa = value; }
15+
16+ @JsonProperty("bb")
17+ public String getBb() { return bb; }
18+ @JsonProperty("bb")
19+ public void setBb(String value) { this.bb = value; }
20+
21+ @JsonProperty("cc")
22+ public String getCc() { return cc; }
23+ @JsonProperty("cc")
24+ public void setCc(String value) { this.cc = value; }
25+
26+ @JsonProperty("dd")
27+ public String getDD() { return dd; }
28+ @JsonProperty("dd")
29+ public void setDD(String value) { this.dd = value; }
30+}
Aschema-java-datetime-legacy/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/TopLevel.java+13 −0
@@ -0,0 +1,13 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+import java.util.List;
5+
6+public class TopLevel {
7+ private List<Item> items;
8+
9+ @JsonProperty("items")
10+ public List<Item> getItems() { return items; }
11+ @JsonProperty("items")
12+ public void setItems(List<Item> value) { this.items = value; }
13+}
Aschema-java-lombok/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/Converter.java+121 −0
@@ -0,0 +1,121 @@
1+// To use this code, add the following Maven dependency to your project:
2+//
3+//
4+// com.fasterxml.jackson.core : jackson-databind : 2.9.0
5+//
6+//
7+// Import this package:
8+//
9+// import io.quicktype.Converter;
10+//
11+// Then you can deserialize a JSON string with
12+//
13+// TopLevel data = Converter.fromJsonString(jsonString);
14+
15+package io.quicktype;
16+
17+import java.io.IOException;
18+import com.fasterxml.jackson.databind.*;
19+import com.fasterxml.jackson.databind.module.SimpleModule;
20+import com.fasterxml.jackson.core.JsonParser;
21+import com.fasterxml.jackson.core.JsonProcessingException;
22+import java.util.*;
23+import java.util.Date;
24+import java.text.SimpleDateFormat;
25+
26+public class Converter {
27+ // Date-time helpers
28+
29+ private static final String[] DATE_TIME_FORMATS = {
30+ "yyyy-MM-dd'T'HH:mm:ss.SX",
31+ "yyyy-MM-dd'T'HH:mm:ss.S",
32+ "yyyy-MM-dd'T'HH:mm:ssX",
33+ "yyyy-MM-dd'T'HH:mm:ss",
34+ "yyyy-MM-dd HH:mm:ss.SX",
35+ "yyyy-MM-dd HH:mm:ss.S",
36+ "yyyy-MM-dd HH:mm:ssX",
37+ "yyyy-MM-dd HH:mm:ss",
38+ "HH:mm:ss.SZ",
39+ "HH:mm:ss.S",
40+ "HH:mm:ssZ",
41+ "HH:mm:ss",
42+ "yyyy-MM-dd",
43+ };
44+
45+ public static Date parseAllDateTimeString(String str) {
46+ for (String format : DATE_TIME_FORMATS) {
47+ try {
48+ return new SimpleDateFormat(format).parse(str);
49+ } catch (Exception ex) {
50+ // Ignored
51+ }
52+ }
53+ return null;
54+ }
55+
56+ public static String serializeDateTime(Date datetime) {
57+ return new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ").format(datetime);
58+ }
59+
60+ public static String serializeDate(Date datetime) {
61+ return new SimpleDateFormat("yyyy-MM-dd").format(datetime);
62+ }
63+
64+ public static String serializeTime(Date datetime) {
65+ return new SimpleDateFormat("hh:mm:ssZ").format(datetime);
66+ }
67+ // Serialize/deserialize helpers
68+
69+ public static TopLevel fromJsonString(String json) throws IOException {
70+ return getObjectReader().readValue(json);
71+ }
72+
73+ public static String toJsonString(TopLevel obj) throws JsonProcessingException {
74+ return getObjectWriter().writeValueAsString(obj);
75+ }
76+
77+ private static ObjectReader reader;
78+ private static ObjectWriter writer;
79+
80+ private static void instantiateMapper() {
81+ ObjectMapper mapper = new ObjectMapper();
82+ mapper.findAndRegisterModules();
83+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
84+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
85+ SimpleModule module = new SimpleModule();
86+ module.addDeserializer(Date.class, new JsonDeserializer<Date>() {
87+ @Override
88+ public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
89+ String value = jsonParser.getText();
90+ return Converter.parseAllDateTimeString(value);
91+ }
92+ });
93+ module.addDeserializer(Date.class, new JsonDeserializer<Date>() {
94+ @Override
95+ public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
96+ String value = jsonParser.getText();
97+ return Converter.parseAllDateTimeString(value);
98+ }
99+ });
100+ module.addDeserializer(Date.class, new JsonDeserializer<Date>() {
101+ @Override
102+ public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
103+ String value = jsonParser.getText();
104+ return Converter.parseAllDateTimeString(value);
105+ }
106+ });
107+ mapper.registerModule(module);
108+ reader = mapper.readerFor(TopLevel.class);
109+ writer = mapper.writerFor(TopLevel.class);
110+ }
111+
112+ private static ObjectReader getObjectReader() {
113+ if (reader == null) instantiateMapper();
114+ return reader;
115+ }
116+
117+ private static ObjectWriter getObjectWriter() {
118+ if (writer == null) instantiateMapper();
119+ return writer;
120+ }
121+}
Aschema-java-lombok/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/Item.java+30 −0
@@ -0,0 +1,30 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class Item {
6+ private String aa;
7+ private String bb;
8+ private String cc;
9+ private String dd;
10+
11+ @JsonProperty("aa")
12+ public String getAa() { return aa; }
13+ @JsonProperty("aa")
14+ public void setAa(String value) { this.aa = value; }
15+
16+ @JsonProperty("bb")
17+ public String getBb() { return bb; }
18+ @JsonProperty("bb")
19+ public void setBb(String value) { this.bb = value; }
20+
21+ @JsonProperty("cc")
22+ public String getCc() { return cc; }
23+ @JsonProperty("cc")
24+ public void setCc(String value) { this.cc = value; }
25+
26+ @JsonProperty("dd")
27+ public String getDD() { return dd; }
28+ @JsonProperty("dd")
29+ public void setDD(String value) { this.dd = value; }
30+}
Aschema-java-lombok/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/TopLevel.java+13 −0
@@ -0,0 +1,13 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+import java.util.List;
5+
6+public class TopLevel {
7+ private List<Item> items;
8+
9+ @JsonProperty("items")
10+ public List<Item> getItems() { return items; }
11+ @JsonProperty("items")
12+ public void setItems(List<Item> value) { this.items = value; }
13+}
Aschema-java/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/Converter.java+101 −0
@@ -0,0 +1,101 @@
1+// To use this code, add the following Maven dependency to your project:
2+//
3+//
4+// com.fasterxml.jackson.core : jackson-databind : 2.9.0
5+// com.fasterxml.jackson.datatype : jackson-datatype-jsr310 : 2.9.0
6+//
7+// Import this package:
8+//
9+// import io.quicktype.Converter;
10+//
11+// Then you can deserialize a JSON string with
12+//
13+// TopLevel data = Converter.fromJsonString(jsonString);
14+
15+package io.quicktype;
16+
17+import java.io.IOException;
18+import com.fasterxml.jackson.databind.*;
19+import com.fasterxml.jackson.databind.module.SimpleModule;
20+import com.fasterxml.jackson.core.JsonParser;
21+import com.fasterxml.jackson.core.JsonProcessingException;
22+import java.util.*;
23+import java.time.LocalDate;
24+import java.time.OffsetDateTime;
25+import java.time.OffsetTime;
26+import java.time.ZoneOffset;
27+import java.time.ZonedDateTime;
28+import java.time.format.DateTimeFormatter;
29+import java.time.format.DateTimeFormatterBuilder;
30+import java.time.temporal.ChronoField;
31+
32+public class Converter {
33+ // Date-time helpers
34+
35+ private static final DateTimeFormatter DATE_TIME_FORMATTER = new DateTimeFormatterBuilder()
36+ .appendOptional(DateTimeFormatter.ISO_DATE_TIME)
37+ .appendOptional(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
38+ .appendOptional(DateTimeFormatter.ISO_INSTANT)
39+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SX"))
40+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssX"))
41+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
42+ .toFormatter()
43+ .withZone(ZoneOffset.UTC);
44+
45+ public static OffsetDateTime parseDateTimeString(String str) {
46+ return ZonedDateTime.from(Converter.DATE_TIME_FORMATTER.parse(str)).toOffsetDateTime();
47+ }
48+
49+ private static final DateTimeFormatter TIME_FORMATTER = new DateTimeFormatterBuilder()
50+ .appendOptional(DateTimeFormatter.ISO_TIME)
51+ .appendOptional(DateTimeFormatter.ISO_OFFSET_TIME)
52+ .parseDefaulting(ChronoField.YEAR, 2020)
53+ .parseDefaulting(ChronoField.MONTH_OF_YEAR, 1)
54+ .parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
55+ .toFormatter()
56+ .withZone(ZoneOffset.UTC);
57+
58+ public static OffsetTime parseTimeString(String str) {
59+ return ZonedDateTime.from(Converter.TIME_FORMATTER.parse(str)).toOffsetDateTime().toOffsetTime();
60+ }
61+ // Serialize/deserialize helpers
62+
63+ public static TopLevel fromJsonString(String json) throws IOException {
64+ return getObjectReader().readValue(json);
65+ }
66+
67+ public static String toJsonString(TopLevel obj) throws JsonProcessingException {
68+ return getObjectWriter().writeValueAsString(obj);
69+ }
70+
71+ private static ObjectReader reader;
72+ private static ObjectWriter writer;
73+
74+ private static void instantiateMapper() {
75+ ObjectMapper mapper = new ObjectMapper();
76+ mapper.findAndRegisterModules();
77+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
78+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
79+ SimpleModule module = new SimpleModule();
80+ module.addDeserializer(OffsetDateTime.class, new JsonDeserializer<OffsetDateTime>() {
81+ @Override
82+ public OffsetDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
83+ String value = jsonParser.getText();
84+ return Converter.parseDateTimeString(value);
85+ }
86+ });
87+ mapper.registerModule(module);
88+ reader = mapper.readerFor(TopLevel.class);
89+ writer = mapper.writerFor(TopLevel.class);
90+ }
91+
92+ private static ObjectReader getObjectReader() {
93+ if (reader == null) instantiateMapper();
94+ return reader;
95+ }
96+
97+ private static ObjectWriter getObjectWriter() {
98+ if (writer == null) instantiateMapper();
99+ return writer;
100+ }
101+}
Aschema-java/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/Item.java+30 −0
@@ -0,0 +1,30 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class Item {
6+ private String aa;
7+ private String bb;
8+ private String cc;
9+ private String dd;
10+
11+ @JsonProperty("aa")
12+ public String getAa() { return aa; }
13+ @JsonProperty("aa")
14+ public void setAa(String value) { this.aa = value; }
15+
16+ @JsonProperty("bb")
17+ public String getBb() { return bb; }
18+ @JsonProperty("bb")
19+ public void setBb(String value) { this.bb = value; }
20+
21+ @JsonProperty("cc")
22+ public String getCc() { return cc; }
23+ @JsonProperty("cc")
24+ public void setCc(String value) { this.cc = value; }
25+
26+ @JsonProperty("dd")
27+ public String getDD() { return dd; }
28+ @JsonProperty("dd")
29+ public void setDD(String value) { this.dd = value; }
30+}
Aschema-java/test/inputs/schema/one-of-objects.schema/default/src/main/java/io/quicktype/TopLevel.java+13 −0
@@ -0,0 +1,13 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+import java.util.List;
5+
6+public class TopLevel {
7+ private List<Item> items;
8+
9+ @JsonProperty("items")
10+ public List<Item> getItems() { return items; }
11+ @JsonProperty("items")
12+ public void setItems(List<Item> value) { this.items = value; }
13+}
Mschema-javascript/test/inputs/schema/class-map-union.schema/default/TopLevel.js+8 −6
@@ -172,13 +172,15 @@ function r(name) {
172172
173173 const typeMap = {
174174 "TopLevel": o([
175- { json: "union", js: "union", typ: u(undefined, r("TopLevelUnion")) },
175+ { json: "union", js: "union", typ: u(undefined, u(r("PurpleUnion"), r("FluffyUnion"), m(true), m(r("UnionValue")))) },
176176 ], false),
177- "TopLevelUnion": o([
178- { json: "foo", js: "foo", typ: u(undefined, u(true, 3.14, r("BarObject"))) },
179- { json: "bar", js: "bar", typ: u(undefined, u(true, r("BarObject"), "")) },
180- ], u(true, r("BarObject"))),
181- "BarObject": o([
177+ "PurpleUnion": o([
178+ { json: "foo", js: "foo", typ: u(undefined, 3.14) },
179+ ], false),
180+ "FluffyUnion": o([
181+ { json: "bar", js: "bar", typ: u(undefined, "") },
182+ ], false),
183+ "UnionValue": o([
182184 { json: "quux", js: "quux", typ: u(undefined, 0) },
183185 ], "any"),
184186 };
Mschema-javascript/test/inputs/schema/nested-intersection-union.schema/default/TopLevel.js+10 −6
@@ -172,13 +172,17 @@ function r(name) {
172172
173173 const typeMap = {
174174 "TopLevel": o([
175- { json: "input", js: "input", typ: a(r("Item")) },
175+ { json: "input", js: "input", typ: a(u(r("Message"), r("FunctionOutput"), r("ReasoningItem"))) },
176176 ], false),
177- "Item": o([
178- { json: "content", js: "content", typ: u(undefined, "") },
179- { json: "id", js: "id", typ: u(undefined, "") },
180- { json: "output", js: "output", typ: u(undefined, "") },
181- { json: "summary", js: "summary", typ: u(undefined, "") },
177+ "Message": o([
178+ { json: "content", js: "content", typ: "" },
179+ ], "any"),
180+ "FunctionOutput": o([
181+ { json: "id", js: "id", typ: "" },
182+ { json: "output", js: "output", typ: "" },
183+ ], "any"),
184+ "ReasoningItem": o([
185+ { json: "summary", js: "summary", typ: "" },
182186 ], "any"),
183187 };
Mschema-javascript/test/inputs/schema/nullable-optional-one-of.schema/default/TopLevel.js+11 −5
@@ -10,11 +10,11 @@
1010 // Converts JSON strings to/from your types
1111 // and asserts the results of JSON.parse at runtime
1212 function toTopLevel(json) {
13- return cast(JSON.parse(json), r("TopLevel"));
13+ return cast(JSON.parse(json), u(r("One"), r("Two")));
1414 }
1515
1616 function topLevelToJson(value) {
17- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
17+ return JSON.stringify(uncast(value, u(r("One"), r("Two"))), null, 2);
1818 }
1919
2020 function invalidValue(typ, val, key, parent = '') {
@@ -171,12 +171,18 @@ function r(name) {
171171 }
172172
173173 const typeMap = {
174- "TopLevel": o([
174+ "One": o([
175+ { json: "b", js: "b", typ: u(null, "") },
176+ { json: "kind", js: "kind", typ: r("PurpleKind") },
177+ ], "any"),
178+ "Two": o([
175179 { json: "b", js: "b", typ: u(undefined, u(null, "")) },
176- { json: "kind", js: "kind", typ: r("Kind") },
180+ { json: "kind", js: "kind", typ: r("FluffyKind") },
177181 ], "any"),
178- "Kind": [
182+ "PurpleKind": [
179183 "one",
184+ ],
185+ "FluffyKind": [
180186 "two",
181187 ],
182188 };
Aschema-javascript/test/inputs/schema/one-of-objects.schema/default/TopLevel.js+190 −0
@@ -0,0 +1,190 @@
1+// To parse this data:
2+//
3+// const Convert = require("./TopLevel");
4+//
5+// const topLevel = Convert.toTopLevel(json);
6+//
7+// These functions will throw an error if the JSON doesn't
8+// match the expected interface, even if the JSON is valid.
9+
10+// Converts JSON strings to/from your types
11+// and asserts the results of JSON.parse at runtime
12+function toTopLevel(json) {
13+ return cast(JSON.parse(json), r("TopLevel"));
14+}
15+
16+function topLevelToJson(value) {
17+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
18+}
19+
20+function invalidValue(typ, val, key, parent = '') {
21+ const prettyTyp = prettyTypeName(typ);
22+ const parentText = parent ? ` on ${parent}` : '';
23+ const keyText = key ? ` for key "${key}"` : '';
24+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
25+}
26+
27+function prettyTypeName(typ) {
28+ if (Array.isArray(typ)) {
29+ if (typ.length === 2 && typ[0] === undefined) {
30+ return `an optional ${prettyTypeName(typ[1])}`;
31+ } else {
32+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
33+ }
34+ } else if (typeof typ === "object" && typ.literal !== undefined) {
35+ return typ.literal;
36+ } else {
37+ return typeof typ;
38+ }
39+}
40+
41+function jsonToJSProps(typ) {
42+ if (typ.jsonToJS === undefined) {
43+ const map = {};
44+ typ.props.forEach((p) => map[p.json] = { key: p.js, typ: p.typ });
45+ typ.jsonToJS = map;
46+ }
47+ return typ.jsonToJS;
48+}
49+
50+function jsToJSONProps(typ) {
51+ if (typ.jsToJSON === undefined) {
52+ const map = {};
53+ typ.props.forEach((p) => map[p.js] = { key: p.json, typ: p.typ });
54+ typ.jsToJSON = map;
55+ }
56+ return typ.jsToJSON;
57+}
58+
59+function transform(val, typ, getProps, key = '', parent = '') {
60+ function transformPrimitive(typ, val) {
61+ if (typeof typ === typeof val) return val;
62+ return invalidValue(typ, val, key, parent);
63+ }
64+
65+ function transformUnion(typs, val) {
66+ // val must validate against one typ in typs
67+ const l = typs.length;
68+ for (let i = 0; i < l; i++) {
69+ const typ = typs[i];
70+ try {
71+ return transform(val, typ, getProps);
72+ } catch (_) {}
73+ }
74+ return invalidValue(typs, val, key, parent);
75+ }
76+
77+ function transformEnum(cases, val) {
78+ if (cases.indexOf(val) !== -1) return val;
79+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
80+ }
81+
82+ function transformArray(typ, val) {
83+ // val must be an array with no invalid elements
84+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
85+ return val.map(el => transform(el, typ, getProps));
86+ }
87+
88+ function transformDate(val) {
89+ if (val === null) {
90+ return null;
91+ }
92+ const d = new Date(val);
93+ if (isNaN(d.valueOf())) {
94+ return invalidValue(l("Date"), val, key, parent);
95+ }
96+ return d;
97+ }
98+
99+ function transformObject(props, additional, val) {
100+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
101+ return invalidValue(l(ref || "object"), val, key, parent);
102+ }
103+ const result = {};
104+ Object.getOwnPropertyNames(props).forEach(key => {
105+ const prop = props[key];
106+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
107+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
108+ });
109+ Object.getOwnPropertyNames(val).forEach(key => {
110+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
111+ result[key] = transform(val[key], additional, getProps, key, ref);
112+ }
113+ });
114+ return result;
115+ }
116+
117+ if (typ === "any") return val;
118+ if (typ === null) {
119+ if (val === null) return val;
120+ return invalidValue(typ, val, key, parent);
121+ }
122+ if (typ === false) return invalidValue(typ, val, key, parent);
123+ let ref = undefined;
124+ while (typeof typ === "object" && typ.ref !== undefined) {
125+ ref = typ.ref;
126+ typ = typeMap[typ.ref];
127+ }
128+ if (Array.isArray(typ)) return transformEnum(typ, val);
129+ if (typeof typ === "object") {
130+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
131+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
132+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
133+ : invalidValue(typ, val, key, parent);
134+ }
135+ // Numbers can be parsed by Date but shouldn't be.
136+ if (typ === Date && typeof val !== "number") return transformDate(val);
137+ return transformPrimitive(typ, val);
138+}
139+
140+function cast(val, typ) {
141+ return transform(val, typ, jsonToJSProps);
142+}
143+
144+function uncast(val, typ) {
145+ return transform(val, typ, jsToJSONProps);
146+}
147+
148+function l(typ) {
149+ return { literal: typ };
150+}
151+
152+function a(typ) {
153+ return { arrayItems: typ };
154+}
155+
156+function u(...typs) {
157+ return { unionMembers: typs };
158+}
159+
160+function o(props, additional) {
161+ return { props, additional };
162+}
163+
164+function m(additional) {
165+ const props = [];
166+ return { props, additional };
167+}
168+
169+function r(name) {
170+ return { ref: name };
171+}
172+
173+const typeMap = {
174+ "TopLevel": o([
175+ { json: "items", js: "items", typ: a(u(r("PurpleItem"), r("FluffyItem"))) },
176+ ], false),
177+ "PurpleItem": o([
178+ { json: "aa", js: "aa", typ: u(undefined, "") },
179+ { json: "bb", js: "bb", typ: u(undefined, "") },
180+ ], false),
181+ "FluffyItem": o([
182+ { json: "cc", js: "cc", typ: u(undefined, "") },
183+ { json: "dd", js: "dd", typ: u(undefined, "") },
184+ ], false),
185+};
186+
187+module.exports = {
188+ "topLevelToJson": topLevelToJson,
189+ "toTopLevel": toTopLevel,
190+};
Mschema-javascript/test/inputs/schema/postman-collection.schema/default/TopLevel.js+6 −4
@@ -10,11 +10,11 @@
1010 // Converts JSON strings to/from your types
1111 // and asserts the results of JSON.parse at runtime
1212 function toTopLevel(json) {
13- return cast(JSON.parse(json), r("TopLevel"));
13+ return cast(JSON.parse(json), u(r("Group"), r("Item")));
1414 }
1515
1616 function topLevelToJson(value) {
17- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
17+ return JSON.stringify(uncast(value, u(r("Group"), r("Item"))), null, 2);
1818 }
1919
2020 function invalidValue(typ, val, key, parent = '') {
@@ -171,8 +171,10 @@ function r(name) {
171171 }
172172
173173 const typeMap = {
174- "TopLevel": o([
175- { json: "item", js: "item", typ: u(undefined, a(r("TopLevel"))) },
174+ "Group": o([
175+ { json: "item", js: "item", typ: u(undefined, a(u(r("Group"), r("Item")))) },
176+ ], "any"),
177+ "Item": o([
176178 { json: "name", js: "name", typ: u(undefined, "") },
177179 { json: "response", js: "response", typ: u(undefined, a(r("Response"))) },
178180 ], "any"),
Mschema-javascript/test/inputs/schema/union.schema/default/TopLevel.js+8 −5
@@ -10,11 +10,11 @@
1010 // Converts JSON strings to/from your types
1111 // and asserts the results of JSON.parse at runtime
1212 function toTopLevel(json) {
13- return cast(JSON.parse(json), a(r("TopLevel")));
13+ return cast(JSON.parse(json), a(u(r("PurpleTopLevel"), r("FluffyTopLevel"))));
1414 }
1515
1616 function topLevelToJson(value) {
17- return JSON.stringify(uncast(value, a(r("TopLevel"))), null, 2);
17+ return JSON.stringify(uncast(value, a(u(r("PurpleTopLevel"), r("FluffyTopLevel")))), null, 2);
1818 }
1919
2020 function invalidValue(typ, val, key, parent = '') {
@@ -171,10 +171,13 @@ function r(name) {
171171 }
172172
173173 const typeMap = {
174- "TopLevel": o([
175- { json: "one", js: "one", typ: u(undefined, 0) },
174+ "PurpleTopLevel": o([
175+ { json: "one", js: "one", typ: 0 },
176+ { json: "two", js: "two", typ: true },
177+ ], "any"),
178+ "FluffyTopLevel": o([
179+ { json: "three", js: "three", typ: 3.14 },
176180 { json: "two", js: "two", typ: true },
177- { json: "three", js: "three", typ: u(undefined, 3.14) },
178181 ], "any"),
179182 };
Mschema-javascript/test/inputs/schema/vega-lite.schema/default/TopLevel.js+442 −217
@@ -10,11 +10,11 @@
1010 // Converts JSON strings to/from your types
1111 // and asserts the results of JSON.parse at runtime
1212 function toTopLevel(json) {
13- return cast(JSON.parse(json), r("TopLevel"));
13+ return cast(JSON.parse(json), u(r("TopLevelFacetedUnitSpec"), r("TopLevelLayerSpec"), r("TopLevelFacetSpec"), r("TopLevelRepeatSpec"), r("TopLevelVConcatSpec"), r("TopLevelHConcatSpec")));
1414 }
1515
1616 function topLevelToJson(value) {
17- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
17+ return JSON.stringify(uncast(value, u(r("TopLevelFacetedUnitSpec"), r("TopLevelLayerSpec"), r("TopLevelFacetSpec"), r("TopLevelRepeatSpec"), r("TopLevelVConcatSpec"), r("TopLevelHConcatSpec"))), null, 2);
1818 }
1919
2020 function invalidValue(typ, val, key, parent = '') {
@@ -171,30 +171,23 @@ function r(name) {
171171 }
172172
173173 const typeMap = {
174- "TopLevel": o([
174+ "TopLevelFacetedUnitSpec": o([
175175 { json: "$schema", js: "$schema", typ: u(undefined, "") },
176176 { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
177177 { json: "background", js: "background", typ: u(undefined, "") },
178178 { json: "config", js: "config", typ: u(undefined, r("Config")) },
179- { json: "data", js: "data", typ: u(undefined, r("Data")) },
179+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
180180 { json: "description", js: "description", typ: u(undefined, "") },
181- { json: "encoding", js: "encoding", typ: u(undefined, r("EncodingWithFacet")) },
181+ { json: "encoding", js: "encoding", typ: r("EncodingWithFacet") },
182182 { json: "height", js: "height", typ: u(undefined, 3.14) },
183- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
183+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
184184 { json: "name", js: "name", typ: u(undefined, "") },
185185 { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
186186 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
187- { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
187+ { json: "selection", js: "selection", typ: u(undefined, m(u(r("SingleSelection"), r("MultiSelection"), r("IntervalSelection")))) },
188188 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
189- { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
189+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
190190 { json: "width", js: "width", typ: u(undefined, 3.14) },
191- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
192- { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
193- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
194- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
195- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
196- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
197- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
198191 ], false),
199192 "AutoSizeParams": o([
200193 { json: "contains", js: "contains", typ: u(undefined, r("Contains")) },
@@ -453,23 +446,20 @@ const typeMap = {
453446 { json: "length", js: "length", typ: 3.14 },
454447 ], ""),
455448 "RangeConfig": o([
456- { json: "category", js: "category", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
457- { json: "diverging", js: "diverging", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
458- { json: "heatmap", js: "heatmap", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
459- { json: "ordinal", js: "ordinal", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
460- { json: "ramp", js: "ramp", typ: u(undefined, u(a(""), r("CategoryVGScheme"))) },
449+ { json: "category", js: "category", typ: u(undefined, u(a(""), r("VGScheme"))) },
450+ { json: "diverging", js: "diverging", typ: u(undefined, u(a(""), r("VGScheme"))) },
451+ { json: "heatmap", js: "heatmap", typ: u(undefined, u(a(""), r("VGScheme"))) },
452+ { json: "ordinal", js: "ordinal", typ: u(undefined, u(a(""), r("VGScheme"))) },
453+ { json: "ramp", js: "ramp", typ: u(undefined, u(a(""), r("VGScheme"))) },
461454 { json: "symbol", js: "symbol", typ: u(undefined, a("")) },
462- ], u(a(u(3.14, "")), r("RangeConfigValueVGScheme"))),
463- "CategoryVGScheme": o([
455+ ], u(a(u(3.14, "")), r("VGScheme"), r("RangeConfigValueClass"))),
456+ "VGScheme": o([
464457 { json: "count", js: "count", typ: u(undefined, 3.14) },
465458 { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
466459 { json: "scheme", js: "scheme", typ: "" },
467460 ], false),
468- "RangeConfigValueVGScheme": o([
469- { json: "count", js: "count", typ: u(undefined, 3.14) },
470- { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
471- { json: "scheme", js: "scheme", typ: u(undefined, "") },
472- { json: "step", js: "step", typ: u(undefined, 3.14) },
461+ "RangeConfigValueClass": o([
462+ { json: "step", js: "step", typ: 3.14 },
473463 ], false),
474464 "ScaleConfig": o([
475465 { json: "bandPaddingInner", js: "bandPaddingInner", typ: u(undefined, 3.14) },
@@ -498,7 +488,7 @@ const typeMap = {
498488 { json: "single", js: "single", typ: u(undefined, r("SingleSelectionConfig")) },
499489 ], false),
500490 "IntervalSelectionConfig": o([
501- { json: "bind", js: "bind", typ: u(undefined, r("BindEnum")) },
491+ { json: "bind", js: "bind", typ: u(undefined, r("Bind")) },
502492 { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
503493 { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
504494 { json: "fields", js: "fields", typ: u(undefined, a("")) },
@@ -527,7 +517,7 @@ const typeMap = {
527517 { json: "toggle", js: "toggle", typ: u(undefined, u(true, "")) },
528518 ], false),
529519 "SingleSelectionConfig": o([
530- { json: "bind", js: "bind", typ: u(undefined, m(r("VGBinding"))) },
520+ { json: "bind", js: "bind", typ: u(undefined, m(u(r("VGCheckboxBinding"), r("VGRadioBinding"), r("VGSelectBinding"), r("VGRangeBinding"), r("VGGenericBinding")))) },
531521 { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
532522 { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
533523 { json: "fields", js: "fields", typ: u(undefined, a("")) },
@@ -535,14 +525,31 @@ const typeMap = {
535525 { json: "on", js: "on", typ: u(undefined, "any") },
536526 { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
537527 ], false),
538- "VGBinding": o([
528+ "VGCheckboxBinding": o([
539529 { json: "element", js: "element", typ: u(undefined, "") },
540- { json: "input", js: "input", typ: "" },
541- { json: "options", js: "options", typ: u(undefined, a("")) },
530+ { json: "input", js: "input", typ: r("PurpleInput") },
531+ ], false),
532+ "VGRadioBinding": o([
533+ { json: "element", js: "element", typ: u(undefined, "") },
534+ { json: "input", js: "input", typ: r("FluffyInput") },
535+ { json: "options", js: "options", typ: a("") },
536+ ], false),
537+ "VGSelectBinding": o([
538+ { json: "element", js: "element", typ: u(undefined, "") },
539+ { json: "input", js: "input", typ: r("TentacledInput") },
540+ { json: "options", js: "options", typ: a("") },
541+ ], false),
542+ "VGRangeBinding": o([
543+ { json: "element", js: "element", typ: u(undefined, "") },
544+ { json: "input", js: "input", typ: r("StickyInput") },
542545 { json: "max", js: "max", typ: u(undefined, 3.14) },
543546 { json: "min", js: "min", typ: u(undefined, 3.14) },
544547 { json: "step", js: "step", typ: u(undefined, 3.14) },
545548 ], false),
549+ "VGGenericBinding": o([
550+ { json: "element", js: "element", typ: u(undefined, "") },
551+ { json: "input", js: "input", typ: "" },
552+ ], false),
546553 "VGMarkConfig": o([
547554 { json: "align", js: "align", typ: u(undefined, r("HorizontalAlign")) },
548555 { json: "angle", js: "angle", typ: u(undefined, 3.14) },
@@ -664,47 +671,60 @@ const typeMap = {
664671 { json: "strokeWidth", js: "strokeWidth", typ: u(undefined, 3.14) },
665672 { json: "width", js: "width", typ: u(undefined, 3.14) },
666673 ], false),
667- "Data": o([
668- { json: "format", js: "format", typ: u(undefined, r("DataFormat")) },
669- { json: "url", js: "url", typ: u(undefined, "") },
670- { json: "values", js: "values", typ: u(undefined, u(a(u(true, 3.14, m("any"), "")), m("any"), "")) },
671- { json: "name", js: "name", typ: u(undefined, "") },
674+ "URLData": o([
675+ { json: "format", js: "format", typ: u(undefined, u(r("CSVDataFormat"), r("JSONDataFormat"), r("TopoDataFormat"))) },
676+ { json: "url", js: "url", typ: "" },
677+ ], false),
678+ "CSVDataFormat": o([
679+ { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
680+ { json: "type", js: "type", typ: u(undefined, r("PurpleType")) },
672681 ], false),
673- "DataFormat": o([
682+ "JSONDataFormat": o([
674683 { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
675- { json: "type", js: "type", typ: u(undefined, r("DataFormatType")) },
676684 { json: "property", js: "property", typ: u(undefined, "") },
685+ { json: "type", js: "type", typ: u(undefined, r("FluffyType")) },
686+ ], false),
687+ "TopoDataFormat": o([
677688 { json: "feature", js: "feature", typ: u(undefined, "") },
678689 { json: "mesh", js: "mesh", typ: u(undefined, "") },
690+ { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
691+ { json: "type", js: "type", typ: u(undefined, r("TentacledType")) },
692+ ], false),
693+ "InlineData": o([
694+ { json: "format", js: "format", typ: u(undefined, u(r("CSVDataFormat"), r("JSONDataFormat"), r("TopoDataFormat"))) },
695+ { json: "values", js: "values", typ: u(a(u(true, 3.14, m("any"), "")), m("any"), "") },
696+ ], false),
697+ "NamedData": o([
698+ { json: "format", js: "format", typ: u(undefined, u(r("CSVDataFormat"), r("JSONDataFormat"), r("TopoDataFormat"))) },
699+ { json: "name", js: "name", typ: "" },
679700 ], false),
680701 "EncodingWithFacet": o([
681- { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) },
702+ { json: "color", js: "color", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
682703 { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
683704 { json: "detail", js: "detail", typ: u(undefined, u(a(r("FieldDef")), r("FieldDef"))) },
684- { json: "href", js: "href", typ: u(undefined, r("DefWithCondition")) },
685- { json: "opacity", js: "opacity", typ: u(undefined, r("MarkPropDefWithCondition")) },
705+ { json: "href", js: "href", typ: u(undefined, u(r("FieldDefWithCondition"), r("ValueDefWithCondition"))) },
706+ { json: "opacity", js: "opacity", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
686707 { json: "order", js: "order", typ: u(undefined, u(a(r("OrderFieldDef")), r("OrderFieldDef"))) },
687708 { json: "row", js: "row", typ: u(undefined, r("FacetFieldDef")) },
688- { json: "shape", js: "shape", typ: u(undefined, r("MarkPropDefWithCondition")) },
689- { json: "size", js: "size", typ: u(undefined, r("MarkPropDefWithCondition")) },
690- { json: "text", js: "text", typ: u(undefined, r("TextDefWithCondition")) },
691- { json: "tooltip", js: "tooltip", typ: u(undefined, r("TextDefWithCondition")) },
692- { json: "x", js: "x", typ: u(undefined, r("XClass")) },
693- { json: "x2", js: "x2", typ: u(undefined, r("X2Class")) },
694- { json: "y", js: "y", typ: u(undefined, r("XClass")) },
695- { json: "y2", js: "y2", typ: u(undefined, r("X2Class")) },
696- ], false),
697- "MarkPropDefWithCondition": o([
709+ { json: "shape", js: "shape", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
710+ { json: "size", js: "size", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
711+ { json: "text", js: "text", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
712+ { json: "tooltip", js: "tooltip", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
713+ { json: "x", js: "x", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
714+ { json: "x2", js: "x2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
715+ { json: "y", js: "y", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
716+ { json: "y2", js: "y2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
717+ ], false),
718+ "MarkPropFieldDefWithCondition": o([
698719 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
699720 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
700- { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateMarkPropFieldDefClass"))) },
721+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
701722 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
702723 { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
703724 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
704- { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
725+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
705726 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
706- { json: "type", js: "type", typ: u(undefined, r("Type")) },
707- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
727+ { json: "type", js: "type", typ: r("Type") },
708728 ], false),
709729 "BinParams": o([
710730 { json: "base", js: "base", typ: u(undefined, 3.14) },
@@ -716,26 +736,23 @@ const typeMap = {
716736 { json: "step", js: "step", typ: u(undefined, 3.14) },
717737 { json: "steps", js: "steps", typ: u(undefined, a(3.14)) },
718738 ], false),
719- "ConditionalValueDef": o([
720- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
739+ "ConditionalPredicateValueDef": o([
740+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
721741 { json: "value", js: "value", typ: u(true, 3.14, "") },
722- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
723- ], false),
724- "Selection": o([
725- { json: "not", js: "not", typ: u(undefined, u(r("Selection"), "")) },
726- { json: "and", js: "and", typ: u(undefined, a(u(r("Selection"), ""))) },
727- { json: "or", js: "or", typ: u(undefined, a(u(r("Selection"), ""))) },
728- ], false),
729- "Predicate": o([
730- { json: "not", js: "not", typ: u(undefined, u(r("Predicate"), "")) },
731- { json: "and", js: "and", typ: u(undefined, a(u(r("Predicate"), ""))) },
732- { json: "or", js: "or", typ: u(undefined, a(u(r("Predicate"), ""))) },
733- { json: "equal", js: "equal", typ: u(undefined, u(true, r("DateTime"), 3.14, "")) },
734- { json: "field", js: "field", typ: u(undefined, "") },
742+ ], false),
743+ "LogicalOrPredicate": o([
744+ { json: "or", js: "or", typ: a(u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "")) },
745+ ], false),
746+ "LogicalAndPredicate": o([
747+ { json: "and", js: "and", typ: a(u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "")) },
748+ ], false),
749+ "LogicalNotPredicate": o([
750+ { json: "not", js: "not", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
751+ ], false),
752+ "FieldEqualPredicate": o([
753+ { json: "equal", js: "equal", typ: u(true, r("DateTime"), 3.14, "") },
754+ { json: "field", js: "field", typ: "" },
735755 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
736- { json: "range", js: "range", typ: u(undefined, a(u(r("DateTime"), 3.14, null))) },
737- { json: "oneOf", js: "oneOf", typ: u(undefined, a(u(true, r("DateTime"), 3.14, ""))) },
738- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
739756 ], false),
740757 "DateTime": o([
741758 { json: "date", js: "date", typ: u(undefined, 3.14) },
@@ -749,18 +766,31 @@ const typeMap = {
749766 { json: "utc", js: "utc", typ: u(undefined, true) },
750767 { json: "year", js: "year", typ: u(undefined, 3.14) },
751768 ], false),
752- "ConditionalPredicateMarkPropFieldDefClass": o([
753- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
754- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
755- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
756- { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
757- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
758- { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
759- { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
760- { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
761- { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
769+ "FieldRangePredicate": o([
770+ { json: "field", js: "field", typ: "" },
771+ { json: "range", js: "range", typ: a(u(r("DateTime"), 3.14, null)) },
762772 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
763- { json: "type", js: "type", typ: u(undefined, r("Type")) },
773+ ], false),
774+ "FieldOneOfPredicate": o([
775+ { json: "field", js: "field", typ: "" },
776+ { json: "oneOf", js: "oneOf", typ: a(u(true, r("DateTime"), 3.14, "")) },
777+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
778+ ], false),
779+ "SelectionPredicate": o([
780+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
781+ ], false),
782+ "SelectionOr": o([
783+ { json: "or", js: "or", typ: a(u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "")) },
784+ ], false),
785+ "SelectionAnd": o([
786+ { json: "and", js: "and", typ: a(u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "")) },
787+ ], false),
788+ "SelectionNot": o([
789+ { json: "not", js: "not", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
790+ ], false),
791+ "ConditionalSelectionValueDef": o([
792+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
793+ { json: "value", js: "value", typ: u(true, 3.14, "") },
764794 ], false),
765795 "RepeatRef": o([
766796 { json: "repeat", js: "repeat", typ: r("RepeatEnum") },
@@ -780,7 +810,7 @@ const typeMap = {
780810 "Scale": o([
781811 { json: "base", js: "base", typ: u(undefined, 3.14) },
782812 { json: "clamp", js: "clamp", typ: u(undefined, true) },
783- { json: "domain", js: "domain", typ: u(undefined, u(a(u(true, r("DateTime"), 3.14, "")), r("DomainClass"), r("Domain"))) },
813+ { json: "domain", js: "domain", typ: u(undefined, u(a(u(true, r("DateTime"), 3.14, "")), r("PurpleSelectionDomain"), r("FluffySelectionDomain"), r("Domain"))) },
784814 { json: "exponent", js: "exponent", typ: u(undefined, 3.14) },
785815 { json: "interpolate", js: "interpolate", typ: u(undefined, u(r("InterpolateParams"), r("Interpolate"))) },
786816 { json: "nice", js: "nice", typ: u(undefined, u(true, r("NiceClass"), 3.14, r("NiceTime"))) },
@@ -794,10 +824,13 @@ const typeMap = {
794824 { json: "type", js: "type", typ: u(undefined, r("ScaleType")) },
795825 { json: "zero", js: "zero", typ: u(undefined, true) },
796826 ], false),
797- "DomainClass": o([
827+ "PurpleSelectionDomain": o([
798828 { json: "field", js: "field", typ: u(undefined, "") },
799829 { json: "selection", js: "selection", typ: "" },
830+ ], false),
831+ "FluffySelectionDomain": o([
800832 { json: "encoding", js: "encoding", typ: u(undefined, "") },
833+ { json: "selection", js: "selection", typ: "" },
801834 ], false),
802835 "InterpolateParams": o([
803836 { json: "gamma", js: "gamma", typ: u(undefined, 3.14) },
@@ -814,14 +847,40 @@ const typeMap = {
814847 "SortField": o([
815848 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
816849 { json: "op", js: "op", typ: r("AggregateOp") },
817- { json: "order", js: "order", typ: u(undefined, u(r("SortEnum"), null)) },
850+ { json: "order", js: "order", typ: u(undefined, u(r("SortOrderEnum"), null)) },
851+ ], false),
852+ "MarkPropValueDefWithCondition": o([
853+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateMarkPropFieldDef"), r("ConditionalSelectionMarkPropFieldDef"), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
854+ { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
855+ ], false),
856+ "ConditionalPredicateMarkPropFieldDef": o([
857+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
858+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
859+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
860+ { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
861+ { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
862+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
863+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
864+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
865+ { json: "type", js: "type", typ: r("Type") },
866+ ], false),
867+ "ConditionalSelectionMarkPropFieldDef": o([
868+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
869+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
870+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
871+ { json: "legend", js: "legend", typ: u(undefined, u(r("Legend"), null)) },
872+ { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
873+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
874+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
875+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
876+ { json: "type", js: "type", typ: r("Type") },
818877 ], false),
819878 "FacetFieldDef": o([
820879 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
821880 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
822881 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
823882 { json: "header", js: "header", typ: u(undefined, r("Header")) },
824- { json: "sort", js: "sort", typ: u(undefined, u(r("SortEnum"), null)) },
883+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortOrderEnum"), null)) },
825884 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
826885 { json: "type", js: "type", typ: r("Type") },
827886 ], false),
@@ -837,65 +896,83 @@ const typeMap = {
837896 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
838897 { json: "type", js: "type", typ: r("Type") },
839898 ], false),
840- "DefWithCondition": o([
899+ "FieldDefWithCondition": o([
841900 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
842901 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
843- { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateFieldDefClass"))) },
902+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
844903 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
845904 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
846- { json: "type", js: "type", typ: u(undefined, r("Type")) },
847- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
905+ { json: "type", js: "type", typ: r("Type") },
848906 ], false),
849- "ConditionalPredicateFieldDefClass": o([
850- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
907+ "ValueDefWithCondition": o([
908+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateFieldDef"), r("ConditionalSelectionFieldDef"), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
851909 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
852- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
910+ ], false),
911+ "ConditionalPredicateFieldDef": o([
853912 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
854913 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
855914 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
915+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
856916 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
857- { json: "type", js: "type", typ: u(undefined, r("Type")) },
917+ { json: "type", js: "type", typ: r("Type") },
918+ ], false),
919+ "ConditionalSelectionFieldDef": o([
920+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
921+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
922+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
923+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
924+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
925+ { json: "type", js: "type", typ: r("Type") },
858926 ], false),
859927 "OrderFieldDef": o([
860928 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
861929 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
862930 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
863- { json: "sort", js: "sort", typ: u(undefined, u(r("SortEnum"), null)) },
931+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortOrderEnum"), null)) },
864932 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
865933 { json: "type", js: "type", typ: r("Type") },
866934 ], false),
867- "TextDefWithCondition": o([
935+ "TextFieldDefWithCondition": o([
868936 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
869937 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
870- { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateTextFieldDefClass"))) },
938+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
871939 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
872940 { json: "format", js: "format", typ: u(undefined, "") },
873941 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
874- { json: "type", js: "type", typ: u(undefined, r("Type")) },
875- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
942+ { json: "type", js: "type", typ: r("Type") },
876943 ], false),
877- "ConditionalPredicateTextFieldDefClass": o([
878- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
944+ "TextValueDefWithCondition": o([
945+ { json: "condition", js: "condition", typ: u(undefined, u(a(u(r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))), r("ConditionalPredicateTextFieldDef"), r("ConditionalSelectionTextFieldDef"), r("ConditionalPredicateValueDef"), r("ConditionalSelectionValueDef"))) },
879946 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
880- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
947+ ], false),
948+ "ConditionalPredicateTextFieldDef": o([
949+ { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
950+ { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
951+ { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
952+ { json: "format", js: "format", typ: u(undefined, "") },
953+ { json: "test", js: "test", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
954+ { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
955+ { json: "type", js: "type", typ: r("Type") },
956+ ], false),
957+ "ConditionalSelectionTextFieldDef": o([
881958 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
882959 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
883960 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
884961 { json: "format", js: "format", typ: u(undefined, "") },
962+ { json: "selection", js: "selection", typ: u(r("SelectionNot"), r("SelectionAnd"), r("SelectionOr"), "") },
885963 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
886- { json: "type", js: "type", typ: u(undefined, r("Type")) },
964+ { json: "type", js: "type", typ: r("Type") },
887965 ], false),
888- "XClass": o([
966+ "PositionFieldDef": o([
889967 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
890968 { json: "axis", js: "axis", typ: u(undefined, u(r("Axis"), null)) },
891969 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
892970 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
893971 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
894- { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
972+ { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortOrderEnum"), null)) },
895973 { json: "stack", js: "stack", typ: u(undefined, u(r("StackOffset"), null)) },
896974 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
897- { json: "type", js: "type", typ: u(undefined, r("Type")) },
898- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
975+ { json: "type", js: "type", typ: r("Type") },
899976 ], false),
900977 "Axis": o([
901978 { json: "domain", js: "domain", typ: u(undefined, true) },
@@ -921,67 +998,8 @@ const typeMap = {
921998 { json: "values", js: "values", typ: u(undefined, a(u(r("DateTime"), 3.14))) },
922999 { json: "zindex", js: "zindex", typ: u(undefined, 3.14) },
9231000 ], false),
924- "X2Class": o([
925- { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
926- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
927- { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
928- { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
929- { json: "type", js: "type", typ: u(undefined, r("Type")) },
930- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
931- ], false),
932- "FacetMapping": o([
933- { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
934- { json: "row", js: "row", typ: u(undefined, r("FacetFieldDef")) },
935- ], false),
936- "Spec": o([
937- { json: "data", js: "data", typ: u(undefined, r("Data")) },
938- { json: "description", js: "description", typ: u(undefined, "") },
939- { json: "height", js: "height", typ: u(undefined, 3.14) },
940- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
941- { json: "name", js: "name", typ: u(undefined, "") },
942- { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
943- { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
944- { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
945- { json: "width", js: "width", typ: u(undefined, 3.14) },
946- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
947- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
948- { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
949- { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
950- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
951- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
952- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
953- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
954- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
955- ], false),
956- "Encoding": o([
957- { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) },
958- { json: "detail", js: "detail", typ: u(undefined, u(a(r("FieldDef")), r("FieldDef"))) },
959- { json: "href", js: "href", typ: u(undefined, r("DefWithCondition")) },
960- { json: "opacity", js: "opacity", typ: u(undefined, r("MarkPropDefWithCondition")) },
961- { json: "order", js: "order", typ: u(undefined, u(a(r("OrderFieldDef")), r("OrderFieldDef"))) },
962- { json: "shape", js: "shape", typ: u(undefined, r("MarkPropDefWithCondition")) },
963- { json: "size", js: "size", typ: u(undefined, r("MarkPropDefWithCondition")) },
964- { json: "text", js: "text", typ: u(undefined, r("TextDefWithCondition")) },
965- { json: "tooltip", js: "tooltip", typ: u(undefined, r("TextDefWithCondition")) },
966- { json: "x", js: "x", typ: u(undefined, r("XClass")) },
967- { json: "x2", js: "x2", typ: u(undefined, r("X2Class")) },
968- { json: "y", js: "y", typ: u(undefined, r("XClass")) },
969- { json: "y2", js: "y2", typ: u(undefined, r("X2Class")) },
970- ], false),
971- "LayerSpec": o([
972- { json: "data", js: "data", typ: u(undefined, r("Data")) },
973- { json: "description", js: "description", typ: u(undefined, "") },
974- { json: "height", js: "height", typ: u(undefined, 3.14) },
975- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
976- { json: "name", js: "name", typ: u(undefined, "") },
977- { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
978- { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
979- { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
980- { json: "width", js: "width", typ: u(undefined, 3.14) },
981- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
982- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
983- { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
984- { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
1001+ "ValueDef": o([
1002+ { json: "value", js: "value", typ: u(true, 3.14, "") },
9851003 ], false),
9861004 "MarkDef": o([
9871005 { json: "align", js: "align", typ: u(undefined, r("HorizontalAlign")) },
@@ -1038,41 +1056,36 @@ const typeMap = {
10381056 "FluffyPrecision": o([
10391057 { json: "length", js: "length", typ: 3.14 },
10401058 ], ""),
1041- "Resolve": o([
1042- { json: "axis", js: "axis", typ: u(undefined, r("AxisResolveMap")) },
1043- { json: "legend", js: "legend", typ: u(undefined, r("LegendResolveMap")) },
1044- { json: "scale", js: "scale", typ: u(undefined, r("ScaleResolveMap")) },
1045- ], false),
1046- "AxisResolveMap": o([
1047- { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
1048- { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
1049- ], false),
1050- "LegendResolveMap": o([
1051- { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
1052- { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
1053- { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
1054- { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
1055- ], false),
1056- "ScaleResolveMap": o([
1057- { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
1058- { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
1059- { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
1060- { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
1061- { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
1062- { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
1059+ "SingleSelection": o([
1060+ { json: "bind", js: "bind", typ: u(undefined, m(u(r("VGCheckboxBinding"), r("VGRadioBinding"), r("VGSelectBinding"), r("VGRangeBinding"), r("VGGenericBinding")))) },
1061+ { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
1062+ { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
1063+ { json: "fields", js: "fields", typ: u(undefined, a("")) },
1064+ { json: "nearest", js: "nearest", typ: u(undefined, true) },
1065+ { json: "on", js: "on", typ: u(undefined, "any") },
1066+ { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
1067+ { json: "type", js: "type", typ: r("StickyType") },
10631068 ], false),
1064- "SelectionDef": o([
1065- { json: "bind", js: "bind", typ: u(undefined, u(r("BindEnum"), m(r("VGBinding")))) },
1069+ "MultiSelection": o([
10661070 { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
10671071 { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
10681072 { json: "fields", js: "fields", typ: u(undefined, a("")) },
10691073 { json: "nearest", js: "nearest", typ: u(undefined, true) },
10701074 { json: "on", js: "on", typ: u(undefined, "any") },
10711075 { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
1072- { json: "type", js: "type", typ: r("SelectionDefType") },
10731076 { json: "toggle", js: "toggle", typ: u(undefined, u(true, "")) },
1077+ { json: "type", js: "type", typ: r("IndigoType") },
1078+ ], false),
1079+ "IntervalSelection": o([
1080+ { json: "bind", js: "bind", typ: u(undefined, r("Bind")) },
1081+ { json: "empty", js: "empty", typ: u(undefined, r("Empty")) },
1082+ { json: "encodings", js: "encodings", typ: u(undefined, a(r("SingleDefChannel"))) },
1083+ { json: "fields", js: "fields", typ: u(undefined, a("")) },
10741084 { json: "mark", js: "mark", typ: u(undefined, r("BrushConfig")) },
1085+ { json: "on", js: "on", typ: u(undefined, "any") },
1086+ { json: "resolve", js: "resolve", typ: u(undefined, r("SelectionResolution")) },
10751087 { json: "translate", js: "translate", typ: u(undefined, u(true, "")) },
1088+ { json: "type", js: "type", typ: r("IndecentType") },
10761089 { json: "zoom", js: "zoom", typ: u(undefined, u(true, "")) },
10771090 ], false),
10781091 "TitleParams": o([
@@ -1082,17 +1095,36 @@ const typeMap = {
10821095 { json: "style", js: "style", typ: u(undefined, u(a(""), "")) },
10831096 { json: "text", js: "text", typ: "" },
10841097 ], false),
1085- "Transform": o([
1086- { json: "filter", js: "filter", typ: u(undefined, u(r("Predicate"), "")) },
1098+ "FilterTransform": o([
1099+ { json: "filter", js: "filter", typ: u(r("LogicalNotPredicate"), r("LogicalAndPredicate"), r("LogicalOrPredicate"), r("FieldEqualPredicate"), r("FieldRangePredicate"), r("FieldOneOfPredicate"), r("SelectionPredicate"), "") },
1100+ ], false),
1101+ "CalculateTransform": o([
1102+ { json: "as", js: "as", typ: "" },
1103+ { json: "calculate", js: "calculate", typ: "" },
1104+ ], false),
1105+ "LookupTransform": o([
10871106 { json: "as", js: "as", typ: u(undefined, u(a(""), "")) },
1088- { json: "calculate", js: "calculate", typ: u(undefined, "") },
10891107 { json: "default", js: "default", typ: u(undefined, "") },
1090- { json: "from", js: "from", typ: u(undefined, r("LookupData")) },
1091- { json: "lookup", js: "lookup", typ: u(undefined, "") },
1092- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
1093- { json: "field", js: "field", typ: u(undefined, "") },
1094- { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
1095- { json: "aggregate", js: "aggregate", typ: u(undefined, a(r("AggregatedFieldDef"))) },
1108+ { json: "from", js: "from", typ: r("LookupData") },
1109+ { json: "lookup", js: "lookup", typ: "" },
1110+ ], false),
1111+ "LookupData": o([
1112+ { json: "data", js: "data", typ: u(r("URLData"), r("InlineData"), r("NamedData")) },
1113+ { json: "fields", js: "fields", typ: u(undefined, a("")) },
1114+ { json: "key", js: "key", typ: "" },
1115+ ], false),
1116+ "BinTransform": o([
1117+ { json: "as", js: "as", typ: "" },
1118+ { json: "bin", js: "bin", typ: u(true, r("BinParams")) },
1119+ { json: "field", js: "field", typ: "" },
1120+ ], false),
1121+ "TimeUnitTransform": o([
1122+ { json: "as", js: "as", typ: "" },
1123+ { json: "field", js: "field", typ: "" },
1124+ { json: "timeUnit", js: "timeUnit", typ: r("TimeUnit") },
1125+ ], false),
1126+ "AggregateTransform": o([
1127+ { json: "aggregate", js: "aggregate", typ: a(r("AggregatedFieldDef")) },
10961128 { json: "groupby", js: "groupby", typ: u(undefined, a("")) },
10971129 ], false),
10981130 "AggregatedFieldDef": o([
@@ -1100,15 +1132,188 @@ const typeMap = {
11001132 { json: "field", js: "field", typ: "" },
11011133 { json: "op", js: "op", typ: r("AggregateOp") },
11021134 ], false),
1103- "LookupData": o([
1104- { json: "data", js: "data", typ: r("Data") },
1105- { json: "fields", js: "fields", typ: u(undefined, a("")) },
1106- { json: "key", js: "key", typ: "" },
1135+ "TopLevelLayerSpec": o([
1136+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
1137+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
1138+ { json: "background", js: "background", typ: u(undefined, "") },
1139+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
1140+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1141+ { json: "description", js: "description", typ: u(undefined, "") },
1142+ { json: "height", js: "height", typ: u(undefined, 3.14) },
1143+ { json: "layer", js: "layer", typ: a(u(r("LayerSpec"), r("CompositeUnitSpecAlias"))) },
1144+ { json: "name", js: "name", typ: u(undefined, "") },
1145+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
1146+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1147+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1148+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1149+ { json: "width", js: "width", typ: u(undefined, 3.14) },
1150+ ], false),
1151+ "LayerSpec": o([
1152+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1153+ { json: "description", js: "description", typ: u(undefined, "") },
1154+ { json: "height", js: "height", typ: u(undefined, 3.14) },
1155+ { json: "layer", js: "layer", typ: a(u(r("LayerSpec"), r("CompositeUnitSpecAlias"))) },
1156+ { json: "name", js: "name", typ: u(undefined, "") },
1157+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1158+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1159+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1160+ { json: "width", js: "width", typ: u(undefined, 3.14) },
1161+ ], false),
1162+ "Resolve": o([
1163+ { json: "axis", js: "axis", typ: u(undefined, r("AxisResolveMap")) },
1164+ { json: "legend", js: "legend", typ: u(undefined, r("LegendResolveMap")) },
1165+ { json: "scale", js: "scale", typ: u(undefined, r("ScaleResolveMap")) },
1166+ ], false),
1167+ "AxisResolveMap": o([
1168+ { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
1169+ { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
1170+ ], false),
1171+ "LegendResolveMap": o([
1172+ { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
1173+ { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
1174+ { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
1175+ { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
1176+ ], false),
1177+ "ScaleResolveMap": o([
1178+ { json: "color", js: "color", typ: u(undefined, r("ResolveMode")) },
1179+ { json: "opacity", js: "opacity", typ: u(undefined, r("ResolveMode")) },
1180+ { json: "shape", js: "shape", typ: u(undefined, r("ResolveMode")) },
1181+ { json: "size", js: "size", typ: u(undefined, r("ResolveMode")) },
1182+ { json: "x", js: "x", typ: u(undefined, r("ResolveMode")) },
1183+ { json: "y", js: "y", typ: u(undefined, r("ResolveMode")) },
1184+ ], false),
1185+ "CompositeUnitSpecAlias": o([
1186+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1187+ { json: "description", js: "description", typ: u(undefined, "") },
1188+ { json: "encoding", js: "encoding", typ: r("Encoding") },
1189+ { json: "height", js: "height", typ: u(undefined, 3.14) },
1190+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
1191+ { json: "name", js: "name", typ: u(undefined, "") },
1192+ { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
1193+ { json: "selection", js: "selection", typ: u(undefined, m(u(r("SingleSelection"), r("MultiSelection"), r("IntervalSelection")))) },
1194+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1195+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1196+ { json: "width", js: "width", typ: u(undefined, 3.14) },
1197+ ], false),
1198+ "Encoding": o([
1199+ { json: "color", js: "color", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
1200+ { json: "detail", js: "detail", typ: u(undefined, u(a(r("FieldDef")), r("FieldDef"))) },
1201+ { json: "href", js: "href", typ: u(undefined, u(r("FieldDefWithCondition"), r("ValueDefWithCondition"))) },
1202+ { json: "opacity", js: "opacity", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
1203+ { json: "order", js: "order", typ: u(undefined, u(a(r("OrderFieldDef")), r("OrderFieldDef"))) },
1204+ { json: "shape", js: "shape", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
1205+ { json: "size", js: "size", typ: u(undefined, u(r("MarkPropFieldDefWithCondition"), r("MarkPropValueDefWithCondition"))) },
1206+ { json: "text", js: "text", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
1207+ { json: "tooltip", js: "tooltip", typ: u(undefined, u(r("TextFieldDefWithCondition"), r("TextValueDefWithCondition"))) },
1208+ { json: "x", js: "x", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
1209+ { json: "x2", js: "x2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
1210+ { json: "y", js: "y", typ: u(undefined, u(r("PositionFieldDef"), r("ValueDef"))) },
1211+ { json: "y2", js: "y2", typ: u(undefined, u(r("FieldDef"), r("ValueDef"))) },
1212+ ], false),
1213+ "TopLevelFacetSpec": o([
1214+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
1215+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
1216+ { json: "background", js: "background", typ: u(undefined, "") },
1217+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
1218+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1219+ { json: "description", js: "description", typ: u(undefined, "") },
1220+ { json: "facet", js: "facet", typ: r("FacetMapping") },
1221+ { json: "name", js: "name", typ: u(undefined, "") },
1222+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
1223+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1224+ { json: "spec", js: "spec", typ: u(r("LayerSpec"), r("CompositeUnitSpecAlias")) },
1225+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1226+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1227+ ], false),
1228+ "FacetMapping": o([
1229+ { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
1230+ { json: "row", js: "row", typ: u(undefined, r("FacetFieldDef")) },
1231+ ], false),
1232+ "TopLevelRepeatSpec": o([
1233+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
1234+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
1235+ { json: "background", js: "background", typ: u(undefined, "") },
1236+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
1237+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1238+ { json: "description", js: "description", typ: u(undefined, "") },
1239+ { json: "name", js: "name", typ: u(undefined, "") },
1240+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
1241+ { json: "repeat", js: "repeat", typ: r("Repeat") },
1242+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1243+ { json: "spec", js: "spec", typ: u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec")) },
1244+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1245+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
11071246 ], false),
11081247 "Repeat": o([
11091248 { json: "column", js: "column", typ: u(undefined, a("")) },
11101249 { json: "row", js: "row", typ: u(undefined, a("")) },
11111250 ], false),
1251+ "HConcatSpec": o([
1252+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1253+ { json: "description", js: "description", typ: u(undefined, "") },
1254+ { json: "hconcat", js: "hconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
1255+ { json: "name", js: "name", typ: u(undefined, "") },
1256+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1257+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1258+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1259+ ], false),
1260+ "VConcatSpec": o([
1261+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1262+ { json: "description", js: "description", typ: u(undefined, "") },
1263+ { json: "name", js: "name", typ: u(undefined, "") },
1264+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1265+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1266+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1267+ { json: "vconcat", js: "vconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
1268+ ], false),
1269+ "RepeatSpec": o([
1270+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1271+ { json: "description", js: "description", typ: u(undefined, "") },
1272+ { json: "name", js: "name", typ: u(undefined, "") },
1273+ { json: "repeat", js: "repeat", typ: r("Repeat") },
1274+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1275+ { json: "spec", js: "spec", typ: u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec")) },
1276+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1277+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1278+ ], false),
1279+ "FacetSpec": o([
1280+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1281+ { json: "description", js: "description", typ: u(undefined, "") },
1282+ { json: "facet", js: "facet", typ: r("FacetMapping") },
1283+ { json: "name", js: "name", typ: u(undefined, "") },
1284+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1285+ { json: "spec", js: "spec", typ: u(r("LayerSpec"), r("CompositeUnitSpecAlias")) },
1286+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1287+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1288+ ], false),
1289+ "TopLevelVConcatSpec": o([
1290+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
1291+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
1292+ { json: "background", js: "background", typ: u(undefined, "") },
1293+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
1294+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1295+ { json: "description", js: "description", typ: u(undefined, "") },
1296+ { json: "name", js: "name", typ: u(undefined, "") },
1297+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
1298+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1299+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1300+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1301+ { json: "vconcat", js: "vconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
1302+ ], false),
1303+ "TopLevelHConcatSpec": o([
1304+ { json: "$schema", js: "$schema", typ: u(undefined, "") },
1305+ { json: "autosize", js: "autosize", typ: u(undefined, u(r("AutoSizeParams"), r("AutosizeType"))) },
1306+ { json: "background", js: "background", typ: u(undefined, "") },
1307+ { json: "config", js: "config", typ: u(undefined, r("Config")) },
1308+ { json: "data", js: "data", typ: u(undefined, u(r("URLData"), r("InlineData"), r("NamedData"))) },
1309+ { json: "description", js: "description", typ: u(undefined, "") },
1310+ { json: "hconcat", js: "hconcat", typ: a(u(r("CompositeUnitSpecAlias"), r("LayerSpec"), r("FacetSpec"), r("RepeatSpec"), r("VConcatSpec"), r("HConcatSpec"))) },
1311+ { json: "name", js: "name", typ: u(undefined, "") },
1312+ { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
1313+ { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
1314+ { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
1315+ { json: "transform", js: "transform", typ: u(undefined, a(u(r("FilterTransform"), r("CalculateTransform"), r("LookupTransform"), r("BinTransform"), r("TimeUnitTransform"), r("AggregateTransform")))) },
1316+ ], false),
11121317 "Contains": [
11131318 "content",
11141319 "padding",
@@ -1229,7 +1434,7 @@ const typeMap = {
12291434 "stereographic",
12301435 "transverseMercator",
12311436 ],
1232- "BindEnum": [
1437+ "Bind": [
12331438 "scales",
12341439 ],
12351440 "Empty": [
@@ -1256,6 +1461,18 @@ const typeMap = {
12561461 "union",
12571462 "intersect",
12581463 ],
1464+ "PurpleInput": [
1465+ "checkbox",
1466+ ],
1467+ "FluffyInput": [
1468+ "radio",
1469+ ],
1470+ "TentacledInput": [
1471+ "select",
1472+ ],
1473+ "StickyInput": [
1474+ "range",
1475+ ],
12591476 "StackOffset": [
12601477 "zero",
12611478 "center",
@@ -1275,10 +1492,14 @@ const typeMap = {
12751492 "ParseEnum": [
12761493 "auto",
12771494 ],
1278- "DataFormatType": [
1495+ "PurpleType": [
12791496 "csv",
12801497 "tsv",
1498+ ],
1499+ "FluffyType": [
12811500 "json",
1501+ ],
1502+ "TentacledType": [
12821503 "topojson",
12831504 ],
12841505 "AggregateOp": [
@@ -1389,7 +1610,7 @@ const typeMap = {
13891610 "point",
13901611 "band",
13911612 ],
1392- "SortEnum": [
1613+ "SortOrderEnum": [
13931614 "ascending",
13941615 "descending",
13951616 ],
@@ -1415,15 +1636,19 @@ const typeMap = {
14151636 "square",
14161637 "geoshape",
14171638 ],
1418- "ResolveMode": [
1419- "independent",
1420- "shared",
1421- ],
1422- "SelectionDefType": [
1639+ "StickyType": [
14231640 "single",
1641+ ],
1642+ "IndigoType": [
14241643 "multi",
1644+ ],
1645+ "IndecentType": [
14251646 "interval",
14261647 ],
1648+ "ResolveMode": [
1649+ "independent",
1650+ "shared",
1651+ ],
14271652 };
14281653
14291654 module.exports = {
Aschema-kotlin-jackson/test/inputs/schema/one-of-objects.schema/default/TopLevel.kt+26 −0
@@ -0,0 +1,26 @@
1+// To parse the JSON, install Klaxon and do:
2+//
3+// val topLevel = TopLevel.fromJson(jsonString)
4+
5+package quicktype
6+
7+import com.beust.klaxon.*
8+
9+private val klaxon = Klaxon()
10+
11+data class TopLevel (
12+ val items: List<Item>
13+) {
14+ public fun toJson() = klaxon.toJsonString(this)
15+
16+ companion object {
17+ public fun fromJson(json: String) = klaxon.parse<TopLevel>(json)
18+ }
19+}
20+
21+data class Item (
22+ val aa: String? = null,
23+ val bb: String? = null,
24+ val cc: String? = null,
25+ val dd: String? = null
26+)
Aschema-kotlin/test/inputs/schema/one-of-objects.schema/default/TopLevel.kt+37 −0
@@ -0,0 +1,37 @@
1+// To parse the JSON, install jackson-module-kotlin and do:
2+//
3+// val topLevel = TopLevel.fromJson(jsonString)
4+
5+package quicktype
6+
7+import com.fasterxml.jackson.annotation.*
8+import com.fasterxml.jackson.core.*
9+import com.fasterxml.jackson.databind.*
10+import com.fasterxml.jackson.databind.deser.std.StdDeserializer
11+import com.fasterxml.jackson.databind.module.SimpleModule
12+import com.fasterxml.jackson.databind.node.*
13+import com.fasterxml.jackson.databind.ser.std.StdSerializer
14+import com.fasterxml.jackson.module.kotlin.*
15+
16+val mapper = jacksonObjectMapper().apply {
17+ propertyNamingStrategy = PropertyNamingStrategy.LOWER_CAMEL_CASE
18+ setSerializationInclusion(JsonInclude.Include.NON_NULL)
19+}
20+
21+data class TopLevel (
22+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
23+ val items: List<Item>
24+) {
25+ fun toJson() = mapper.writeValueAsString(this)
26+
27+ companion object {
28+ fun fromJson(json: String) = mapper.readValue<TopLevel>(json)
29+ }
30+}
31+
32+data class Item (
33+ val aa: String? = null,
34+ val bb: String? = null,
35+ val cc: String? = null,
36+ val dd: String? = null
37+)
Aschema-kotlinx/test/inputs/schema/one-of-objects.schema/default/TopLevel.kt+24 −0
@@ -0,0 +1,24 @@
1+// To parse the JSON, install kotlin's serialization plugin and do:
2+//
3+// val json = Json { allowStructuredMapKeys = true }
4+// val topLevel = json.parse(TopLevel.serializer(), jsonString)
5+
6+package quicktype
7+
8+import kotlinx.serialization.*
9+import kotlinx.serialization.json.*
10+import kotlinx.serialization.descriptors.*
11+import kotlinx.serialization.encoding.*
12+
13+@Serializable
14+data class TopLevel (
15+ val items: List<Item>
16+)
17+
18+@Serializable
19+data class Item (
20+ val aa: String? = null,
21+ val bb: String? = null,
22+ val cc: String? = null,
23+ val dd: String? = null
24+)
Aschema-php/test/inputs/schema/one-of-objects.schema/default/TopLevel.php+412 −0
@@ -0,0 +1,412 @@
1+<?php
2+declare(strict_types=1);
3+
4+// This is an autogenerated file:TopLevel
5+
6+class TopLevel {
7+ private array $items; // json:items Required
8+
9+ /**
10+ * @param array $items
11+ */
12+ public function __construct(array $items) {
13+ $this->items = $items;
14+ }
15+
16+ /**
17+ * @param array $value
18+ * @throws Exception
19+ * @return array
20+ */
21+ public static function fromItems(array $value): array {
22+ return array_map(function ($value) {
23+ return Item::from($value); /*class*/
24+ }, $value);
25+ }
26+
27+ /**
28+ * @throws Exception
29+ * @return array
30+ */
31+ public function toItems(): array {
32+ if (TopLevel::validateItems($this->items)) {
33+ return array_map(function ($value) {
34+ return $value->to(); /*class*/
35+ }, $this->items);
36+ }
37+ throw new Exception('never get to this TopLevel::items');
38+ }
39+
40+ /**
41+ * @param array
42+ * @return bool
43+ * @throws Exception
44+ */
45+ public static function validateItems(array $value): bool {
46+ if (!is_array($value)) {
47+ throw new Exception("Attribute Error:TopLevel::items");
48+ }
49+ array_walk($value, function($value_v) {
50+ $value_v->validate();
51+ });
52+ return true;
53+ }
54+
55+ /**
56+ * @throws Exception
57+ * @return array
58+ */
59+ public function getItems(): array {
60+ if (TopLevel::validateItems($this->items)) {
61+ return $this->items;
62+ }
63+ throw new Exception('never get to getItems TopLevel::items');
64+ }
65+
66+ /**
67+ * @return array
68+ */
69+ public static function sampleItems(): array {
70+ return array(
71+ Item::sample() /*31:*/
72+ ); /* 31:items*/
73+ }
74+
75+ /**
76+ * @throws Exception
77+ * @return bool
78+ */
79+ public function validate(): bool {
80+ return TopLevel::validateItems($this->items);
81+ }
82+
83+ /**
84+ * @return stdClass
85+ * @throws Exception
86+ */
87+ public function to(): stdClass {
88+ $out = new stdClass();
89+ $out->{'items'} = $this->toItems();
90+ return $out;
91+ }
92+
93+ /**
94+ * @param stdClass $obj
95+ * @return TopLevel
96+ * @throws Exception
97+ */
98+ public static function from(stdClass $obj): TopLevel {
99+ return new TopLevel(
100+ TopLevel::fromItems($obj->{'items'})
101+ );
102+ }
103+
104+ /**
105+ * @return TopLevel
106+ */
107+ public static function sample(): TopLevel {
108+ return new TopLevel(
109+ TopLevel::sampleItems()
110+ );
111+ }
112+}
113+
114+// This is an autogenerated file:Item
115+
116+class Item {
117+ private ?string $aa; // json:aa Optional
118+ private ?string $bb; // json:bb Optional
119+ private ?string $cc; // json:cc Optional
120+ private ?string $dd; // json:dd Optional
121+
122+ /**
123+ * @param string|null $aa
124+ * @param string|null $bb
125+ * @param string|null $cc
126+ * @param string|null $dd
127+ */
128+ public function __construct(?string $aa, ?string $bb, ?string $cc, ?string $dd) {
129+ $this->aa = $aa;
130+ $this->bb = $bb;
131+ $this->cc = $cc;
132+ $this->dd = $dd;
133+ }
134+
135+ /**
136+ * @param ?string $value
137+ * @throws Exception
138+ * @return ?string
139+ */
140+ public static function fromAa(?string $value): ?string {
141+ if (!is_null($value)) {
142+ return $value; /*string*/
143+ } else {
144+ return null;
145+ }
146+ }
147+
148+ /**
149+ * @throws Exception
150+ * @return ?string
151+ */
152+ public function toAa(): ?string {
153+ if (Item::validateAa($this->aa)) {
154+ if (!is_null($this->aa)) {
155+ return $this->aa; /*string*/
156+ } else {
157+ return null;
158+ }
159+ }
160+ throw new Exception('never get to this Item::aa');
161+ }
162+
163+ /**
164+ * @param string|null
165+ * @return bool
166+ * @throws Exception
167+ */
168+ public static function validateAa(?string $value): bool {
169+ if (!is_null($value)) {
170+ }
171+ return true;
172+ }
173+
174+ /**
175+ * @throws Exception
176+ * @return ?string
177+ */
178+ public function getAa(): ?string {
179+ if (Item::validateAa($this->aa)) {
180+ return $this->aa;
181+ }
182+ throw new Exception('never get to getAa Item::aa');
183+ }
184+
185+ /**
186+ * @return ?string
187+ */
188+ public static function sampleAa(): ?string {
189+ return 'Item::aa::31'; /*31:aa*/
190+ }
191+
192+ /**
193+ * @param ?string $value
194+ * @throws Exception
195+ * @return ?string
196+ */
197+ public static function fromBb(?string $value): ?string {
198+ if (!is_null($value)) {
199+ return $value; /*string*/
200+ } else {
201+ return null;
202+ }
203+ }
204+
205+ /**
206+ * @throws Exception
207+ * @return ?string
208+ */
209+ public function toBb(): ?string {
210+ if (Item::validateBb($this->bb)) {
211+ if (!is_null($this->bb)) {
212+ return $this->bb; /*string*/
213+ } else {
214+ return null;
215+ }
216+ }
217+ throw new Exception('never get to this Item::bb');
218+ }
219+
220+ /**
221+ * @param string|null
222+ * @return bool
223+ * @throws Exception
224+ */
225+ public static function validateBb(?string $value): bool {
226+ if (!is_null($value)) {
227+ }
228+ return true;
229+ }
230+
231+ /**
232+ * @throws Exception
233+ * @return ?string
234+ */
235+ public function getBb(): ?string {
236+ if (Item::validateBb($this->bb)) {
237+ return $this->bb;
238+ }
239+ throw new Exception('never get to getBb Item::bb');
240+ }
241+
242+ /**
243+ * @return ?string
244+ */
245+ public static function sampleBb(): ?string {
246+ return 'Item::bb::32'; /*32:bb*/
247+ }
248+
249+ /**
250+ * @param ?string $value
251+ * @throws Exception
252+ * @return ?string
253+ */
254+ public static function fromCc(?string $value): ?string {
255+ if (!is_null($value)) {
256+ return $value; /*string*/
257+ } else {
258+ return null;
259+ }
260+ }
261+
262+ /**
263+ * @throws Exception
264+ * @return ?string
265+ */
266+ public function toCc(): ?string {
267+ if (Item::validateCc($this->cc)) {
268+ if (!is_null($this->cc)) {
269+ return $this->cc; /*string*/
270+ } else {
271+ return null;
272+ }
273+ }
274+ throw new Exception('never get to this Item::cc');
275+ }
276+
277+ /**
278+ * @param string|null
279+ * @return bool
280+ * @throws Exception
281+ */
282+ public static function validateCc(?string $value): bool {
283+ if (!is_null($value)) {
284+ }
285+ return true;
286+ }
287+
288+ /**
289+ * @throws Exception
290+ * @return ?string
291+ */
292+ public function getCc(): ?string {
293+ if (Item::validateCc($this->cc)) {
294+ return $this->cc;
295+ }
296+ throw new Exception('never get to getCc Item::cc');
297+ }
298+
299+ /**
300+ * @return ?string
301+ */
302+ public static function sampleCc(): ?string {
303+ return 'Item::cc::33'; /*33:cc*/
304+ }
305+
306+ /**
307+ * @param ?string $value
308+ * @throws Exception
309+ * @return ?string
310+ */
311+ public static function fromDD(?string $value): ?string {
312+ if (!is_null($value)) {
313+ return $value; /*string*/
314+ } else {
315+ return null;
316+ }
317+ }
318+
319+ /**
320+ * @throws Exception
321+ * @return ?string
322+ */
323+ public function toDD(): ?string {
324+ if (Item::validateDD($this->dd)) {
325+ if (!is_null($this->dd)) {
326+ return $this->dd; /*string*/
327+ } else {
328+ return null;
329+ }
330+ }
331+ throw new Exception('never get to this Item::dd');
332+ }
333+
334+ /**
335+ * @param string|null
336+ * @return bool
337+ * @throws Exception
338+ */
339+ public static function validateDD(?string $value): bool {
340+ if (!is_null($value)) {
341+ }
342+ return true;
343+ }
344+
345+ /**
346+ * @throws Exception
347+ * @return ?string
348+ */
349+ public function getDD(): ?string {
350+ if (Item::validateDD($this->dd)) {
351+ return $this->dd;
352+ }
353+ throw new Exception('never get to getDD Item::dd');
354+ }
355+
356+ /**
357+ * @return ?string
358+ */
359+ public static function sampleDD(): ?string {
360+ return 'Item::dd::34'; /*34:dd*/
361+ }
362+
363+ /**
364+ * @throws Exception
365+ * @return bool
366+ */
367+ public function validate(): bool {
368+ return Item::validateAa($this->aa)
369+ || Item::validateBb($this->bb)
370+ || Item::validateCc($this->cc)
371+ || Item::validateDD($this->dd);
372+ }
373+
374+ /**
375+ * @return stdClass
376+ * @throws Exception
377+ */
378+ public function to(): stdClass {
379+ $out = new stdClass();
380+ $out->{'aa'} = $this->toAa();
381+ $out->{'bb'} = $this->toBb();
382+ $out->{'cc'} = $this->toCc();
383+ $out->{'dd'} = $this->toDD();
384+ return $out;
385+ }
386+
387+ /**
388+ * @param stdClass $obj
389+ * @return Item
390+ * @throws Exception
391+ */
392+ public static function from(stdClass $obj): Item {
393+ return new Item(
394+ Item::fromAa($obj->{'aa'})
395+ ,Item::fromBb($obj->{'bb'})
396+ ,Item::fromCc($obj->{'cc'})
397+ ,Item::fromDD($obj->{'dd'})
398+ );
399+ }
400+
401+ /**
402+ * @return Item
403+ */
404+ public static function sample(): Item {
405+ return new Item(
406+ Item::sampleAa()
407+ ,Item::sampleBb()
408+ ,Item::sampleCc()
409+ ,Item::sampleDD()
410+ );
411+ }
412+}
Aschema-pike/test/inputs/schema/one-of-objects.schema/default/TopLevel.pmod+62 −0
@@ -0,0 +1,62 @@
1+// This source has been automatically generated by quicktype.
2+// ( https://github.com/quicktype/quicktype )
3+//
4+// To use this code, simply import it into your project as a Pike module.
5+// To JSON-encode your object, you can pass it to `Standards.JSON.encode`
6+// or call `encode_json` on it.
7+//
8+// To decode a JSON string, first pass it to `Standards.JSON.decode`,
9+// and then pass the result to `<YourClass>_from_JSON`.
10+// It will return an instance of <YourClass>.
11+// Bear in mind that these functions have unexpected behavior,
12+// and will likely throw an error, if the JSON string does not
13+// match the expected interface, even if the JSON itself is valid.
14+
15+class TopLevel {
16+ array(Item) items; // json: "items"
17+
18+ string encode_json() {
19+ mapping(string:mixed) json = ([
20+ "items" : items,
21+ ]);
22+
23+ return Standards.JSON.encode(json);
24+ }
25+}
26+
27+TopLevel TopLevel_from_JSON(mixed json) {
28+ TopLevel retval = TopLevel();
29+
30+ retval.items = json["items"];
31+
32+ return retval;
33+}
34+
35+class Item {
36+ mixed|string aa; // json: "aa"
37+ mixed|string bb; // json: "bb"
38+ mixed|string cc; // json: "cc"
39+ mixed|string dd; // json: "dd"
40+
41+ string encode_json() {
42+ mapping(string:mixed) json = ([
43+ "aa" : aa,
44+ "bb" : bb,
45+ "cc" : cc,
46+ "dd" : dd,
47+ ]);
48+
49+ return Standards.JSON.encode(json);
50+ }
51+}
52+
53+Item Item_from_JSON(mixed json) {
54+ Item retval = Item();
55+
56+ retval.aa = json["aa"];
57+ retval.bb = json["bb"];
58+ retval.cc = json["cc"];
59+ retval.dd = json["dd"];
60+
61+ return retval;
62+}
Aschema-python/test/inputs/schema/one-of-objects.schema/default/quicktype.py+87 −0
@@ -0,0 +1,87 @@
1+from dataclasses import dataclass
2+from typing import Any, TypeVar, Callable, Type, cast
3+
4+
5+T = TypeVar("T")
6+
7+
8+def from_str(x: Any) -> str:
9+ assert isinstance(x, str)
10+ return x
11+
12+
13+def from_none(x: Any) -> Any:
14+ assert x is None
15+ return x
16+
17+
18+def from_union(fs, x):
19+ for f in fs:
20+ try:
21+ return f(x)
22+ except:
23+ pass
24+ assert False
25+
26+
27+def from_list(f: Callable[[Any], T], x: Any) -> list[T]:
28+ assert isinstance(x, list)
29+ return [f(y) for y in x]
30+
31+
32+def to_class(c: Type[T], x: Any) -> dict:
33+ assert isinstance(x, c)
34+ return cast(Any, x).to_dict()
35+
36+
37+@dataclass
38+class Item:
39+ aa: str | None = None
40+ bb: str | None = None
41+ cc: str | None = None
42+ dd: str | None = None
43+
44+ @staticmethod
45+ def from_dict(obj: Any) -> 'Item':
46+ assert isinstance(obj, dict)
47+ aa = from_union([from_str, from_none], obj.get("aa"))
48+ bb = from_union([from_str, from_none], obj.get("bb"))
49+ cc = from_union([from_str, from_none], obj.get("cc"))
50+ dd = from_union([from_str, from_none], obj.get("dd"))
51+ return Item(aa, bb, cc, dd)
52+
53+ def to_dict(self) -> dict:
54+ result: dict = {}
55+ if self.aa is not None:
56+ result["aa"] = from_union([from_str, from_none], self.aa)
57+ if self.bb is not None:
58+ result["bb"] = from_union([from_str, from_none], self.bb)
59+ if self.cc is not None:
60+ result["cc"] = from_union([from_str, from_none], self.cc)
61+ if self.dd is not None:
62+ result["dd"] = from_union([from_str, from_none], self.dd)
63+ return result
64+
65+
66+@dataclass
67+class TopLevel:
68+ items: list[Item]
69+
70+ @staticmethod
71+ def from_dict(obj: Any) -> 'TopLevel':
72+ assert isinstance(obj, dict)
73+ items = from_list(Item.from_dict, obj.get("items"))
74+ return TopLevel(items)
75+
76+ def to_dict(self) -> dict:
77+ result: dict = {}
78+ result["items"] = from_list(lambda x: to_class(Item, x), self.items)
79+ return result
80+
81+
82+def top_level_from_dict(s: Any) -> TopLevel:
83+ return TopLevel.from_dict(s)
84+
85+
86+def top_level_to_dict(x: TopLevel) -> Any:
87+ return to_class(TopLevel, x)
Aschema-ruby/test/inputs/schema/one-of-objects.schema/default/TopLevel.rb+79 −0
@@ -0,0 +1,79 @@
1+# This code may look unusually verbose for Ruby (and it is), but
2+# it performs some subtle and complex validation of JSON data.
3+#
4+# To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do:
5+#
6+# top_level = TopLevel.from_json! "{…}"
7+# puts top_level.items.first.aa
8+#
9+# If from_json! succeeds, the value returned matches the schema.
10+
11+require 'json'
12+require 'dry-types'
13+require 'dry-struct'
14+
15+module Types
16+ include Dry.Types(default: :nominal)
17+
18+ Hash = Strict::Hash
19+ String = Strict::String
20+end
21+
22+class Item < Dry::Struct
23+ attribute :aa, Types::String.optional
24+ attribute :bb, Types::String.optional
25+ attribute :cc, Types::String.optional
26+ attribute :dd, Types::String.optional
27+
28+ def self.from_dynamic!(d)
29+ d = Types::Hash[d]
30+ new(
31+ aa: d["aa"],
32+ bb: d["bb"],
33+ cc: d["cc"],
34+ dd: d["dd"],
35+ )
36+ end
37+
38+ def self.from_json!(json)
39+ from_dynamic!(JSON.parse(json))
40+ end
41+
42+ def to_dynamic
43+ {
44+ "aa" => aa,
45+ "bb" => bb,
46+ "cc" => cc,
47+ "dd" => dd,
48+ }
49+ end
50+
51+ def to_json(options = nil)
52+ JSON.generate(to_dynamic, options)
53+ end
54+end
55+
56+class TopLevel < Dry::Struct
57+ attribute :items, Types.Array(Item)
58+
59+ def self.from_dynamic!(d)
60+ d = Types::Hash[d]
61+ new(
62+ items: d.fetch("items").map { |x| Item.from_dynamic!(x) },
63+ )
64+ end
65+
66+ def self.from_json!(json)
67+ from_dynamic!(JSON.parse(json))
68+ end
69+
70+ def to_dynamic
71+ {
72+ "items" => items.map { |x| x.to_dynamic },
73+ }
74+ end
75+
76+ def to_json(options = nil)
77+ JSON.generate(to_dynamic, options)
78+ end
79+end
Aschema-rust/test/inputs/schema/one-of-objects.schema/default/module_under_test.rs+30 −0
@@ -0,0 +1,30 @@
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::TopLevel;
8+//
9+// fn main() {
10+// let json = r#"{"answer": 42}"#;
11+// let model: TopLevel = serde_json::from_str(&json).unwrap();
12+// }
13+
14+use serde::{Serialize, Deserialize};
15+
16+#[derive(Debug, Clone, Serialize, Deserialize)]
17+pub struct TopLevel {
18+ pub items: Vec<Item>,
19+}
20+
21+#[derive(Debug, Clone, Serialize, Deserialize)]
22+pub struct Item {
23+ pub aa: Option<String>,
24+
25+ pub bb: Option<String>,
26+
27+ pub cc: Option<String>,
28+
29+ pub dd: Option<String>,
30+}
Aschema-scala3-upickle/test/inputs/schema/one-of-objects.schema/default/TopLevel.scala+19 −0
@@ -0,0 +1,19 @@
1+package quicktype
2+
3+import io.circe.syntax._
4+import io.circe._
5+import cats.syntax.functor._
6+
7+// If a union has a null in, then we'll need this too...
8+type NullValue = None.type
9+
10+case class TopLevel (
11+ val items : Seq[Item]
12+) derives Encoder.AsObject, Decoder
13+
14+case class Item (
15+ val aa : Option[String] = None,
16+ val bb : Option[String] = None,
17+ val cc : Option[String] = None,
18+ val dd : Option[String] = None
19+) derives Encoder.AsObject, Decoder
Aschema-scala3/test/inputs/schema/one-of-objects.schema/default/TopLevel.scala+77 −0
@@ -0,0 +1,77 @@
1+package quicktype
2+
3+// Custom pickler so that missing keys and JSON nulls both read as None,
4+// and None is left out when writing (upickle's default for Option is a
5+// JSON array).
6+object OptionPickler extends upickle.AttributeTagged:
7+ import upickle.default.Writer
8+ import upickle.default.Reader
9+ override implicit def OptionWriter[T: Writer]: Writer[Option[T]] =
10+ implicitly[Writer[T]].comap[Option[T]] {
11+ case None => null.asInstanceOf[T]
12+ case Some(x) => x
13+ }
14+
15+ override implicit def OptionReader[T: Reader]: Reader[Option[T]] = {
16+ new Reader.Delegate[Any, Option[T]](implicitly[Reader[T]].map(Some(_))){
17+ override def visitNull(index: Int) = None
18+ }
19+ }
20+end OptionPickler
21+
22+// If a union has a null in, then we'll need this too...
23+type NullValue = None.type
24+given OptionPickler.ReadWriter[NullValue] = OptionPickler.readwriter[ujson.Value].bimap[NullValue](
25+ _ => ujson.Null,
26+ json => if json.isNull then None else throw new upickle.core.Abort("not null")
27+)
28+
29+object JsonExt:
30+ val valueReader = OptionPickler.readwriter[ujson.Value]
31+
32+ // upickle's built-in primitive readers are lenient -- the numeric and
33+ // boolean readers accept strings, and the string reader accepts
34+ // numbers and booleans -- so untagged unions need strict readers to
35+ // pick the right member.
36+ val strictString: OptionPickler.Reader[String] = valueReader.map {
37+ case ujson.Str(s) => s
38+ case json => throw new upickle.core.Abort("expected string, got " + json)
39+ }
40+ val strictLong: OptionPickler.Reader[Long] = valueReader.map {
41+ case ujson.Num(n) if n.isWhole => n.toLong
42+ case json => throw new upickle.core.Abort("expected integer, got " + json)
43+ }
44+ val strictDouble: OptionPickler.Reader[Double] = valueReader.map {
45+ case ujson.Num(n) => n
46+ case json => throw new upickle.core.Abort("expected number, got " + json)
47+ }
48+ val strictBoolean: OptionPickler.Reader[Boolean] = valueReader.map {
49+ case ujson.Bool(b) => b
50+ case json => throw new upickle.core.Abort("expected boolean, got " + json)
51+ }
52+
53+ def badMerge[T](r1: => OptionPickler.Reader[?], rest: OptionPickler.Reader[?]*): OptionPickler.Reader[T] = valueReader.map { json =>
54+ var t: T | Null = null
55+ val stack = Vector.newBuilder[Throwable]
56+ (r1 +: rest).foreach { reader =>
57+ if t == null then
58+ try
59+ t = OptionPickler.read[T](json, trace = true)(using reader.asInstanceOf[OptionPickler.Reader[T]])
60+ catch
61+ case exc => stack += exc
62+ }
63+ if t != null then t.nn else throw new Exception(json.toString(), stack.result().headOption.getOrElse(null))
64+ }
65+end JsonExt
66+
67+
68+case class TopLevel (
69+ val items : Seq[Item]
70+) derives OptionPickler.ReadWriter
71+
72+case class Item (
73+ val aa : Option[String] = None,
74+ val bb : Option[String] = None,
75+ val cc : Option[String] = None,
76+ val dd : Option[String] = None
77+) derives OptionPickler.ReadWriter
Mschema-schema/test/inputs/schema/class-map-union.schema/default/TopLevel.schema+28 −38
@@ -13,23 +13,29 @@
1313 "required": [],
1414 "title": "TopLevel"
1515 },
16- "TopLevelUnion": {
16+ "PurpleUnion": {
1717 "type": "object",
18- "additionalProperties": {
19- "$ref": "#/definitions/UnionValue"
20- },
18+ "additionalProperties": false,
2119 "properties": {
2220 "foo": {
23- "$ref": "#/definitions/Foo"
24- },
21+ "type": "number"
22+ }
23+ },
24+ "required": [],
25+ "title": "PurpleUnion"
26+ },
27+ "FluffyUnion": {
28+ "type": "object",
29+ "additionalProperties": false,
30+ "properties": {
2531 "bar": {
26- "$ref": "#/definitions/Bar"
32+ "type": "string"
2733 }
2834 },
2935 "required": [],
30- "title": "TopLevelUnion"
36+ "title": "FluffyUnion"
3137 },
32- "BarObject": {
38+ "UnionValue": {
3339 "type": "object",
3440 "additionalProperties": {},
3541 "properties": {
@@ -38,46 +44,30 @@
3844 }
3945 },
4046 "required": [],
41- "title": "BarObject"
42- },
43- "Bar": {
44- "anyOf": [
45- {
46- "type": "boolean"
47- },
48- {
49- "$ref": "#/definitions/BarObject"
50- },
51- {
52- "type": "string"
53- }
54- ],
55- "title": "Bar"
47+ "title": "UnionValue"
5648 },
57- "Foo": {
49+ "TopLevelUnion": {
5850 "anyOf": [
5951 {
60- "type": "boolean"
52+ "$ref": "#/definitions/PurpleUnion"
6153 },
6254 {
63- "type": "number"
55+ "$ref": "#/definitions/FluffyUnion"
6456 },
6557 {
66- "$ref": "#/definitions/BarObject"
67- }
68- ],
69- "title": "Foo"
70- },
71- "UnionValue": {
72- "anyOf": [
73- {
74- "type": "boolean"
58+ "type": "object",
59+ "additionalProperties": {
60+ "type": "boolean"
61+ }
7562 },
7663 {
77- "$ref": "#/definitions/BarObject"
64+ "type": "object",
65+ "additionalProperties": {
66+ "$ref": "#/definitions/UnionValue"
67+ }
7868 }
7969 ],
80- "title": "UnionValue"
70+ "title": "TopLevelUnion"
8171 }
8272 }
8373 }
Mschema-schema/test/inputs/schema/nested-intersection-union.schema/default/TopLevel.schema+41 −4
@@ -18,24 +18,61 @@
1818 ],
1919 "title": "TopLevel"
2020 },
21- "Item": {
21+ "Message": {
2222 "type": "object",
2323 "additionalProperties": {},
2424 "properties": {
2525 "content": {
2626 "type": "string"
27- },
27+ }
28+ },
29+ "required": [
30+ "content"
31+ ],
32+ "title": "Message"
33+ },
34+ "FunctionOutput": {
35+ "type": "object",
36+ "additionalProperties": {},
37+ "properties": {
2838 "id": {
2939 "type": "string"
3040 },
3141 "output": {
3242 "type": "string"
33- },
43+ }
44+ },
45+ "required": [
46+ "id",
47+ "output"
48+ ],
49+ "title": "FunctionOutput"
50+ },
51+ "ReasoningItem": {
52+ "type": "object",
53+ "additionalProperties": {},
54+ "properties": {
3455 "summary": {
3556 "type": "string"
3657 }
3758 },
38- "required": [],
59+ "required": [
60+ "summary"
61+ ],
62+ "title": "ReasoningItem"
63+ },
64+ "Item": {
65+ "anyOf": [
66+ {
67+ "$ref": "#/definitions/Message"
68+ },
69+ {
70+ "$ref": "#/definitions/FunctionOutput"
71+ },
72+ {
73+ "$ref": "#/definitions/ReasoningItem"
74+ }
75+ ],
3976 "title": "Item"
4077 }
4178 }
Mschema-schema/test/inputs/schema/nullable-optional-one-of.schema/default/TopLevel.schema+46 −5
@@ -2,7 +2,31 @@
22 "$schema": "http://json-schema.org/draft-06/schema#",
33 "$ref": "#/definitions/TopLevel",
44 "definitions": {
5- "TopLevel": {
5+ "One": {
6+ "type": "object",
7+ "additionalProperties": {},
8+ "properties": {
9+ "b": {
10+ "anyOf": [
11+ {
12+ "type": "null"
13+ },
14+ {
15+ "type": "string"
16+ }
17+ ]
18+ },
19+ "kind": {
20+ "$ref": "#/definitions/PurpleKind"
21+ }
22+ },
23+ "required": [
24+ "b",
25+ "kind"
26+ ],
27+ "title": "One"
28+ },
29+ "Two": {
630 "type": "object",
731 "additionalProperties": {},
832 "properties": {
@@ -17,21 +41,38 @@
1741 ]
1842 },
1943 "kind": {
20- "$ref": "#/definitions/Kind"
44+ "$ref": "#/definitions/FluffyKind"
2145 }
2246 },
2347 "required": [
2448 "kind"
2549 ],
50+ "title": "Two"
51+ },
52+ "TopLevel": {
53+ "anyOf": [
54+ {
55+ "$ref": "#/definitions/One"
56+ },
57+ {
58+ "$ref": "#/definitions/Two"
59+ }
60+ ],
2661 "title": "TopLevel"
2762 },
28- "Kind": {
63+ "PurpleKind": {
64+ "type": "string",
65+ "enum": [
66+ "one"
67+ ],
68+ "title": "PurpleKind"
69+ },
70+ "FluffyKind": {
2971 "type": "string",
3072 "enum": [
31- "one",
3273 "two"
3374 ],
34- "title": "Kind"
75+ "title": "FluffyKind"
3576 }
3677 }
3778 }
Aschema-schema/test/inputs/schema/one-of-objects.schema/default/TopLevel.schema+61 −0
@@ -0,0 +1,61 @@
1+{
2+ "$schema": "http://json-schema.org/draft-06/schema#",
3+ "$ref": "#/definitions/TopLevel",
4+ "definitions": {
5+ "TopLevel": {
6+ "type": "object",
7+ "additionalProperties": false,
8+ "properties": {
9+ "items": {
10+ "type": "array",
11+ "items": {
12+ "$ref": "#/definitions/ItemElement"
13+ }
14+ }
15+ },
16+ "required": [
17+ "items"
18+ ],
19+ "title": "TopLevel"
20+ },
21+ "PurpleItem": {
22+ "type": "object",
23+ "additionalProperties": false,
24+ "properties": {
25+ "aa": {
26+ "type": "string"
27+ },
28+ "bb": {
29+ "type": "string"
30+ }
31+ },
32+ "required": [],
33+ "title": "PurpleItem"
34+ },
35+ "FluffyItem": {
36+ "type": "object",
37+ "additionalProperties": false,
38+ "properties": {
39+ "cc": {
40+ "type": "string"
41+ },
42+ "dd": {
43+ "type": "string"
44+ }
45+ },
46+ "required": [],
47+ "title": "FluffyItem"
48+ },
49+ "ItemElement": {
50+ "anyOf": [
51+ {
52+ "$ref": "#/definitions/PurpleItem"
53+ },
54+ {
55+ "$ref": "#/definitions/FluffyItem"
56+ }
57+ ],
58+ "title": "ItemElement"
59+ }
60+ }
61+}
Mschema-schema/test/inputs/schema/postman-collection.schema/default/TopLevel.schema+23 −4
@@ -2,7 +2,7 @@
22 "$schema": "http://json-schema.org/draft-06/schema#",
33 "$ref": "#/definitions/TopLevel",
44 "definitions": {
5- "TopLevel": {
5+ "Group": {
66 "type": "object",
77 "additionalProperties": {},
88 "properties": {
@@ -11,7 +11,15 @@
1111 "items": {
1212 "$ref": "#/definitions/TopLevel"
1313 }
14- },
14+ }
15+ },
16+ "required": [],
17+ "title": "Group"
18+ },
19+ "Item": {
20+ "type": "object",
21+ "additionalProperties": {},
22+ "properties": {
1523 "name": {
1624 "type": "string"
1725 },
@@ -23,8 +31,7 @@
2331 }
2432 },
2533 "required": [],
26- "title": "TopLevel",
27- "description": "Postman collection"
34+ "title": "Item"
2835 },
2936 "Response": {
3037 "type": "object",
@@ -36,6 +43,18 @@
3643 },
3744 "required": [],
3845 "title": "Response"
46+ },
47+ "TopLevel": {
48+ "anyOf": [
49+ {
50+ "$ref": "#/definitions/Group"
51+ },
52+ {
53+ "$ref": "#/definitions/Item"
54+ }
55+ ],
56+ "title": "TopLevel",
57+ "description": "Postman collection"
3958 }
4059 }
4160 }
Mschema-schema/test/inputs/schema/union.schema/default/TopLevel.schema+28 −2
@@ -5,7 +5,7 @@
55 "$ref": "#/definitions/TopLevelElement"
66 },
77 "definitions": {
8- "TopLevelElement": {
8+ "PurpleTopLevel": {
99 "type": "object",
1010 "additionalProperties": {},
1111 "properties": {
@@ -14,14 +14,40 @@
1414 },
1515 "two": {
1616 "type": "boolean"
17- },
17+ }
18+ },
19+ "required": [
20+ "one",
21+ "two"
22+ ],
23+ "title": "PurpleTopLevel"
24+ },
25+ "FluffyTopLevel": {
26+ "type": "object",
27+ "additionalProperties": {},
28+ "properties": {
1829 "three": {
1930 "type": "number"
31+ },
32+ "two": {
33+ "type": "boolean"
2034 }
2135 },
2236 "required": [
37+ "three",
2338 "two"
2439 ],
40+ "title": "FluffyTopLevel"
41+ },
42+ "TopLevelElement": {
43+ "anyOf": [
44+ {
45+ "$ref": "#/definitions/PurpleTopLevel"
46+ },
47+ {
48+ "$ref": "#/definitions/FluffyTopLevel"
49+ }
50+ ],
2551 "title": "TopLevelElement"
2652 }
2753 }
Mschema-schema/test/inputs/schema/vega-lite.schema/default/TopLevel.schema+4,079 −2,771
@@ -2,7 +2,7 @@
22 "$schema": "http://json-schema.org/draft-06/schema#",
33 "$ref": "#/definitions/TopLevel",
44 "definitions": {
5- "TopLevel": {
5+ "TopLevelFacetedUnitSpec": {
66 "type": "object",
77 "additionalProperties": false,
88 "properties": {
@@ -75,725 +75,526 @@
7575 "width": {
7676 "type": "number",
7777 "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its x-channel has a\n[continuous scale](scale.html#continuous), the width will be the value of\n[`config.view.width`](spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the width is [determined by the range step, paddings, and the\ncardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the width will be the value of\n[`config.view.width`](spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of\n[`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and\nthe value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the width of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
78+ }
79+ },
80+ "required": [
81+ "encoding",
82+ "mark"
83+ ],
84+ "title": "TopLevelFacetedUnitSpec"
85+ },
86+ "TopLevelLayerSpec": {
87+ "type": "object",
88+ "additionalProperties": false,
89+ "properties": {
90+ "$schema": {
91+ "type": "string",
92+ "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you\nhave a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.\nSetting the `$schema` property allows automatic validation and autocomplete in editors\nthat support JSON schema."
93+ },
94+ "autosize": {
95+ "$ref": "#/definitions/Autosize",
96+ "description": "Sets how the visualization size should be determined. If a string, should be one of\n`\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic\nresizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`"
97+ },
98+ "background": {
99+ "type": "string",
100+ "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
101+ },
102+ "config": {
103+ "$ref": "#/definitions/Config",
104+ "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a\nspecification."
105+ },
106+ "data": {
107+ "$ref": "#/definitions/Data",
108+ "description": "An object describing the data source"
109+ },
110+ "description": {
111+ "type": "string",
112+ "description": "Description of this mark for commenting purpose."
113+ },
114+ "height": {
115+ "type": "number",
116+ "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its y-channel has a\n[continuous scale](scale.html#continuous), the height will be the value of\n[`config.view.height`](spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the height is [determined by the range step, paddings, and the\ncardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the height will be the value of\n[`config.view.height`](spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the height of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
78117 },
79118 "layer": {
80119 "type": "array",
81120 "items": {
82- "$ref": "#/definitions/LayerSpec"
121+ "$ref": "#/definitions/SpecElement"
83122 },
84123 "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as\nlayering facet specifications is not allowed."
85124 },
86- "resolve": {
87- "$ref": "#/definitions/Resolve",
88- "description": "Scale, axis, and legend resolutions for layers.\n\nScale, axis, and legend resolutions for facets.\n\nScale and legend resolutions for repeated charts.\n\nScale, axis, and legend resolutions for vertically concatenated charts.\n\nScale, axis, and legend resolutions for horizontally concatenated charts."
89- },
90- "facet": {
91- "$ref": "#/definitions/FacetMapping",
92- "description": "An object that describes mappings between `row` and `column` channels and their field\ndefinitions."
125+ "name": {
126+ "type": "string",
127+ "description": "Name of the visualization for later reference."
93128 },
94- "spec": {
95- "$ref": "#/definitions/Spec",
96- "description": "A specification of the view that gets faceted."
129+ "padding": {
130+ "$ref": "#/definitions/Padding",
131+ "description": "The default visualization padding, in pixels, from the edge of the visualization canvas\nto the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5,\n\"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`"
97132 },
98- "repeat": {
99- "$ref": "#/definitions/Repeat",
100- "description": "An object that describes what fields should be repeated into views that are laid out as a\n`row` or `column`."
133+ "resolve": {
134+ "$ref": "#/definitions/Resolve",
135+ "description": "Scale, axis, and legend resolutions for layers."
101136 },
102- "vconcat": {
103- "type": "array",
104- "items": {
105- "$ref": "#/definitions/Spec"
106- },
107- "description": "A list of views that should be concatenated and put into a column."
137+ "title": {
138+ "$ref": "#/definitions/Title",
139+ "description": "Title for the plot."
108140 },
109- "hconcat": {
141+ "transform": {
110142 "type": "array",
111143 "items": {
112- "$ref": "#/definitions/Spec"
144+ "$ref": "#/definitions/Transform"
113145 },
114- "description": "A list of views that should be concatenated and put into a row."
115- }
116- },
117- "required": [],
118- "title": "TopLevel"
119- },
120- "AutoSizeParams": {
121- "type": "object",
122- "additionalProperties": false,
123- "properties": {
124- "contains": {
125- "$ref": "#/definitions/Contains",
126- "description": "Determines how size calculation should be performed, one of `\"content\"` or `\"padding\"`.\nThe default setting (`\"content\"`) interprets the width and height settings as the data\nrectangle (plotting) dimensions, to which padding is then added. In contrast, the\n`\"padding\"` setting includes the padding within the view size calculations, such that the\nwidth and height settings indicate the **total** intended size of the view.\n\n__Default value__: `\"content\"`"
127- },
128- "resize": {
129- "type": "boolean",
130- "description": "A boolean flag indicating if autosize layout should be re-calculated on every view\nupdate.\n\n__Default value__: `false`"
146+ "description": "An array of data transformations such as filter and new field calculation."
131147 },
132- "type": {
133- "$ref": "#/definitions/AutosizeType",
134- "description": "The sizing format type. One of `\"pad\"`, `\"fit\"` or `\"none\"`. See the [autosize\ntype](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for\ndescriptions of each.\n\n__Default value__: `\"pad\"`"
148+ "width": {
149+ "type": "number",
150+ "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its x-channel has a\n[continuous scale](scale.html#continuous), the width will be the value of\n[`config.view.width`](spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the width is [determined by the range step, paddings, and the\ncardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the width will be the value of\n[`config.view.width`](spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of\n[`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and\nthe value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the width of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
135151 }
136152 },
137- "required": [],
138- "title": "AutoSizeParams"
153+ "required": [
154+ "layer"
155+ ],
156+ "title": "TopLevelLayerSpec"
139157 },
140- "Config": {
158+ "TopLevelFacetSpec": {
141159 "type": "object",
142160 "additionalProperties": false,
143161 "properties": {
144- "area": {
145- "$ref": "#/definitions/MarkConfig",
146- "description": "Area-Specific Config"
162+ "$schema": {
163+ "type": "string",
164+ "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you\nhave a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.\nSetting the `$schema` property allows automatic validation and autocomplete in editors\nthat support JSON schema."
147165 },
148166 "autosize": {
149167 "$ref": "#/definitions/Autosize",
150168 "description": "Sets how the visualization size should be determined. If a string, should be one of\n`\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic\nresizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`"
151169 },
152- "axis": {
153- "$ref": "#/definitions/AxisConfig",
154- "description": "Axis configuration, which determines default properties for all `x` and `y`\n[axes](axis.html). For a full list of axis configuration options, please see the\n[corresponding section of the axis documentation](axis.html#config)."
155- },
156- "axisBand": {
157- "$ref": "#/definitions/VGAxisConfig",
158- "description": "Specific axis config for axes with \"band\" scales."
170+ "background": {
171+ "type": "string",
172+ "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
159173 },
160- "axisBottom": {
161- "$ref": "#/definitions/VGAxisConfig",
162- "description": "Specific axis config for x-axis along the bottom edge of the chart."
174+ "config": {
175+ "$ref": "#/definitions/Config",
176+ "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a\nspecification."
163177 },
164- "axisLeft": {
165- "$ref": "#/definitions/VGAxisConfig",
166- "description": "Specific axis config for y-axis along the left edge of the chart."
178+ "data": {
179+ "$ref": "#/definitions/Data",
180+ "description": "An object describing the data source"
167181 },
168- "axisRight": {
169- "$ref": "#/definitions/VGAxisConfig",
170- "description": "Specific axis config for y-axis along the right edge of the chart."
182+ "description": {
183+ "type": "string",
184+ "description": "Description of this mark for commenting purpose."
171185 },
172- "axisTop": {
173- "$ref": "#/definitions/VGAxisConfig",
174- "description": "Specific axis config for x-axis along the top edge of the chart."
186+ "facet": {
187+ "$ref": "#/definitions/FacetMapping",
188+ "description": "An object that describes mappings between `row` and `column` channels and their field\ndefinitions."
175189 },
176- "axisX": {
177- "$ref": "#/definitions/VGAxisConfig",
178- "description": "X-axis specific config."
190+ "name": {
191+ "type": "string",
192+ "description": "Name of the visualization for later reference."
179193 },
180- "axisY": {
181- "$ref": "#/definitions/VGAxisConfig",
182- "description": "Y-axis specific config."
194+ "padding": {
195+ "$ref": "#/definitions/Padding",
196+ "description": "The default visualization padding, in pixels, from the edge of the visualization canvas\nto the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5,\n\"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`"
183197 },
184- "background": {
185- "type": "string",
186- "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
198+ "resolve": {
199+ "$ref": "#/definitions/Resolve",
200+ "description": "Scale, axis, and legend resolutions for facets."
187201 },
188- "bar": {
189- "$ref": "#/definitions/BarConfig",
190- "description": "Bar-Specific Config"
202+ "spec": {
203+ "$ref": "#/definitions/SpecElement",
204+ "description": "A specification of the view that gets faceted."
191205 },
192- "circle": {
193- "$ref": "#/definitions/MarkConfig",
194- "description": "Circle-Specific Config"
206+ "title": {
207+ "$ref": "#/definitions/Title",
208+ "description": "Title for the plot."
195209 },
196- "countTitle": {
210+ "transform": {
211+ "type": "array",
212+ "items": {
213+ "$ref": "#/definitions/Transform"
214+ },
215+ "description": "An array of data transformations such as filter and new field calculation."
216+ }
217+ },
218+ "required": [
219+ "facet",
220+ "spec"
221+ ],
222+ "title": "TopLevelFacetSpec"
223+ },
224+ "TopLevelRepeatSpec": {
225+ "type": "object",
226+ "additionalProperties": false,
227+ "properties": {
228+ "$schema": {
197229 "type": "string",
198- "description": "Default axis and legend title for count fields.\n\n__Default value:__ `'Number of Records'`."
199- },
200- "fieldTitle": {
201- "$ref": "#/definitions/FieldTitle",
202- "description": "Defines how Vega-Lite generates title for fields. There are three possible styles:\n\n- `\"verbal\"` (Default) - displays function in a verbal style (e.g., \"Sum of field\",\n\"Year-month of date\", \"field (binned)\").\n- `\"function\"` - displays function using parentheses and capitalized texts (e.g.,\n\"SUM(field)\", \"YEARMONTH(date)\", \"BIN(field)\").\n- `\"plain\"` - displays only the field name without functions (e.g., \"field\", \"date\",\n\"field\")."
230+ "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you\nhave a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.\nSetting the `$schema` property allows automatic validation and autocomplete in editors\nthat support JSON schema."
203231 },
204- "geoshape": {
205- "$ref": "#/definitions/MarkConfig",
206- "description": "Geoshape-Specific Config"
232+ "autosize": {
233+ "$ref": "#/definitions/Autosize",
234+ "description": "Sets how the visualization size should be determined. If a string, should be one of\n`\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic\nresizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`"
207235 },
208- "invalidValues": {
209- "$ref": "#/definitions/InvalidValues",
210- "description": "Defines how Vega-Lite should handle invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values are filtered.\n- If `null`, all data items are included. In this case, invalid values will be\ninterpreted as zeroes."
236+ "background": {
237+ "type": "string",
238+ "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
211239 },
212- "legend": {
213- "$ref": "#/definitions/LegendConfig",
214- "description": "Legend configuration, which determines default properties for all [legends](legend.html).\nFor a full list of legend configuration options, please see the [corresponding section of\nin the legend documentation](legend.html#config)."
240+ "config": {
241+ "$ref": "#/definitions/Config",
242+ "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a\nspecification."
215243 },
216- "line": {
217- "$ref": "#/definitions/MarkConfig",
218- "description": "Line-Specific Config"
244+ "data": {
245+ "$ref": "#/definitions/Data",
246+ "description": "An object describing the data source"
219247 },
220- "mark": {
221- "$ref": "#/definitions/MarkConfig",
222- "description": "Mark Config"
248+ "description": {
249+ "type": "string",
250+ "description": "Description of this mark for commenting purpose."
223251 },
224- "numberFormat": {
252+ "name": {
225253 "type": "string",
226- "description": "D3 Number format for axis labels and text tables. For example \"s\" for SI units. Use [D3's\nnumber format pattern](https://github.com/d3/d3-format#locale_format)."
254+ "description": "Name of the visualization for later reference."
227255 },
228256 "padding": {
229257 "$ref": "#/definitions/Padding",
230258 "description": "The default visualization padding, in pixels, from the edge of the visualization canvas\nto the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5,\n\"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`"
231259 },
232- "point": {
233- "$ref": "#/definitions/MarkConfig",
234- "description": "Point-Specific Config"
235- },
236- "projection": {
237- "$ref": "#/definitions/ProjectionConfig",
238- "description": "Projection configuration, which determines default properties for all\n[projections](projection.html). For a full list of projection configuration options,\nplease see the [corresponding section of the projection\ndocumentation](projection.html#config)."
239- },
240- "range": {
241- "$ref": "#/definitions/RangeConfig",
242- "description": "An object hash that defines default range arrays or schemes for using with scales.\nFor a full list of scale range configuration options, please see the [corresponding\nsection of the scale documentation](scale.html#config)."
243- },
244- "rect": {
245- "$ref": "#/definitions/MarkConfig",
246- "description": "Rect-Specific Config"
260+ "repeat": {
261+ "$ref": "#/definitions/Repeat",
262+ "description": "An object that describes what fields should be repeated into views that are laid out as a\n`row` or `column`."
247263 },
248- "rule": {
249- "$ref": "#/definitions/MarkConfig",
250- "description": "Rule-Specific Config"
264+ "resolve": {
265+ "$ref": "#/definitions/Resolve",
266+ "description": "Scale and legend resolutions for repeated charts."
251267 },
252- "scale": {
253- "$ref": "#/definitions/ScaleConfig",
254- "description": "Scale configuration determines default properties for all [scales](scale.html). For a\nfull list of scale configuration options, please see the [corresponding section of the\nscale documentation](scale.html#config)."
268+ "spec": {
269+ "$ref": "#/definitions/Spec"
255270 },
256- "selection": {
257- "$ref": "#/definitions/SelectionConfig",
258- "description": "An object hash for defining default properties for each type of selections."
271+ "title": {
272+ "$ref": "#/definitions/Title",
273+ "description": "Title for the plot."
259274 },
260- "square": {
261- "$ref": "#/definitions/MarkConfig",
262- "description": "Square-Specific Config"
263- },
264- "stack": {
265- "$ref": "#/definitions/StackOffset",
266- "description": "Default stack offset for stackable mark."
267- },
268- "style": {
269- "type": "object",
270- "additionalProperties": {
271- "$ref": "#/definitions/VGMarkConfig"
275+ "transform": {
276+ "type": "array",
277+ "items": {
278+ "$ref": "#/definitions/Transform"
272279 },
273- "description": "An object hash that defines key-value mappings to determine default properties for marks with a given [style](mark.html#mark-def). The keys represent styles names; the value are valid [mark configuration objects](mark.html#config). "
274- },
275- "text": {
276- "$ref": "#/definitions/TextConfig",
277- "description": "Text-Specific Config"
278- },
279- "tick": {
280- "$ref": "#/definitions/TickConfig",
281- "description": "Tick-Specific Config"
282- },
283- "timeFormat": {
284- "type": "string",
285- "description": "Default datetime format for axis and legend labels. The format can be set directly on\neach axis and legend. Use [D3's time format\npattern](https://github.com/d3/d3-time-format#locale_format).\n\n__Default value:__ `'%b %d, %Y'`."
286- },
287- "title": {
288- "$ref": "#/definitions/VGTitleConfig",
289- "description": "Title configuration, which determines default properties for all [titles](title.html).\nFor a full list of title configuration options, please see the [corresponding section of\nthe title documentation](title.html#config)."
290- },
291- "view": {
292- "$ref": "#/definitions/ViewConfig",
293- "description": "Default properties for [single view plots](spec.html#single)."
280+ "description": "An array of data transformations such as filter and new field calculation."
294281 }
295282 },
296- "required": [],
297- "title": "Config",
298- "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification."
283+ "required": [
284+ "repeat",
285+ "spec"
286+ ],
287+ "title": "TopLevelRepeatSpec"
299288 },
300- "MarkConfig": {
289+ "TopLevelVConcatSpec": {
301290 "type": "object",
302291 "additionalProperties": false,
303292 "properties": {
304- "align": {
305- "$ref": "#/definitions/HorizontalAlign",
306- "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
307- },
308- "angle": {
309- "type": "number",
310- "minimum": 0,
311- "maximum": 360,
312- "description": "The rotation angle of the text, in degrees."
313- },
314- "baseline": {
315- "$ref": "#/definitions/VerticalAlign",
316- "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
317- },
318- "color": {
293+ "$schema": {
319294 "type": "string",
320- "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
321- },
322- "cursor": {
323- "$ref": "#/definitions/Cursor",
324- "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
325- },
326- "dx": {
327- "type": "number",
328- "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
295+ "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you\nhave a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.\nSetting the `$schema` property allows automatic validation and autocomplete in editors\nthat support JSON schema."
329296 },
330- "dy": {
331- "type": "number",
332- "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
297+ "autosize": {
298+ "$ref": "#/definitions/Autosize",
299+ "description": "Sets how the visualization size should be determined. If a string, should be one of\n`\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic\nresizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`"
333300 },
334- "fill": {
301+ "background": {
335302 "type": "string",
336- "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
303+ "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
337304 },
338- "filled": {
339- "type": "boolean",
340- "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
305+ "config": {
306+ "$ref": "#/definitions/Config",
307+ "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a\nspecification."
341308 },
342- "fillOpacity": {
343- "type": "number",
344- "minimum": 0,
345- "maximum": 1,
346- "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
309+ "data": {
310+ "$ref": "#/definitions/Data",
311+ "description": "An object describing the data source"
347312 },
348- "font": {
313+ "description": {
349314 "type": "string",
350- "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
351- },
352- "fontSize": {
353- "type": "number",
354- "minimum": 0,
355- "description": "The font size, in pixels."
356- },
357- "fontStyle": {
358- "$ref": "#/definitions/FontStyle",
359- "description": "The font style (e.g., `\"italic\"`)."
360- },
361- "fontWeight": {
362- "$ref": "#/definitions/FontWeightUnion",
363- "description": "The font weight (e.g., `\"bold\"`)."
315+ "description": "Description of this mark for commenting purpose."
364316 },
365- "href": {
317+ "name": {
366318 "type": "string",
367- "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
368- },
369- "interpolate": {
370- "$ref": "#/definitions/Interpolate",
371- "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
372- },
373- "limit": {
374- "type": "number",
375- "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
376- },
377- "opacity": {
378- "type": "number",
379- "minimum": 0,
380- "maximum": 1,
381- "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
382- },
383- "orient": {
384- "$ref": "#/definitions/Orient",
385- "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
386- },
387- "radius": {
388- "type": "number",
389- "minimum": 0,
390- "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
319+ "description": "Name of the visualization for later reference."
391320 },
392- "shape": {
393- "type": "string",
394- "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
321+ "padding": {
322+ "$ref": "#/definitions/Padding",
323+ "description": "The default visualization padding, in pixels, from the edge of the visualization canvas\nto the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5,\n\"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`"
395324 },
396- "size": {
397- "type": "number",
398- "minimum": 0,
399- "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
325+ "resolve": {
326+ "$ref": "#/definitions/Resolve",
327+ "description": "Scale, axis, and legend resolutions for vertically concatenated charts."
400328 },
401- "stroke": {
402- "type": "string",
403- "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
329+ "title": {
330+ "$ref": "#/definitions/Title",
331+ "description": "Title for the plot."
404332 },
405- "strokeDash": {
333+ "transform": {
406334 "type": "array",
407335 "items": {
408- "type": "number"
336+ "$ref": "#/definitions/Transform"
409337 },
410- "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
411- },
412- "strokeDashOffset": {
413- "type": "number",
414- "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
415- },
416- "strokeOpacity": {
417- "type": "number",
418- "minimum": 0,
419- "maximum": 1,
420- "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
421- },
422- "strokeWidth": {
423- "type": "number",
424- "minimum": 0,
425- "description": "The stroke width, in pixels."
426- },
427- "tension": {
428- "type": "number",
429- "minimum": 0,
430- "maximum": 1,
431- "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
432- },
433- "text": {
434- "type": "string",
435- "description": "Placeholder text if the `text` channel is not specified"
338+ "description": "An array of data transformations such as filter and new field calculation."
436339 },
437- "theta": {
438- "type": "number",
439- "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
340+ "vconcat": {
341+ "type": "array",
342+ "items": {
343+ "$ref": "#/definitions/Spec"
344+ },
345+ "description": "A list of views that should be concatenated and put into a column."
440346 }
441347 },
442- "required": [],
443- "title": "MarkConfig",
444- "description": "Area-Specific Config \nCircle-Specific Config \nGeoshape-Specific Config \nLine-Specific Config \nMark Config \nPoint-Specific Config \nRect-Specific Config \nRule-Specific Config \nSquare-Specific Config "
348+ "required": [
349+ "vconcat"
350+ ],
351+ "title": "TopLevelVConcatSpec"
445352 },
446- "AxisConfig": {
353+ "TopLevelHConcatSpec": {
447354 "type": "object",
448355 "additionalProperties": false,
449356 "properties": {
450- "bandPosition": {
451- "type": "number",
452- "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be\npositioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5`\nplaces ticks in the middle of their bands."
357+ "$schema": {
358+ "type": "string",
359+ "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you\nhave a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.\nSetting the `$schema` property allows automatic validation and autocomplete in editors\nthat support JSON schema."
453360 },
454- "domain": {
455- "type": "boolean",
456- "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of\nthe axis.\n\n__Default value:__ `true`"
361+ "autosize": {
362+ "$ref": "#/definitions/Autosize",
363+ "description": "Sets how the visualization size should be determined. If a string, should be one of\n`\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic\nresizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`"
457364 },
458- "domainColor": {
365+ "background": {
459366 "type": "string",
460- "description": "Color of axis domain line.\n\n__Default value:__ (none, using Vega default)."
367+ "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
461368 },
462- "domainWidth": {
463- "type": "number",
464- "description": "Stroke width of axis domain line\n\n__Default value:__ (none, using Vega default)."
369+ "config": {
370+ "$ref": "#/definitions/Config",
371+ "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a\nspecification."
465372 },
466- "grid": {
467- "type": "boolean",
468- "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](scale.html#continuous) that are not\nbinned; otherwise, `false`."
373+ "data": {
374+ "$ref": "#/definitions/Data",
375+ "description": "An object describing the data source"
469376 },
470- "gridColor": {
377+ "description": {
471378 "type": "string",
472- "description": "Color of gridlines."
379+ "description": "Description of this mark for commenting purpose."
473380 },
474- "gridDash": {
381+ "hconcat": {
475382 "type": "array",
476383 "items": {
477- "type": "number"
384+ "$ref": "#/definitions/Spec"
478385 },
479- "description": "The offset (in pixels) into which to begin drawing with the grid dash array."
386+ "description": "A list of views that should be concatenated and put into a row."
480387 },
481- "gridOpacity": {
482- "type": "number",
483- "minimum": 0,
484- "maximum": 1,
485- "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ (`1` by default)"
388+ "name": {
389+ "type": "string",
390+ "description": "Name of the visualization for later reference."
486391 },
487- "gridWidth": {
488- "type": "number",
489- "minimum": 0,
490- "description": "The grid width, in pixels."
392+ "padding": {
393+ "$ref": "#/definitions/Padding",
394+ "description": "The default visualization padding, in pixels, from the edge of the visualization canvas\nto the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5,\n\"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`"
491395 },
492- "labelAngle": {
493- "type": "number",
494- "minimum": -360,
495- "maximum": 360,
496- "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise."
396+ "resolve": {
397+ "$ref": "#/definitions/Resolve",
398+ "description": "Scale, axis, and legend resolutions for horizontally concatenated charts."
497399 },
498- "labelBound": {
499- "$ref": "#/definitions/Label",
500- "description": "Indicates if labels should be hidden if they exceed the axis range. If `false `(the\ndefault) no bounds overlap analysis is performed. If `true`, labels will be hidden if\nthey exceed the axis range by more than 1 pixel. If this property is a number, it\nspecifies the pixel tolerance: the maximum amount by which a label bounding box may\nexceed the axis range.\n\n__Default value:__ `false`."
400+ "title": {
401+ "$ref": "#/definitions/Title",
402+ "description": "Title for the plot."
501403 },
502- "labelColor": {
503- "type": "string",
504- "description": "The color of the tick label, can be in hex color code or regular color name."
404+ "transform": {
405+ "type": "array",
406+ "items": {
407+ "$ref": "#/definitions/Transform"
408+ },
409+ "description": "An array of data transformations such as filter and new field calculation."
410+ }
411+ },
412+ "required": [
413+ "hconcat"
414+ ],
415+ "title": "TopLevelHConcatSpec"
416+ },
417+ "AutoSizeParams": {
418+ "type": "object",
419+ "additionalProperties": false,
420+ "properties": {
421+ "contains": {
422+ "$ref": "#/definitions/Contains",
423+ "description": "Determines how size calculation should be performed, one of `\"content\"` or `\"padding\"`.\nThe default setting (`\"content\"`) interprets the width and height settings as the data\nrectangle (plotting) dimensions, to which padding is then added. In contrast, the\n`\"padding\"` setting includes the padding within the view size calculations, such that the\nwidth and height settings indicate the **total** intended size of the view.\n\n__Default value__: `\"content\"`"
505424 },
506- "labelFlush": {
507- "$ref": "#/definitions/Label",
508- "description": "Indicates if the first and last axis labels should be aligned flush with the scale range.\nFlush alignment for a horizontal axis will left-align the first label and right-align the\nlast label. For vertical axes, bottom and top text baselines are applied instead. If this\nproperty is a number, it also indicates the number of pixels by which to offset the first\nand last labels; for example, a value of 2 will flush-align the first and last labels and\nalso push them 2 pixels outward from the center of the axis. The additional adjustment\ncan sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`."
425+ "resize": {
426+ "type": "boolean",
427+ "description": "A boolean flag indicating if autosize layout should be re-calculated on every view\nupdate.\n\n__Default value__: `false`"
509428 },
510- "labelFont": {
511- "type": "string",
512- "description": "The font of the tick label."
429+ "type": {
430+ "$ref": "#/definitions/AutosizeType",
431+ "description": "The sizing format type. One of `\"pad\"`, `\"fit\"` or `\"none\"`. See the [autosize\ntype](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for\ndescriptions of each.\n\n__Default value__: `\"pad\"`"
432+ }
433+ },
434+ "required": [],
435+ "title": "AutoSizeParams"
436+ },
437+ "Config": {
438+ "type": "object",
439+ "additionalProperties": false,
440+ "properties": {
441+ "area": {
442+ "$ref": "#/definitions/MarkConfig",
443+ "description": "Area-Specific Config"
513444 },
514- "labelFontSize": {
515- "type": "number",
516- "minimum": 0,
517- "description": "The font size of the label, in pixels."
445+ "autosize": {
446+ "$ref": "#/definitions/Autosize",
447+ "description": "Sets how the visualization size should be determined. If a string, should be one of\n`\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic\nresizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`"
518448 },
519- "labelLimit": {
520- "type": "number",
521- "description": "Maximum allowed pixel width of axis tick labels."
449+ "axis": {
450+ "$ref": "#/definitions/AxisConfig",
451+ "description": "Axis configuration, which determines default properties for all `x` and `y`\n[axes](axis.html). For a full list of axis configuration options, please see the\n[corresponding section of the axis documentation](axis.html#config)."
522452 },
523- "labelOverlap": {
524- "$ref": "#/definitions/LabelOverlapUnion",
525- "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no\noverlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing\nevery other label is used (this works well for standard linear axes). If set to\n`\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps\nwith the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log\nscales; otherwise `false`."
453+ "axisBand": {
454+ "$ref": "#/definitions/VGAxisConfig",
455+ "description": "Specific axis config for axes with \"band\" scales."
526456 },
527- "labelPadding": {
528- "type": "number",
529- "description": "The padding, in pixels, between axis and text labels."
457+ "axisBottom": {
458+ "$ref": "#/definitions/VGAxisConfig",
459+ "description": "Specific axis config for x-axis along the bottom edge of the chart."
530460 },
531- "labels": {
532- "type": "boolean",
533- "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`."
461+ "axisLeft": {
462+ "$ref": "#/definitions/VGAxisConfig",
463+ "description": "Specific axis config for y-axis along the left edge of the chart."
534464 },
535- "maxExtent": {
536- "type": "number",
537- "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a\nmaximum offset value for axis titles.\n\n__Default value:__ `undefined`."
465+ "axisRight": {
466+ "$ref": "#/definitions/VGAxisConfig",
467+ "description": "Specific axis config for y-axis along the right edge of the chart."
538468 },
539- "minExtent": {
540- "type": "number",
541- "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a\nminimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis."
469+ "axisTop": {
470+ "$ref": "#/definitions/VGAxisConfig",
471+ "description": "Specific axis config for x-axis along the top edge of the chart."
542472 },
543- "shortTimeLabels": {
544- "type": "boolean",
545- "description": "Whether month names and weekday names should be abbreviated.\n\n__Default value:__ `false`"
473+ "axisX": {
474+ "$ref": "#/definitions/VGAxisConfig",
475+ "description": "X-axis specific config."
546476 },
547- "tickColor": {
477+ "axisY": {
478+ "$ref": "#/definitions/VGAxisConfig",
479+ "description": "Y-axis specific config."
480+ },
481+ "background": {
548482 "type": "string",
549- "description": "The color of the axis's tick."
483+ "description": "CSS color property to use as the background of visualization.\n\n__Default value:__ none (transparent)"
550484 },
551- "tickRound": {
552- "type": "boolean",
553- "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer."
485+ "bar": {
486+ "$ref": "#/definitions/BarConfig",
487+ "description": "Bar-Specific Config"
554488 },
555- "ticks": {
556- "type": "boolean",
557- "description": "Boolean value that determines whether the axis should include ticks."
489+ "circle": {
490+ "$ref": "#/definitions/MarkConfig",
491+ "description": "Circle-Specific Config"
558492 },
559- "tickSize": {
560- "type": "number",
561- "minimum": 0,
562- "description": "The size in pixels of axis ticks."
493+ "countTitle": {
494+ "type": "string",
495+ "description": "Default axis and legend title for count fields.\n\n__Default value:__ `'Number of Records'`."
563496 },
564- "tickWidth": {
565- "type": "number",
566- "minimum": 0,
567- "description": "The width, in pixels, of ticks."
497+ "fieldTitle": {
498+ "$ref": "#/definitions/FieldTitle",
499+ "description": "Defines how Vega-Lite generates title for fields. There are three possible styles:\n\n- `\"verbal\"` (Default) - displays function in a verbal style (e.g., \"Sum of field\",\n\"Year-month of date\", \"field (binned)\").\n- `\"function\"` - displays function using parentheses and capitalized texts (e.g.,\n\"SUM(field)\", \"YEARMONTH(date)\", \"BIN(field)\").\n- `\"plain\"` - displays only the field name without functions (e.g., \"field\", \"date\",\n\"field\")."
568500 },
569- "titleAlign": {
570- "type": "string",
571- "description": "Horizontal text alignment of axis titles."
501+ "geoshape": {
502+ "$ref": "#/definitions/MarkConfig",
503+ "description": "Geoshape-Specific Config"
572504 },
573- "titleAngle": {
574- "type": "number",
575- "description": "Angle in degrees of axis titles."
505+ "invalidValues": {
506+ "$ref": "#/definitions/InvalidValues",
507+ "description": "Defines how Vega-Lite should handle invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values are filtered.\n- If `null`, all data items are included. In this case, invalid values will be\ninterpreted as zeroes."
576508 },
577- "titleBaseline": {
578- "type": "string",
579- "description": "Vertical text baseline for axis titles."
509+ "legend": {
510+ "$ref": "#/definitions/LegendConfig",
511+ "description": "Legend configuration, which determines default properties for all [legends](legend.html).\nFor a full list of legend configuration options, please see the [corresponding section of\nin the legend documentation](legend.html#config)."
580512 },
581- "titleColor": {
582- "type": "string",
583- "description": "Color of the title, can be in hex color code or regular color name."
513+ "line": {
514+ "$ref": "#/definitions/MarkConfig",
515+ "description": "Line-Specific Config"
584516 },
585- "titleFont": {
517+ "mark": {
518+ "$ref": "#/definitions/MarkConfig",
519+ "description": "Mark Config"
520+ },
521+ "numberFormat": {
586522 "type": "string",
587- "description": "Font of the title. (e.g., `\"Helvetica Neue\"`)."
523+ "description": "D3 Number format for axis labels and text tables. For example \"s\" for SI units. Use [D3's\nnumber format pattern](https://github.com/d3/d3-format#locale_format)."
588524 },
589- "titleFontSize": {
590- "type": "number",
591- "minimum": 0,
592- "description": "Font size of the title."
525+ "padding": {
526+ "$ref": "#/definitions/Padding",
527+ "description": "The default visualization padding, in pixels, from the edge of the visualization canvas\nto the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5,\n\"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`"
593528 },
594- "titleFontWeight": {
595- "$ref": "#/definitions/TitleFontWeight",
596- "description": "Font weight of the title. (e.g., `\"bold\"`)."
529+ "point": {
530+ "$ref": "#/definitions/MarkConfig",
531+ "description": "Point-Specific Config"
597532 },
598- "titleLimit": {
599- "type": "number",
600- "description": "Maximum allowed pixel width of axis titles."
533+ "projection": {
534+ "$ref": "#/definitions/ProjectionConfig",
535+ "description": "Projection configuration, which determines default properties for all\n[projections](projection.html). For a full list of projection configuration options,\nplease see the [corresponding section of the projection\ndocumentation](projection.html#config)."
601536 },
602- "titleMaxLength": {
603- "type": "number",
604- "description": "Max length for axis title if the title is automatically generated from the field's\ndescription."
537+ "range": {
538+ "$ref": "#/definitions/RangeConfig",
539+ "description": "An object hash that defines default range arrays or schemes for using with scales.\nFor a full list of scale range configuration options, please see the [corresponding\nsection of the scale documentation](scale.html#config)."
605540 },
606- "titlePadding": {
607- "type": "number",
608- "description": "The padding, in pixels, between title and axis."
541+ "rect": {
542+ "$ref": "#/definitions/MarkConfig",
543+ "description": "Rect-Specific Config"
609544 },
610- "titleX": {
611- "type": "number",
612- "description": "X-coordinate of the axis title relative to the axis group."
545+ "rule": {
546+ "$ref": "#/definitions/MarkConfig",
547+ "description": "Rule-Specific Config"
613548 },
614- "titleY": {
615- "type": "number",
616- "description": "Y-coordinate of the axis title relative to the axis group."
617- }
618- },
619- "required": [],
620- "title": "AxisConfig",
621- "description": "Axis configuration, which determines default properties for all `x` and `y` [axes](axis.html). For a full list of axis configuration options, please see the [corresponding section of the axis documentation](axis.html#config)."
622- },
623- "VGAxisConfig": {
624- "type": "object",
625- "additionalProperties": false,
626- "properties": {
627- "bandPosition": {
628- "type": "number",
629- "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be\npositioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5`\nplaces ticks in the middle of their bands."
549+ "scale": {
550+ "$ref": "#/definitions/ScaleConfig",
551+ "description": "Scale configuration determines default properties for all [scales](scale.html). For a\nfull list of scale configuration options, please see the [corresponding section of the\nscale documentation](scale.html#config)."
630552 },
631- "domain": {
632- "type": "boolean",
633- "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of\nthe axis.\n\n__Default value:__ `true`"
553+ "selection": {
554+ "$ref": "#/definitions/SelectionConfig",
555+ "description": "An object hash for defining default properties for each type of selections."
634556 },
635- "domainColor": {
636- "type": "string",
637- "description": "Color of axis domain line.\n\n__Default value:__ (none, using Vega default)."
557+ "square": {
558+ "$ref": "#/definitions/MarkConfig",
559+ "description": "Square-Specific Config"
638560 },
639- "domainWidth": {
640- "type": "number",
641- "description": "Stroke width of axis domain line\n\n__Default value:__ (none, using Vega default)."
561+ "stack": {
562+ "$ref": "#/definitions/StackOffset",
563+ "description": "Default stack offset for stackable mark."
642564 },
643- "grid": {
644- "type": "boolean",
645- "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](scale.html#continuous) that are not\nbinned; otherwise, `false`."
565+ "style": {
566+ "type": "object",
567+ "additionalProperties": {
568+ "$ref": "#/definitions/VGMarkConfig"
569+ },
570+ "description": "An object hash that defines key-value mappings to determine default properties for marks with a given [style](mark.html#mark-def). The keys represent styles names; the value are valid [mark configuration objects](mark.html#config). "
646571 },
647- "gridColor": {
648- "type": "string",
649- "description": "Color of gridlines."
650- },
651- "gridDash": {
652- "type": "array",
653- "items": {
654- "type": "number"
655- },
656- "description": "The offset (in pixels) into which to begin drawing with the grid dash array."
657- },
658- "gridOpacity": {
659- "type": "number",
660- "minimum": 0,
661- "maximum": 1,
662- "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ (`1` by default)"
663- },
664- "gridWidth": {
665- "type": "number",
666- "minimum": 0,
667- "description": "The grid width, in pixels."
668- },
669- "labelAngle": {
670- "type": "number",
671- "minimum": -360,
672- "maximum": 360,
673- "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise."
674- },
675- "labelBound": {
676- "$ref": "#/definitions/Label",
677- "description": "Indicates if labels should be hidden if they exceed the axis range. If `false `(the\ndefault) no bounds overlap analysis is performed. If `true`, labels will be hidden if\nthey exceed the axis range by more than 1 pixel. If this property is a number, it\nspecifies the pixel tolerance: the maximum amount by which a label bounding box may\nexceed the axis range.\n\n__Default value:__ `false`."
678- },
679- "labelColor": {
680- "type": "string",
681- "description": "The color of the tick label, can be in hex color code or regular color name."
682- },
683- "labelFlush": {
684- "$ref": "#/definitions/Label",
685- "description": "Indicates if the first and last axis labels should be aligned flush with the scale range.\nFlush alignment for a horizontal axis will left-align the first label and right-align the\nlast label. For vertical axes, bottom and top text baselines are applied instead. If this\nproperty is a number, it also indicates the number of pixels by which to offset the first\nand last labels; for example, a value of 2 will flush-align the first and last labels and\nalso push them 2 pixels outward from the center of the axis. The additional adjustment\ncan sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`."
686- },
687- "labelFont": {
688- "type": "string",
689- "description": "The font of the tick label."
690- },
691- "labelFontSize": {
692- "type": "number",
693- "minimum": 0,
694- "description": "The font size of the label, in pixels."
695- },
696- "labelLimit": {
697- "type": "number",
698- "description": "Maximum allowed pixel width of axis tick labels."
699- },
700- "labelOverlap": {
701- "$ref": "#/definitions/LabelOverlapUnion",
702- "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no\noverlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing\nevery other label is used (this works well for standard linear axes). If set to\n`\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps\nwith the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log\nscales; otherwise `false`."
703- },
704- "labelPadding": {
705- "type": "number",
706- "description": "The padding, in pixels, between axis and text labels."
707- },
708- "labels": {
709- "type": "boolean",
710- "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`."
711- },
712- "maxExtent": {
713- "type": "number",
714- "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a\nmaximum offset value for axis titles.\n\n__Default value:__ `undefined`."
715- },
716- "minExtent": {
717- "type": "number",
718- "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a\nminimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis."
719- },
720- "tickColor": {
721- "type": "string",
722- "description": "The color of the axis's tick."
723- },
724- "tickRound": {
725- "type": "boolean",
726- "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer."
727- },
728- "ticks": {
729- "type": "boolean",
730- "description": "Boolean value that determines whether the axis should include ticks."
731- },
732- "tickSize": {
733- "type": "number",
734- "minimum": 0,
735- "description": "The size in pixels of axis ticks."
736- },
737- "tickWidth": {
738- "type": "number",
739- "minimum": 0,
740- "description": "The width, in pixels, of ticks."
741- },
742- "titleAlign": {
743- "type": "string",
744- "description": "Horizontal text alignment of axis titles."
745- },
746- "titleAngle": {
747- "type": "number",
748- "description": "Angle in degrees of axis titles."
749- },
750- "titleBaseline": {
751- "type": "string",
752- "description": "Vertical text baseline for axis titles."
572+ "text": {
573+ "$ref": "#/definitions/TextConfig",
574+ "description": "Text-Specific Config"
753575 },
754- "titleColor": {
755- "type": "string",
756- "description": "Color of the title, can be in hex color code or regular color name."
576+ "tick": {
577+ "$ref": "#/definitions/TickConfig",
578+ "description": "Tick-Specific Config"
757579 },
758- "titleFont": {
580+ "timeFormat": {
759581 "type": "string",
760- "description": "Font of the title. (e.g., `\"Helvetica Neue\"`)."
761- },
762- "titleFontSize": {
763- "type": "number",
764- "minimum": 0,
765- "description": "Font size of the title."
766- },
767- "titleFontWeight": {
768- "$ref": "#/definitions/TitleFontWeight",
769- "description": "Font weight of the title. (e.g., `\"bold\"`)."
770- },
771- "titleLimit": {
772- "type": "number",
773- "description": "Maximum allowed pixel width of axis titles."
774- },
775- "titleMaxLength": {
776- "type": "number",
777- "description": "Max length for axis title if the title is automatically generated from the field's\ndescription."
778- },
779- "titlePadding": {
780- "type": "number",
781- "description": "The padding, in pixels, between title and axis."
582+ "description": "Default datetime format for axis and legend labels. The format can be set directly on\neach axis and legend. Use [D3's time format\npattern](https://github.com/d3/d3-time-format#locale_format).\n\n__Default value:__ `'%b %d, %Y'`."
782583 },
783- "titleX": {
784- "type": "number",
785- "description": "X-coordinate of the axis title relative to the axis group."
584+ "title": {
585+ "$ref": "#/definitions/VGTitleConfig",
586+ "description": "Title configuration, which determines default properties for all [titles](title.html).\nFor a full list of title configuration options, please see the [corresponding section of\nthe title documentation](title.html#config)."
786587 },
787- "titleY": {
788- "type": "number",
789- "description": "Y-coordinate of the axis title relative to the axis group."
588+ "view": {
589+ "$ref": "#/definitions/ViewConfig",
590+ "description": "Default properties for [single view plots](spec.html#single)."
790591 }
791592 },
792593 "required": [],
793- "title": "VGAxisConfig",
794- "description": "Specific axis config for axes with \"band\" scales.\nSpecific axis config for x-axis along the bottom edge of the chart.\nSpecific axis config for y-axis along the left edge of the chart.\nSpecific axis config for y-axis along the right edge of the chart.\nSpecific axis config for x-axis along the top edge of the chart.\nX-axis specific config.\nY-axis specific config."
594+ "title": "Config",
595+ "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification."
795596 },
796- "BarConfig": {
597+ "MarkConfig": {
797598 "type": "object",
798599 "additionalProperties": false,
799600 "properties": {
@@ -811,29 +612,14 @@
811612 "$ref": "#/definitions/VerticalAlign",
812613 "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
813614 },
814- "binSpacing": {
815- "type": "number",
816- "minimum": 0,
817- "description": "Offset between bar for binned field. Ideal value for this is either 0 (Preferred by\nstatisticians) or 1 (Vega-Lite Default, D3 example style).\n\n__Default value:__ `1`"
818- },
819615 "color": {
820616 "type": "string",
821617 "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
822618 },
823- "continuousBandSize": {
824- "type": "number",
825- "minimum": 0,
826- "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`"
827- },
828619 "cursor": {
829620 "$ref": "#/definitions/Cursor",
830621 "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
831622 },
832- "discreteBandSize": {
833- "type": "number",
834- "minimum": 0,
835- "description": "The size of the bars. If unspecified, the default size is `bandSize-1`,\nwhich provides 1 pixel offset between bars."
836- },
837623 "dx": {
838624 "type": "number",
839625 "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
@@ -951,963 +737,1280 @@
951737 }
952738 },
953739 "required": [],
954- "title": "BarConfig",
955- "description": "Bar-Specific Config "
740+ "title": "MarkConfig",
741+ "description": "Area-Specific Config \nCircle-Specific Config \nGeoshape-Specific Config \nLine-Specific Config \nMark Config \nPoint-Specific Config \nRect-Specific Config \nRule-Specific Config \nSquare-Specific Config "
956742 },
957- "LegendConfig": {
743+ "AxisConfig": {
958744 "type": "object",
959745 "additionalProperties": false,
960746 "properties": {
961- "cornerRadius": {
962- "type": "number",
963- "description": "Corner radius for the full legend."
964- },
965- "entryPadding": {
747+ "bandPosition": {
966748 "type": "number",
967- "description": "Padding (in pixels) between legend entries in a symbol legend."
968- },
969- "fillColor": {
970- "type": "string",
971- "description": "Background fill color for the full legend."
749+ "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be\npositioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5`\nplaces ticks in the middle of their bands."
972750 },
973- "gradientHeight": {
974- "type": "number",
975- "minimum": 0,
976- "description": "The height of the gradient, in pixels."
751+ "domain": {
752+ "type": "boolean",
753+ "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of\nthe axis.\n\n__Default value:__ `true`"
977754 },
978- "gradientLabelBaseline": {
755+ "domainColor": {
979756 "type": "string",
980- "description": "Text baseline for color ramp gradient labels."
757+ "description": "Color of axis domain line.\n\n__Default value:__ (none, using Vega default)."
981758 },
982- "gradientLabelLimit": {
759+ "domainWidth": {
983760 "type": "number",
984- "description": "The maximum allowed length in pixels of color ramp gradient labels."
761+ "description": "Stroke width of axis domain line\n\n__Default value:__ (none, using Vega default)."
985762 },
986- "gradientLabelOffset": {
987- "type": "number",
988- "description": "Vertical offset in pixels for color ramp gradient labels."
763+ "grid": {
764+ "type": "boolean",
765+ "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](scale.html#continuous) that are not\nbinned; otherwise, `false`."
989766 },
990- "gradientStrokeColor": {
767+ "gridColor": {
991768 "type": "string",
992- "description": "The color of the gradient stroke, can be in hex color code or regular color name."
769+ "description": "Color of gridlines."
993770 },
994- "gradientStrokeWidth": {
771+ "gridDash": {
772+ "type": "array",
773+ "items": {
774+ "type": "number"
775+ },
776+ "description": "The offset (in pixels) into which to begin drawing with the grid dash array."
777+ },
778+ "gridOpacity": {
995779 "type": "number",
996780 "minimum": 0,
997- "description": "The width of the gradient stroke, in pixels."
781+ "maximum": 1,
782+ "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ (`1` by default)"
998783 },
999- "gradientWidth": {
784+ "gridWidth": {
1000785 "type": "number",
1001786 "minimum": 0,
1002- "description": "The width of the gradient, in pixels."
787+ "description": "The grid width, in pixels."
1003788 },
1004- "labelAlign": {
1005- "type": "string",
1006- "description": "The alignment of the legend label, can be left, middle or right."
789+ "labelAngle": {
790+ "type": "number",
791+ "minimum": -360,
792+ "maximum": 360,
793+ "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise."
1007794 },
1008- "labelBaseline": {
1009- "type": "string",
1010- "description": "The position of the baseline of legend label, can be top, middle or bottom."
795+ "labelBound": {
796+ "$ref": "#/definitions/Label",
797+ "description": "Indicates if labels should be hidden if they exceed the axis range. If `false `(the\ndefault) no bounds overlap analysis is performed. If `true`, labels will be hidden if\nthey exceed the axis range by more than 1 pixel. If this property is a number, it\nspecifies the pixel tolerance: the maximum amount by which a label bounding box may\nexceed the axis range.\n\n__Default value:__ `false`."
1011798 },
1012799 "labelColor": {
1013800 "type": "string",
1014- "description": "The color of the legend label, can be in hex color code or regular color name."
801+ "description": "The color of the tick label, can be in hex color code or regular color name."
802+ },
803+ "labelFlush": {
804+ "$ref": "#/definitions/Label",
805+ "description": "Indicates if the first and last axis labels should be aligned flush with the scale range.\nFlush alignment for a horizontal axis will left-align the first label and right-align the\nlast label. For vertical axes, bottom and top text baselines are applied instead. If this\nproperty is a number, it also indicates the number of pixels by which to offset the first\nand last labels; for example, a value of 2 will flush-align the first and last labels and\nalso push them 2 pixels outward from the center of the axis. The additional adjustment\ncan sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`."
1015806 },
1016807 "labelFont": {
1017808 "type": "string",
1018- "description": "The font of the legend label."
809+ "description": "The font of the tick label."
1019810 },
1020811 "labelFontSize": {
1021812 "type": "number",
1022813 "minimum": 0,
1023- "description": "The font size of legend label.\n\n__Default value:__ `10`."
814+ "description": "The font size of the label, in pixels."
1024815 },
1025816 "labelLimit": {
1026817 "type": "number",
1027818 "description": "Maximum allowed pixel width of axis tick labels."
1028819 },
1029- "labelOffset": {
1030- "type": "number",
1031- "minimum": 0,
1032- "description": "The offset of the legend label."
820+ "labelOverlap": {
821+ "$ref": "#/definitions/LabelOverlapUnion",
822+ "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no\noverlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing\nevery other label is used (this works well for standard linear axes). If set to\n`\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps\nwith the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log\nscales; otherwise `false`."
1033823 },
1034- "offset": {
824+ "labelPadding": {
1035825 "type": "number",
1036- "description": "The offset, in pixels, by which to displace the legend from the edge of the enclosing\ngroup or data rectangle.\n\n__Default value:__ `0`"
826+ "description": "The padding, in pixels, between axis and text labels."
1037827 },
1038- "orient": {
1039- "$ref": "#/definitions/LegendOrient",
1040- "description": "The orientation of the legend, which determines how the legend is positioned within the\nscene. One of \"left\", \"right\", \"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\",\n\"none\".\n\n__Default value:__ `\"right\"`"
828+ "labels": {
829+ "type": "boolean",
830+ "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`."
1041831 },
1042- "padding": {
832+ "maxExtent": {
1043833 "type": "number",
1044- "description": "The padding, in pixels, between the legend and axis."
834+ "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a\nmaximum offset value for axis titles.\n\n__Default value:__ `undefined`."
835+ },
836+ "minExtent": {
837+ "type": "number",
838+ "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a\nminimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis."
1045839 },
1046840 "shortTimeLabels": {
1047841 "type": "boolean",
1048842 "description": "Whether month names and weekday names should be abbreviated.\n\n__Default value:__ `false`"
1049843 },
1050- "strokeColor": {
844+ "tickColor": {
1051845 "type": "string",
1052- "description": "Border stroke color for the full legend."
1053- },
1054- "strokeDash": {
1055- "type": "array",
1056- "items": {
1057- "type": "number"
1058- },
1059- "description": "Border stroke dash pattern for the full legend."
846+ "description": "The color of the axis's tick."
1060847 },
1061- "strokeWidth": {
1062- "type": "number",
1063- "description": "Border stroke width for the full legend."
848+ "tickRound": {
849+ "type": "boolean",
850+ "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer."
1064851 },
1065- "symbolColor": {
1066- "type": "string",
1067- "description": "The color of the legend symbol,"
852+ "ticks": {
853+ "type": "boolean",
854+ "description": "Boolean value that determines whether the axis should include ticks."
1068855 },
1069- "symbolSize": {
856+ "tickSize": {
1070857 "type": "number",
1071858 "minimum": 0,
1072- "description": "The size of the legend symbol, in pixels."
859+ "description": "The size in pixels of axis ticks."
1073860 },
1074- "symbolStrokeWidth": {
861+ "tickWidth": {
1075862 "type": "number",
1076863 "minimum": 0,
1077- "description": "The width of the symbol's stroke."
1078- },
1079- "symbolType": {
1080- "type": "string",
1081- "description": "Default shape type (such as \"circle\") for legend symbols."
864+ "description": "The width, in pixels, of ticks."
1082865 },
1083866 "titleAlign": {
1084867 "type": "string",
1085- "description": "Horizontal text alignment for legend titles."
868+ "description": "Horizontal text alignment of axis titles."
869+ },
870+ "titleAngle": {
871+ "type": "number",
872+ "description": "Angle in degrees of axis titles."
1086873 },
1087874 "titleBaseline": {
1088875 "type": "string",
1089- "description": "Vertical text baseline for legend titles."
876+ "description": "Vertical text baseline for axis titles."
1090877 },
1091878 "titleColor": {
1092879 "type": "string",
1093- "description": "The color of the legend title, can be in hex color code or regular color name."
880+ "description": "Color of the title, can be in hex color code or regular color name."
1094881 },
1095882 "titleFont": {
1096883 "type": "string",
1097- "description": "The font of the legend title."
884+ "description": "Font of the title. (e.g., `\"Helvetica Neue\"`)."
1098885 },
1099886 "titleFontSize": {
1100887 "type": "number",
1101- "description": "The font size of the legend title."
888+ "minimum": 0,
889+ "description": "Font size of the title."
1102890 },
1103891 "titleFontWeight": {
1104892 "$ref": "#/definitions/TitleFontWeight",
1105- "description": "The font weight of the legend title."
893+ "description": "Font weight of the title. (e.g., `\"bold\"`)."
1106894 },
1107895 "titleLimit": {
1108896 "type": "number",
1109897 "description": "Maximum allowed pixel width of axis titles."
1110898 },
899+ "titleMaxLength": {
900+ "type": "number",
901+ "description": "Max length for axis title if the title is automatically generated from the field's\ndescription."
902+ },
1111903 "titlePadding": {
1112904 "type": "number",
1113- "description": "The padding, in pixels, between title and legend."
905+ "description": "The padding, in pixels, between title and axis."
906+ },
907+ "titleX": {
908+ "type": "number",
909+ "description": "X-coordinate of the axis title relative to the axis group."
910+ },
911+ "titleY": {
912+ "type": "number",
913+ "description": "Y-coordinate of the axis title relative to the axis group."
1114914 }
1115915 },
1116916 "required": [],
1117- "title": "LegendConfig",
1118- "description": "Legend configuration, which determines default properties for all [legends](legend.html). For a full list of legend configuration options, please see the [corresponding section of in the legend documentation](legend.html#config)."
917+ "title": "AxisConfig",
918+ "description": "Axis configuration, which determines default properties for all `x` and `y` [axes](axis.html). For a full list of axis configuration options, please see the [corresponding section of the axis documentation](axis.html#config)."
1119919 },
1120- "PaddingClass": {
920+ "VGAxisConfig": {
1121921 "type": "object",
1122922 "additionalProperties": false,
1123923 "properties": {
1124- "bottom": {
1125- "type": "number"
924+ "bandPosition": {
925+ "type": "number",
926+ "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be\npositioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5`\nplaces ticks in the middle of their bands."
1126927 },
1127- "left": {
1128- "type": "number"
928+ "domain": {
929+ "type": "boolean",
930+ "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of\nthe axis.\n\n__Default value:__ `true`"
1129931 },
1130- "right": {
1131- "type": "number"
932+ "domainColor": {
933+ "type": "string",
934+ "description": "Color of axis domain line.\n\n__Default value:__ (none, using Vega default)."
1132935 },
1133- "top": {
1134- "type": "number"
1135- }
1136- },
1137- "required": [],
1138- "title": "PaddingClass"
1139- },
1140- "ProjectionConfig": {
1141- "type": "object",
1142- "additionalProperties": false,
1143- "properties": {
1144- "center": {
936+ "domainWidth": {
937+ "type": "number",
938+ "description": "Stroke width of axis domain line\n\n__Default value:__ (none, using Vega default)."
939+ },
940+ "grid": {
941+ "type": "boolean",
942+ "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](scale.html#continuous) that are not\nbinned; otherwise, `false`."
943+ },
944+ "gridColor": {
945+ "type": "string",
946+ "description": "Color of gridlines."
947+ },
948+ "gridDash": {
1145949 "type": "array",
1146950 "items": {
1147951 "type": "number"
1148952 },
1149- "description": "Sets the projection’s center to the specified center, a two-element array of longitude\nand latitude in degrees.\n\n__Default value:__ `[0, 0]`"
953+ "description": "The offset (in pixels) into which to begin drawing with the grid dash array."
1150954 },
1151- "clipAngle": {
955+ "gridOpacity": {
1152956 "type": "number",
1153- "description": "Sets the projection’s clipping circle radius to the specified angle in degrees. If\n`null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather\nthan small-circle clipping."
957+ "minimum": 0,
958+ "maximum": 1,
959+ "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ (`1` by default)"
1154960 },
1155- "clipExtent": {
1156- "type": "array",
1157- "items": {
1158- "type": "array",
1159- "items": {
1160- "type": "number"
1161- }
1162- },
1163- "description": "Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent\nbounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of\nthe viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no\nviewport clipping is performed."
961+ "gridWidth": {
962+ "type": "number",
963+ "minimum": 0,
964+ "description": "The grid width, in pixels."
1164965 },
1165- "coefficient": {
1166- "type": "number"
966+ "labelAngle": {
967+ "type": "number",
968+ "minimum": -360,
969+ "maximum": 360,
970+ "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise."
1167971 },
1168- "distance": {
1169- "type": "number"
972+ "labelBound": {
973+ "$ref": "#/definitions/Label",
974+ "description": "Indicates if labels should be hidden if they exceed the axis range. If `false `(the\ndefault) no bounds overlap analysis is performed. If `true`, labels will be hidden if\nthey exceed the axis range by more than 1 pixel. If this property is a number, it\nspecifies the pixel tolerance: the maximum amount by which a label bounding box may\nexceed the axis range.\n\n__Default value:__ `false`."
1170975 },
1171- "fraction": {
1172- "type": "number"
976+ "labelColor": {
977+ "type": "string",
978+ "description": "The color of the tick label, can be in hex color code or regular color name."
1173979 },
1174- "lobes": {
1175- "type": "number"
980+ "labelFlush": {
981+ "$ref": "#/definitions/Label",
982+ "description": "Indicates if the first and last axis labels should be aligned flush with the scale range.\nFlush alignment for a horizontal axis will left-align the first label and right-align the\nlast label. For vertical axes, bottom and top text baselines are applied instead. If this\nproperty is a number, it also indicates the number of pixels by which to offset the first\nand last labels; for example, a value of 2 will flush-align the first and last labels and\nalso push them 2 pixels outward from the center of the axis. The additional adjustment\ncan sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`."
1176983 },
1177- "parallel": {
1178- "type": "number"
984+ "labelFont": {
985+ "type": "string",
986+ "description": "The font of the tick label."
1179987 },
1180- "precision": {
1181- "$ref": "#/definitions/PurplePrecision",
1182- "description": "Sets the threshold for the projection’s [adaptive\nresampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This\nvalue corresponds to the [Douglas–Peucker\ndistance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).\nIf precision is not specified, returns the projection’s current resampling precision\nwhich defaults to `√0.5 ≅ 0.70710…`."
988+ "labelFontSize": {
989+ "type": "number",
990+ "minimum": 0,
991+ "description": "The font size of the label, in pixels."
1183992 },
1184- "radius": {
1185- "type": "number"
993+ "labelLimit": {
994+ "type": "number",
995+ "description": "Maximum allowed pixel width of axis tick labels."
1186996 },
1187- "ratio": {
1188- "type": "number"
997+ "labelOverlap": {
998+ "$ref": "#/definitions/LabelOverlapUnion",
999+ "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no\noverlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing\nevery other label is used (this works well for standard linear axes). If set to\n`\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps\nwith the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log\nscales; otherwise `false`."
11891000 },
1190- "rotate": {
1191- "type": "array",
1192- "items": {
1193- "type": "number"
1194- },
1195- "description": "Sets the projection’s three-axis rotation to the specified angles, which must be a two-\nor three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation\nangles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)\n\n__Default value:__ `[0, 0, 0]`"
1001+ "labelPadding": {
1002+ "type": "number",
1003+ "description": "The padding, in pixels, between axis and text labels."
11961004 },
1197- "spacing": {
1198- "type": "number"
1005+ "labels": {
1006+ "type": "boolean",
1007+ "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`."
11991008 },
1200- "tilt": {
1201- "type": "number"
1009+ "maxExtent": {
1010+ "type": "number",
1011+ "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a\nmaximum offset value for axis titles.\n\n__Default value:__ `undefined`."
12021012 },
1203- "type": {
1204- "$ref": "#/definitions/VGProjectionType",
1205- "description": "The cartographic projection to use. This value is case-insensitive, for example\n`\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid\nprojection types [in the\ndocumentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`"
1206- }
1207- },
1208- "required": [],
1209- "title": "ProjectionConfig",
1210- "description": "Projection configuration, which determines default properties for all [projections](projection.html). For a full list of projection configuration options, please see the [corresponding section of the projection documentation](projection.html#config).\nAny property of Projection can be in config"
1211- },
1212- "PurplePrecision": {
1213- "type": "object",
1214- "additionalProperties": {
1215- "type": "string"
1216- },
1217- "properties": {
1218- "length": {
1013+ "minExtent": {
12191014 "type": "number",
1220- "description": "Returns the length of a String object."
1221- }
1222- },
1223- "required": [
1224- "length"
1225- ],
1226- "title": "PurplePrecision",
1227- "description": "Sets the threshold for the projection’s [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [Douglas–Peucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection’s current resampling precision which defaults to `√0.5 ≅ 0.70710…`."
1228- },
1229- "RangeConfig": {
1230- "type": "object",
1231- "additionalProperties": {
1232- "$ref": "#/definitions/RangeConfigValue"
1233- },
1234- "properties": {
1235- "category": {
1236- "$ref": "#/definitions/Category",
1237- "description": "Default range for _nominal_ (categorical) fields."
1015+ "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a\nminimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis."
12381016 },
1239- "diverging": {
1240- "$ref": "#/definitions/Category",
1241- "description": "Default range for diverging _quantitative_ fields."
1017+ "tickColor": {
1018+ "type": "string",
1019+ "description": "The color of the axis's tick."
12421020 },
1243- "heatmap": {
1244- "$ref": "#/definitions/Category",
1245- "description": "Default range for _quantitative_ heatmaps."
1021+ "tickRound": {
1022+ "type": "boolean",
1023+ "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer."
12461024 },
1247- "ordinal": {
1248- "$ref": "#/definitions/Category",
1249- "description": "Default range for _ordinal_ fields."
1025+ "ticks": {
1026+ "type": "boolean",
1027+ "description": "Boolean value that determines whether the axis should include ticks."
12501028 },
1251- "ramp": {
1252- "$ref": "#/definitions/Category",
1253- "description": "Default range for _quantitative_ and _temporal_ fields."
1029+ "tickSize": {
1030+ "type": "number",
1031+ "minimum": 0,
1032+ "description": "The size in pixels of axis ticks."
12541033 },
1255- "symbol": {
1256- "type": "array",
1257- "items": {
1258- "type": "string"
1259- },
1260- "description": "Default range palette for the `shape` channel."
1261- }
1262- },
1263- "required": [],
1264- "title": "RangeConfig",
1265- "description": "An object hash that defines default range arrays or schemes for using with scales.\nFor a full list of scale range configuration options, please see the [corresponding section of the scale documentation](scale.html#config)."
1266- },
1267- "CategoryVGScheme": {
1268- "type": "object",
1269- "additionalProperties": false,
1270- "properties": {
1271- "count": {
1272- "type": "number"
1034+ "tickWidth": {
1035+ "type": "number",
1036+ "minimum": 0,
1037+ "description": "The width, in pixels, of ticks."
12731038 },
1274- "extent": {
1275- "type": "array",
1276- "items": {
1277- "type": "number"
1278- }
1039+ "titleAlign": {
1040+ "type": "string",
1041+ "description": "Horizontal text alignment of axis titles."
12791042 },
1280- "scheme": {
1281- "type": "string"
1282- }
1283- },
1284- "required": [
1285- "scheme"
1286- ],
1287- "title": "CategoryVGScheme"
1288- },
1289- "RangeConfigValueVGScheme": {
1290- "type": "object",
1291- "additionalProperties": false,
1292- "properties": {
1293- "count": {
1294- "type": "number"
1043+ "titleAngle": {
1044+ "type": "number",
1045+ "description": "Angle in degrees of axis titles."
12951046 },
1296- "extent": {
1297- "type": "array",
1298- "items": {
1299- "type": "number"
1300- }
1047+ "titleBaseline": {
1048+ "type": "string",
1049+ "description": "Vertical text baseline for axis titles."
13011050 },
1302- "scheme": {
1303- "type": "string"
1051+ "titleColor": {
1052+ "type": "string",
1053+ "description": "Color of the title, can be in hex color code or regular color name."
13041054 },
1305- "step": {
1306- "type": "number"
1055+ "titleFont": {
1056+ "type": "string",
1057+ "description": "Font of the title. (e.g., `\"Helvetica Neue\"`)."
1058+ },
1059+ "titleFontSize": {
1060+ "type": "number",
1061+ "minimum": 0,
1062+ "description": "Font size of the title."
1063+ },
1064+ "titleFontWeight": {
1065+ "$ref": "#/definitions/TitleFontWeight",
1066+ "description": "Font weight of the title. (e.g., `\"bold\"`)."
1067+ },
1068+ "titleLimit": {
1069+ "type": "number",
1070+ "description": "Maximum allowed pixel width of axis titles."
1071+ },
1072+ "titleMaxLength": {
1073+ "type": "number",
1074+ "description": "Max length for axis title if the title is automatically generated from the field's\ndescription."
1075+ },
1076+ "titlePadding": {
1077+ "type": "number",
1078+ "description": "The padding, in pixels, between title and axis."
1079+ },
1080+ "titleX": {
1081+ "type": "number",
1082+ "description": "X-coordinate of the axis title relative to the axis group."
1083+ },
1084+ "titleY": {
1085+ "type": "number",
1086+ "description": "Y-coordinate of the axis title relative to the axis group."
13071087 }
13081088 },
13091089 "required": [],
1310- "title": "RangeConfigValueVGScheme"
1090+ "title": "VGAxisConfig",
1091+ "description": "Specific axis config for axes with \"band\" scales.\nSpecific axis config for x-axis along the bottom edge of the chart.\nSpecific axis config for y-axis along the left edge of the chart.\nSpecific axis config for y-axis along the right edge of the chart.\nSpecific axis config for x-axis along the top edge of the chart.\nX-axis specific config.\nY-axis specific config."
13111092 },
1312- "ScaleConfig": {
1093+ "BarConfig": {
13131094 "type": "object",
13141095 "additionalProperties": false,
13151096 "properties": {
1316- "bandPaddingInner": {
1097+ "align": {
1098+ "$ref": "#/definitions/HorizontalAlign",
1099+ "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
1100+ },
1101+ "angle": {
13171102 "type": "number",
13181103 "minimum": 0,
1319- "maximum": 1,
1320- "description": "Default inner padding for `x` and `y` band-ordinal scales.\n\n__Default value:__ `0.1`"
1104+ "maximum": 360,
1105+ "description": "The rotation angle of the text, in degrees."
13211106 },
1322- "bandPaddingOuter": {
1107+ "baseline": {
1108+ "$ref": "#/definitions/VerticalAlign",
1109+ "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
1110+ },
1111+ "binSpacing": {
13231112 "type": "number",
13241113 "minimum": 0,
1325- "maximum": 1,
1326- "description": "Default outer padding for `x` and `y` band-ordinal scales.\nIf not specified, by default, band scale's paddingOuter is paddingInner/2."
1114+ "description": "Offset between bar for binned field. Ideal value for this is either 0 (Preferred by\nstatisticians) or 1 (Vega-Lite Default, D3 example style).\n\n__Default value:__ `1`"
13271115 },
1328- "clamp": {
1329- "type": "boolean",
1330- "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum\nrange value"
1116+ "color": {
1117+ "type": "string",
1118+ "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
13311119 },
1332- "continuousPadding": {
1120+ "continuousBandSize": {
13331121 "type": "number",
13341122 "minimum": 0,
1335- "description": "Default padding for continuous scales.\n\n__Default:__ `5` for continuous x-scale of a vertical bar and continuous y-scale of a\nhorizontal bar.; `0` otherwise."
1123+ "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`"
13361124 },
1337- "maxBandSize": {
1125+ "cursor": {
1126+ "$ref": "#/definitions/Cursor",
1127+ "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
1128+ },
1129+ "discreteBandSize": {
13381130 "type": "number",
13391131 "minimum": 0,
1340- "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the scale's `rangeStep` - 1."
1132+ "description": "The size of the bars. If unspecified, the default size is `bandSize-1`,\nwhich provides 1 pixel offset between bars."
13411133 },
1342- "maxFontSize": {
1134+ "dx": {
13431135 "type": "number",
1344- "minimum": 0,
1345- "description": "The default max value for mapping quantitative fields to text's size/fontSize.\n\n__Default value:__ `40`"
1136+ "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
13461137 },
1347- "maxOpacity": {
1138+ "dy": {
1139+ "type": "number",
1140+ "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
1141+ },
1142+ "fill": {
1143+ "type": "string",
1144+ "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
1145+ },
1146+ "filled": {
1147+ "type": "boolean",
1148+ "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
1149+ },
1150+ "fillOpacity": {
13481151 "type": "number",
13491152 "minimum": 0,
13501153 "maximum": 1,
1351- "description": "Default max opacity for mapping a field to opacity.\n\n__Default value:__ `0.8`"
1154+ "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
13521155 },
1353- "maxSize": {
1156+ "font": {
1157+ "type": "string",
1158+ "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
1159+ },
1160+ "fontSize": {
13541161 "type": "number",
13551162 "minimum": 0,
1356- "description": "Default max value for point size scale."
1163+ "description": "The font size, in pixels."
13571164 },
1358- "maxStrokeWidth": {
1165+ "fontStyle": {
1166+ "$ref": "#/definitions/FontStyle",
1167+ "description": "The font style (e.g., `\"italic\"`)."
1168+ },
1169+ "fontWeight": {
1170+ "$ref": "#/definitions/FontWeightUnion",
1171+ "description": "The font weight (e.g., `\"bold\"`)."
1172+ },
1173+ "href": {
1174+ "type": "string",
1175+ "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
1176+ },
1177+ "interpolate": {
1178+ "$ref": "#/definitions/Interpolate",
1179+ "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
1180+ },
1181+ "limit": {
13591182 "type": "number",
1360- "minimum": 0,
1361- "description": "Default max strokeWidth for strokeWidth (or rule/line's size) scale.\n\n__Default value:__ `4`"
1183+ "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
13621184 },
1363- "minBandSize": {
1185+ "opacity": {
13641186 "type": "number",
13651187 "minimum": 0,
1366- "description": "The default min value for mapping quantitative fields to bar and tick's size/bandSize\nscale with zero=false.\n\n__Default value:__ `2`"
1188+ "maximum": 1,
1189+ "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
13671190 },
1368- "minFontSize": {
1191+ "orient": {
1192+ "$ref": "#/definitions/Orient",
1193+ "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
1194+ },
1195+ "radius": {
13691196 "type": "number",
13701197 "minimum": 0,
1371- "description": "The default min value for mapping quantitative fields to tick's size/fontSize scale with\nzero=false\n\n__Default value:__ `8`"
1198+ "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
13721199 },
1373- "minOpacity": {
1200+ "shape": {
1201+ "type": "string",
1202+ "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
1203+ },
1204+ "size": {
13741205 "type": "number",
13751206 "minimum": 0,
1376- "maximum": 1,
1377- "description": "Default minimum opacity for mapping a field to opacity.\n\n__Default value:__ `0.3`"
1207+ "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
13781208 },
1379- "minSize": {
1209+ "stroke": {
1210+ "type": "string",
1211+ "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
1212+ },
1213+ "strokeDash": {
1214+ "type": "array",
1215+ "items": {
1216+ "type": "number"
1217+ },
1218+ "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
1219+ },
1220+ "strokeDashOffset": {
1221+ "type": "number",
1222+ "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
1223+ },
1224+ "strokeOpacity": {
13801225 "type": "number",
13811226 "minimum": 0,
1382- "description": "Default minimum value for point size scale with zero=false.\n\n__Default value:__ `9`"
1227+ "maximum": 1,
1228+ "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
13831229 },
1384- "minStrokeWidth": {
1230+ "strokeWidth": {
13851231 "type": "number",
13861232 "minimum": 0,
1387- "description": "Default minimum strokeWidth for strokeWidth (or rule/line's size) scale with zero=false.\n\n__Default value:__ `1`"
1233+ "description": "The stroke width, in pixels."
13881234 },
1389- "pointPadding": {
1235+ "tension": {
13901236 "type": "number",
13911237 "minimum": 0,
13921238 "maximum": 1,
1393- "description": "Default outer padding for `x` and `y` point-ordinal scales.\n\n__Default value:__ `0.5`"
1394- },
1395- "rangeStep": {
1396- "anyOf": [
1397- {
1398- "type": "number",
1399- "minimum": 0
1400- },
1401- {
1402- "type": "null"
1403- }
1404- ],
1405- "description": "Default range step for band and point scales of (1) the `y` channel\nand (2) the `x` channel when the mark is not `text`.\n\n__Default value:__ `21`"
1239+ "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
14061240 },
1407- "round": {
1408- "type": "boolean",
1409- "description": "If true, rounds numeric output values to integers.\nThis can be helpful for snapping to the pixel grid.\n(Only available for `x`, `y`, and `size` scales.)"
1241+ "text": {
1242+ "type": "string",
1243+ "description": "Placeholder text if the `text` channel is not specified"
14101244 },
1411- "textXRangeStep": {
1245+ "theta": {
14121246 "type": "number",
1413- "minimum": 0,
1414- "description": "Default range step for `x` band and point scales of text marks.\n\n__Default value:__ `90`"
1415- },
1416- "useUnaggregatedDomain": {
1417- "type": "boolean",
1418- "description": "Use the source data range before aggregation as scale domain instead of aggregated data\nfor aggregate axis.\n\nThis is equivalent to setting `domain` to `\"unaggregate\"` for aggregated _quantitative_\nfields by default.\n\nThis property only works with aggregate functions that produce values within the raw data\ndomain (`\"mean\"`, `\"average\"`, `\"median\"`, `\"q1\"`, `\"q3\"`, `\"min\"`, `\"max\"`). For other\naggregations that produce values outside of the raw data domain (e.g. `\"count\"`,\n`\"sum\"`), this property is ignored.\n\n__Default value:__ `false`"
1247+ "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
14191248 }
14201249 },
14211250 "required": [],
1422- "title": "ScaleConfig",
1423- "description": "Scale configuration determines default properties for all [scales](scale.html). For a full list of scale configuration options, please see the [corresponding section of the scale documentation](scale.html#config)."
1251+ "title": "BarConfig",
1252+ "description": "Bar-Specific Config "
14241253 },
1425- "SelectionConfig": {
1254+ "LegendConfig": {
14261255 "type": "object",
14271256 "additionalProperties": false,
14281257 "properties": {
1429- "interval": {
1430- "$ref": "#/definitions/IntervalSelectionConfig",
1431- "description": "The default definition for an [`interval`](selection.html#type) selection. All properties\nand transformations\nfor an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move\ninterval selections by default."
1258+ "cornerRadius": {
1259+ "type": "number",
1260+ "description": "Corner radius for the full legend."
14321261 },
1433- "multi": {
1434- "$ref": "#/definitions/MultiSelectionConfig",
1435- "description": "The default definition for a [`multi`](selection.html#type) selection. All properties and\ntransformations\nfor a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to\nmulti selections when clicking with the alt-key pressed by default."
1262+ "entryPadding": {
1263+ "type": "number",
1264+ "description": "Padding (in pixels) between legend entries in a symbol legend."
14361265 },
1437- "single": {
1438- "$ref": "#/definitions/SingleSelectionConfig",
1439- "description": "The default definition for a [`single`](selection.html#type) selection. All properties\nand transformations\nfor a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on\ndouble-click by default."
1440- }
1441- },
1442- "required": [],
1443- "title": "SelectionConfig",
1444- "description": "An object hash for defining default properties for each type of selections. "
1445- },
1446- "IntervalSelectionConfig": {
1447- "type": "object",
1448- "additionalProperties": false,
1449- "properties": {
1450- "bind": {
1451- "$ref": "#/definitions/BindEnum",
1452- "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view."
1266+ "fillColor": {
1267+ "type": "string",
1268+ "description": "Background fill color for the full legend."
14531269 },
1454- "empty": {
1455- "$ref": "#/definitions/Empty",
1456- "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
1270+ "gradientHeight": {
1271+ "type": "number",
1272+ "minimum": 0,
1273+ "description": "The height of the gradient, in pixels."
14571274 },
1458- "encodings": {
1459- "type": "array",
1460- "items": {
1461- "$ref": "#/definitions/SingleDefChannel"
1462- },
1463- "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
1275+ "gradientLabelBaseline": {
1276+ "type": "string",
1277+ "description": "Text baseline for color ramp gradient labels."
14641278 },
1465- "fields": {
1466- "type": "array",
1467- "items": {
1468- "type": "string"
1469- },
1470- "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
1279+ "gradientLabelLimit": {
1280+ "type": "number",
1281+ "description": "The maximum allowed length in pixels of color ramp gradient labels."
14711282 },
1472- "mark": {
1473- "$ref": "#/definitions/BrushConfig",
1474- "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark."
1283+ "gradientLabelOffset": {
1284+ "type": "number",
1285+ "description": "Vertical offset in pixels for color ramp gradient labels."
14751286 },
1476- "on": {
1477- "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
1287+ "gradientStrokeColor": {
1288+ "type": "string",
1289+ "description": "The color of the gradient stroke, can be in hex color code or regular color name."
14781290 },
1479- "resolve": {
1480- "$ref": "#/definitions/SelectionResolution",
1481- "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
1291+ "gradientStrokeWidth": {
1292+ "type": "number",
1293+ "minimum": 0,
1294+ "description": "The width of the gradient stroke, in pixels."
14821295 },
1483- "translate": {
1484- "$ref": "#/definitions/Translate",
1485- "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it."
1296+ "gradientWidth": {
1297+ "type": "number",
1298+ "minimum": 0,
1299+ "description": "The width of the gradient, in pixels."
14861300 },
1487- "zoom": {
1488- "$ref": "#/definitions/Translate",
1489- "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n\n__Default value:__ `true`, which corresponds to `wheel!`."
1490- }
1491- },
1492- "required": [],
1493- "title": "IntervalSelectionConfig",
1494- "description": "The default definition for an [`interval`](selection.html#type) selection. All properties and transformations\nfor an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move\ninterval selections by default."
1495- },
1496- "BrushConfig": {
1497- "type": "object",
1498- "additionalProperties": false,
1499- "properties": {
1500- "fill": {
1301+ "labelAlign": {
15011302 "type": "string",
1502- "description": "The fill color of the interval mark.\n\n__Default value:__ `#333333`"
1303+ "description": "The alignment of the legend label, can be left, middle or right."
15031304 },
1504- "fillOpacity": {
1305+ "labelBaseline": {
1306+ "type": "string",
1307+ "description": "The position of the baseline of legend label, can be top, middle or bottom."
1308+ },
1309+ "labelColor": {
1310+ "type": "string",
1311+ "description": "The color of the legend label, can be in hex color code or regular color name."
1312+ },
1313+ "labelFont": {
1314+ "type": "string",
1315+ "description": "The font of the legend label."
1316+ },
1317+ "labelFontSize": {
15051318 "type": "number",
1506- "description": "The fill opacity of the interval mark (a value between 0 and 1).\n\n__Default value:__ `0.125`"
1319+ "minimum": 0,
1320+ "description": "The font size of legend label.\n\n__Default value:__ `10`."
15071321 },
1508- "stroke": {
1322+ "labelLimit": {
1323+ "type": "number",
1324+ "description": "Maximum allowed pixel width of axis tick labels."
1325+ },
1326+ "labelOffset": {
1327+ "type": "number",
1328+ "minimum": 0,
1329+ "description": "The offset of the legend label."
1330+ },
1331+ "offset": {
1332+ "type": "number",
1333+ "description": "The offset, in pixels, by which to displace the legend from the edge of the enclosing\ngroup or data rectangle.\n\n__Default value:__ `0`"
1334+ },
1335+ "orient": {
1336+ "$ref": "#/definitions/LegendOrient",
1337+ "description": "The orientation of the legend, which determines how the legend is positioned within the\nscene. One of \"left\", \"right\", \"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\",\n\"none\".\n\n__Default value:__ `\"right\"`"
1338+ },
1339+ "padding": {
1340+ "type": "number",
1341+ "description": "The padding, in pixels, between the legend and axis."
1342+ },
1343+ "shortTimeLabels": {
1344+ "type": "boolean",
1345+ "description": "Whether month names and weekday names should be abbreviated.\n\n__Default value:__ `false`"
1346+ },
1347+ "strokeColor": {
15091348 "type": "string",
1510- "description": "The stroke color of the interval mark.\n\n__Default value:__ `#ffffff`"
1349+ "description": "Border stroke color for the full legend."
15111350 },
15121351 "strokeDash": {
15131352 "type": "array",
15141353 "items": {
15151354 "type": "number"
15161355 },
1517- "description": "An array of alternating stroke and space lengths,\nfor creating dashed or dotted lines."
1356+ "description": "Border stroke dash pattern for the full legend."
15181357 },
1519- "strokeDashOffset": {
1358+ "strokeWidth": {
15201359 "type": "number",
1521- "description": "The offset (in pixels) with which to begin drawing the stroke dash array."
1360+ "description": "Border stroke width for the full legend."
15221361 },
1523- "strokeOpacity": {
1362+ "symbolColor": {
1363+ "type": "string",
1364+ "description": "The color of the legend symbol,"
1365+ },
1366+ "symbolSize": {
15241367 "type": "number",
1525- "description": "The stroke opacity of the interval mark (a value between 0 and 1)."
1368+ "minimum": 0,
1369+ "description": "The size of the legend symbol, in pixels."
15261370 },
1527- "strokeWidth": {
1371+ "symbolStrokeWidth": {
15281372 "type": "number",
1529- "description": "The stroke width of the interval mark."
1373+ "minimum": 0,
1374+ "description": "The width of the symbol's stroke."
1375+ },
1376+ "symbolType": {
1377+ "type": "string",
1378+ "description": "Default shape type (such as \"circle\") for legend symbols."
1379+ },
1380+ "titleAlign": {
1381+ "type": "string",
1382+ "description": "Horizontal text alignment for legend titles."
1383+ },
1384+ "titleBaseline": {
1385+ "type": "string",
1386+ "description": "Vertical text baseline for legend titles."
1387+ },
1388+ "titleColor": {
1389+ "type": "string",
1390+ "description": "The color of the legend title, can be in hex color code or regular color name."
1391+ },
1392+ "titleFont": {
1393+ "type": "string",
1394+ "description": "The font of the legend title."
1395+ },
1396+ "titleFontSize": {
1397+ "type": "number",
1398+ "description": "The font size of the legend title."
1399+ },
1400+ "titleFontWeight": {
1401+ "$ref": "#/definitions/TitleFontWeight",
1402+ "description": "The font weight of the legend title."
1403+ },
1404+ "titleLimit": {
1405+ "type": "number",
1406+ "description": "Maximum allowed pixel width of axis titles."
1407+ },
1408+ "titlePadding": {
1409+ "type": "number",
1410+ "description": "The padding, in pixels, between title and legend."
15301411 }
15311412 },
15321413 "required": [],
1533- "title": "BrushConfig",
1534- "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark."
1414+ "title": "LegendConfig",
1415+ "description": "Legend configuration, which determines default properties for all [legends](legend.html). For a full list of legend configuration options, please see the [corresponding section of in the legend documentation](legend.html#config)."
15351416 },
1536- "MultiSelectionConfig": {
1417+ "PaddingClass": {
15371418 "type": "object",
15381419 "additionalProperties": false,
15391420 "properties": {
1540- "empty": {
1541- "$ref": "#/definitions/Empty",
1542- "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
1421+ "bottom": {
1422+ "type": "number"
15431423 },
1544- "encodings": {
1545- "type": "array",
1546- "items": {
1547- "$ref": "#/definitions/SingleDefChannel"
1548- },
1549- "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
1424+ "left": {
1425+ "type": "number"
15501426 },
1551- "fields": {
1552- "type": "array",
1553- "items": {
1554- "type": "string"
1555- },
1556- "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
1557- },
1558- "nearest": {
1559- "type": "boolean",
1560- "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
1561- },
1562- "on": {
1563- "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
1564- },
1565- "resolve": {
1566- "$ref": "#/definitions/SelectionResolution",
1567- "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
1427+ "right": {
1428+ "type": "number"
15681429 },
1569- "toggle": {
1570- "$ref": "#/definitions/Translate",
1571- "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\nSee the [toggle transform](toggle.html) documentation for more information."
1430+ "top": {
1431+ "type": "number"
15721432 }
15731433 },
15741434 "required": [],
1575- "title": "MultiSelectionConfig",
1576- "description": "The default definition for a [`multi`](selection.html#type) selection. All properties and transformations\nfor a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to\nmulti selections when clicking with the alt-key pressed by default."
1435+ "title": "PaddingClass"
15771436 },
1578- "SingleSelectionConfig": {
1437+ "ProjectionConfig": {
15791438 "type": "object",
15801439 "additionalProperties": false,
15811440 "properties": {
1582- "bind": {
1583- "type": "object",
1584- "additionalProperties": {
1585- "$ref": "#/definitions/VGBinding"
1441+ "center": {
1442+ "type": "array",
1443+ "items": {
1444+ "type": "number"
15861445 },
1587- "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](bind.html) documentation for more information."
1446+ "description": "Sets the projection’s center to the specified center, a two-element array of longitude\nand latitude in degrees.\n\n__Default value:__ `[0, 0]`"
15881447 },
1589- "empty": {
1590- "$ref": "#/definitions/Empty",
1591- "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
1448+ "clipAngle": {
1449+ "type": "number",
1450+ "description": "Sets the projection’s clipping circle radius to the specified angle in degrees. If\n`null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather\nthan small-circle clipping."
15921451 },
1593- "encodings": {
1452+ "clipExtent": {
15941453 "type": "array",
15951454 "items": {
1596- "$ref": "#/definitions/SingleDefChannel"
1455+ "type": "array",
1456+ "items": {
1457+ "type": "number"
1458+ }
15971459 },
1598- "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
1460+ "description": "Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent\nbounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of\nthe viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no\nviewport clipping is performed."
15991461 },
1600- "fields": {
1462+ "coefficient": {
1463+ "type": "number"
1464+ },
1465+ "distance": {
1466+ "type": "number"
1467+ },
1468+ "fraction": {
1469+ "type": "number"
1470+ },
1471+ "lobes": {
1472+ "type": "number"
1473+ },
1474+ "parallel": {
1475+ "type": "number"
1476+ },
1477+ "precision": {
1478+ "$ref": "#/definitions/PurplePrecision",
1479+ "description": "Sets the threshold for the projection’s [adaptive\nresampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This\nvalue corresponds to the [Douglas–Peucker\ndistance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).\nIf precision is not specified, returns the projection’s current resampling precision\nwhich defaults to `√0.5 ≅ 0.70710…`."
1480+ },
1481+ "radius": {
1482+ "type": "number"
1483+ },
1484+ "ratio": {
1485+ "type": "number"
1486+ },
1487+ "rotate": {
16011488 "type": "array",
16021489 "items": {
1603- "type": "string"
1490+ "type": "number"
16041491 },
1605- "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
1492+ "description": "Sets the projection’s three-axis rotation to the specified angles, which must be a two-\nor three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation\nangles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)\n\n__Default value:__ `[0, 0, 0]`"
16061493 },
1607- "nearest": {
1608- "type": "boolean",
1609- "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
1494+ "spacing": {
1495+ "type": "number"
16101496 },
1611- "on": {
1612- "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
1497+ "tilt": {
1498+ "type": "number"
16131499 },
1614- "resolve": {
1615- "$ref": "#/definitions/SelectionResolution",
1616- "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
1500+ "type": {
1501+ "$ref": "#/definitions/VGProjectionType",
1502+ "description": "The cartographic projection to use. This value is case-insensitive, for example\n`\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid\nprojection types [in the\ndocumentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`"
16171503 }
16181504 },
16191505 "required": [],
1620- "title": "SingleSelectionConfig",
1621- "description": "The default definition for a [`single`](selection.html#type) selection. All properties and transformations\n for a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on double-click by default."
1506+ "title": "ProjectionConfig",
1507+ "description": "Projection configuration, which determines default properties for all [projections](projection.html). For a full list of projection configuration options, please see the [corresponding section of the projection documentation](projection.html#config).\nAny property of Projection can be in config"
16221508 },
1623- "VGMarkConfig": {
1509+ "PurplePrecision": {
16241510 "type": "object",
1625- "additionalProperties": false,
1511+ "additionalProperties": {
1512+ "type": "string"
1513+ },
16261514 "properties": {
1627- "align": {
1628- "$ref": "#/definitions/HorizontalAlign",
1629- "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
1630- },
1631- "angle": {
1515+ "length": {
16321516 "type": "number",
1633- "minimum": 0,
1634- "maximum": 360,
1635- "description": "The rotation angle of the text, in degrees."
1517+ "description": "Returns the length of a String object."
1518+ }
1519+ },
1520+ "required": [
1521+ "length"
1522+ ],
1523+ "title": "PurplePrecision",
1524+ "description": "Sets the threshold for the projection’s [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [Douglas–Peucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection’s current resampling precision which defaults to `√0.5 ≅ 0.70710…`."
1525+ },
1526+ "RangeConfig": {
1527+ "type": "object",
1528+ "additionalProperties": {
1529+ "$ref": "#/definitions/RangeConfigValue"
1530+ },
1531+ "properties": {
1532+ "category": {
1533+ "$ref": "#/definitions/Category",
1534+ "description": "Default range for _nominal_ (categorical) fields."
16361535 },
1637- "baseline": {
1638- "$ref": "#/definitions/VerticalAlign",
1639- "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
1536+ "diverging": {
1537+ "$ref": "#/definitions/Category",
1538+ "description": "Default range for diverging _quantitative_ fields."
16401539 },
1641- "cursor": {
1642- "$ref": "#/definitions/Cursor",
1643- "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
1540+ "heatmap": {
1541+ "$ref": "#/definitions/Category",
1542+ "description": "Default range for _quantitative_ heatmaps."
16441543 },
1645- "dx": {
1646- "type": "number",
1647- "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
1544+ "ordinal": {
1545+ "$ref": "#/definitions/Category",
1546+ "description": "Default range for _ordinal_ fields."
16481547 },
1649- "dy": {
1650- "type": "number",
1651- "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
1548+ "ramp": {
1549+ "$ref": "#/definitions/Category",
1550+ "description": "Default range for _quantitative_ and _temporal_ fields."
16521551 },
1653- "fill": {
1654- "type": "string",
1655- "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
1552+ "symbol": {
1553+ "type": "array",
1554+ "items": {
1555+ "type": "string"
1556+ },
1557+ "description": "Default range palette for the `shape` channel."
1558+ }
1559+ },
1560+ "required": [],
1561+ "title": "RangeConfig",
1562+ "description": "An object hash that defines default range arrays or schemes for using with scales.\nFor a full list of scale range configuration options, please see the [corresponding section of the scale documentation](scale.html#config)."
1563+ },
1564+ "VGScheme": {
1565+ "type": "object",
1566+ "additionalProperties": false,
1567+ "properties": {
1568+ "count": {
1569+ "type": "number"
16561570 },
1657- "fillOpacity": {
1571+ "extent": {
1572+ "type": "array",
1573+ "items": {
1574+ "type": "number"
1575+ }
1576+ },
1577+ "scheme": {
1578+ "type": "string"
1579+ }
1580+ },
1581+ "required": [
1582+ "scheme"
1583+ ],
1584+ "title": "VGScheme"
1585+ },
1586+ "RangeConfigValueClass": {
1587+ "type": "object",
1588+ "additionalProperties": false,
1589+ "properties": {
1590+ "step": {
1591+ "type": "number"
1592+ }
1593+ },
1594+ "required": [
1595+ "step"
1596+ ],
1597+ "title": "RangeConfigValueClass"
1598+ },
1599+ "ScaleConfig": {
1600+ "type": "object",
1601+ "additionalProperties": false,
1602+ "properties": {
1603+ "bandPaddingInner": {
16581604 "type": "number",
16591605 "minimum": 0,
16601606 "maximum": 1,
1661- "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
1662- },
1663- "font": {
1664- "type": "string",
1665- "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
1607+ "description": "Default inner padding for `x` and `y` band-ordinal scales.\n\n__Default value:__ `0.1`"
16661608 },
1667- "fontSize": {
1609+ "bandPaddingOuter": {
16681610 "type": "number",
16691611 "minimum": 0,
1670- "description": "The font size, in pixels."
1671- },
1672- "fontStyle": {
1673- "$ref": "#/definitions/FontStyle",
1674- "description": "The font style (e.g., `\"italic\"`)."
1675- },
1676- "fontWeight": {
1677- "$ref": "#/definitions/FontWeightUnion",
1678- "description": "The font weight (e.g., `\"bold\"`)."
1679- },
1680- "href": {
1681- "type": "string",
1682- "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
1612+ "maximum": 1,
1613+ "description": "Default outer padding for `x` and `y` band-ordinal scales.\nIf not specified, by default, band scale's paddingOuter is paddingInner/2."
16831614 },
1684- "interpolate": {
1685- "$ref": "#/definitions/Interpolate",
1686- "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
1615+ "clamp": {
1616+ "type": "boolean",
1617+ "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum\nrange value"
16871618 },
1688- "limit": {
1619+ "continuousPadding": {
16891620 "type": "number",
1690- "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
1621+ "minimum": 0,
1622+ "description": "Default padding for continuous scales.\n\n__Default:__ `5` for continuous x-scale of a vertical bar and continuous y-scale of a\nhorizontal bar.; `0` otherwise."
16911623 },
1692- "opacity": {
1624+ "maxBandSize": {
16931625 "type": "number",
16941626 "minimum": 0,
1695- "maximum": 1,
1696- "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
1697- },
1698- "orient": {
1699- "$ref": "#/definitions/Orient",
1700- "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
1627+ "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the scale's `rangeStep` - 1."
17011628 },
1702- "radius": {
1629+ "maxFontSize": {
17031630 "type": "number",
17041631 "minimum": 0,
1705- "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
1632+ "description": "The default max value for mapping quantitative fields to text's size/fontSize.\n\n__Default value:__ `40`"
17061633 },
1707- "shape": {
1708- "type": "string",
1709- "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
1710- },
1711- "size": {
1634+ "maxOpacity": {
17121635 "type": "number",
17131636 "minimum": 0,
1714- "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
1715- },
1716- "stroke": {
1717- "type": "string",
1718- "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
1719- },
1720- "strokeDash": {
1721- "type": "array",
1722- "items": {
1723- "type": "number"
1724- },
1725- "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
1637+ "maximum": 1,
1638+ "description": "Default max opacity for mapping a field to opacity.\n\n__Default value:__ `0.8`"
17261639 },
1727- "strokeDashOffset": {
1640+ "maxSize": {
17281641 "type": "number",
1729- "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
1642+ "minimum": 0,
1643+ "description": "Default max value for point size scale."
17301644 },
1731- "strokeOpacity": {
1645+ "maxStrokeWidth": {
17321646 "type": "number",
17331647 "minimum": 0,
1734- "maximum": 1,
1735- "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
1648+ "description": "Default max strokeWidth for strokeWidth (or rule/line's size) scale.\n\n__Default value:__ `4`"
17361649 },
1737- "strokeWidth": {
1650+ "minBandSize": {
17381651 "type": "number",
17391652 "minimum": 0,
1740- "description": "The stroke width, in pixels."
1653+ "description": "The default min value for mapping quantitative fields to bar and tick's size/bandSize\nscale with zero=false.\n\n__Default value:__ `2`"
17411654 },
1742- "tension": {
1655+ "minFontSize": {
17431656 "type": "number",
17441657 "minimum": 0,
1745- "maximum": 1,
1746- "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
1747- },
1748- "text": {
1749- "type": "string",
1750- "description": "Placeholder text if the `text` channel is not specified"
1658+ "description": "The default min value for mapping quantitative fields to tick's size/fontSize scale with\nzero=false\n\n__Default value:__ `8`"
17511659 },
1752- "theta": {
1660+ "minOpacity": {
17531661 "type": "number",
1754- "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
1755- }
1756- },
1757- "required": [],
1758- "title": "VGMarkConfig"
1759- },
1760- "TextConfig": {
1761- "type": "object",
1762- "additionalProperties": false,
1763- "properties": {
1764- "align": {
1765- "$ref": "#/definitions/HorizontalAlign",
1766- "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
1662+ "minimum": 0,
1663+ "maximum": 1,
1664+ "description": "Default minimum opacity for mapping a field to opacity.\n\n__Default value:__ `0.3`"
17671665 },
1768- "angle": {
1666+ "minSize": {
17691667 "type": "number",
17701668 "minimum": 0,
1771- "maximum": 360,
1772- "description": "The rotation angle of the text, in degrees."
1773- },
1774- "baseline": {
1775- "$ref": "#/definitions/VerticalAlign",
1776- "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
1777- },
1778- "color": {
1779- "type": "string",
1780- "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
1781- },
1782- "cursor": {
1783- "$ref": "#/definitions/Cursor",
1784- "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
1669+ "description": "Default minimum value for point size scale with zero=false.\n\n__Default value:__ `9`"
17851670 },
1786- "dx": {
1671+ "minStrokeWidth": {
17871672 "type": "number",
1788- "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
1673+ "minimum": 0,
1674+ "description": "Default minimum strokeWidth for strokeWidth (or rule/line's size) scale with zero=false.\n\n__Default value:__ `1`"
17891675 },
1790- "dy": {
1676+ "pointPadding": {
17911677 "type": "number",
1792- "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
1678+ "minimum": 0,
1679+ "maximum": 1,
1680+ "description": "Default outer padding for `x` and `y` point-ordinal scales.\n\n__Default value:__ `0.5`"
17931681 },
1794- "fill": {
1795- "type": "string",
1796- "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
1682+ "rangeStep": {
1683+ "anyOf": [
1684+ {
1685+ "type": "number",
1686+ "minimum": 0
1687+ },
1688+ {
1689+ "type": "null"
1690+ }
1691+ ],
1692+ "description": "Default range step for band and point scales of (1) the `y` channel\nand (2) the `x` channel when the mark is not `text`.\n\n__Default value:__ `21`"
17971693 },
1798- "filled": {
1694+ "round": {
17991695 "type": "boolean",
1800- "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
1696+ "description": "If true, rounds numeric output values to integers.\nThis can be helpful for snapping to the pixel grid.\n(Only available for `x`, `y`, and `size` scales.)"
18011697 },
1802- "fillOpacity": {
1698+ "textXRangeStep": {
18031699 "type": "number",
18041700 "minimum": 0,
1805- "maximum": 1,
1806- "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
1701+ "description": "Default range step for `x` band and point scales of text marks.\n\n__Default value:__ `90`"
18071702 },
1808- "font": {
1809- "type": "string",
1810- "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
1703+ "useUnaggregatedDomain": {
1704+ "type": "boolean",
1705+ "description": "Use the source data range before aggregation as scale domain instead of aggregated data\nfor aggregate axis.\n\nThis is equivalent to setting `domain` to `\"unaggregate\"` for aggregated _quantitative_\nfields by default.\n\nThis property only works with aggregate functions that produce values within the raw data\ndomain (`\"mean\"`, `\"average\"`, `\"median\"`, `\"q1\"`, `\"q3\"`, `\"min\"`, `\"max\"`). For other\naggregations that produce values outside of the raw data domain (e.g. `\"count\"`,\n`\"sum\"`), this property is ignored.\n\n__Default value:__ `false`"
1706+ }
1707+ },
1708+ "required": [],
1709+ "title": "ScaleConfig",
1710+ "description": "Scale configuration determines default properties for all [scales](scale.html). For a full list of scale configuration options, please see the [corresponding section of the scale documentation](scale.html#config)."
1711+ },
1712+ "SelectionConfig": {
1713+ "type": "object",
1714+ "additionalProperties": false,
1715+ "properties": {
1716+ "interval": {
1717+ "$ref": "#/definitions/IntervalSelectionConfig",
1718+ "description": "The default definition for an [`interval`](selection.html#type) selection. All properties\nand transformations\nfor an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move\ninterval selections by default."
18111719 },
1812- "fontSize": {
1813- "type": "number",
1814- "minimum": 0,
1815- "description": "The font size, in pixels."
1720+ "multi": {
1721+ "$ref": "#/definitions/MultiSelectionConfig",
1722+ "description": "The default definition for a [`multi`](selection.html#type) selection. All properties and\ntransformations\nfor a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to\nmulti selections when clicking with the alt-key pressed by default."
18161723 },
1817- "fontStyle": {
1818- "$ref": "#/definitions/FontStyle",
1819- "description": "The font style (e.g., `\"italic\"`)."
1724+ "single": {
1725+ "$ref": "#/definitions/SingleSelectionConfig",
1726+ "description": "The default definition for a [`single`](selection.html#type) selection. All properties\nand transformations\nfor a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on\ndouble-click by default."
1727+ }
1728+ },
1729+ "required": [],
1730+ "title": "SelectionConfig",
1731+ "description": "An object hash for defining default properties for each type of selections. "
1732+ },
1733+ "IntervalSelectionConfig": {
1734+ "type": "object",
1735+ "additionalProperties": false,
1736+ "properties": {
1737+ "bind": {
1738+ "$ref": "#/definitions/Bind",
1739+ "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view."
18201740 },
1821- "fontWeight": {
1822- "$ref": "#/definitions/FontWeightUnion",
1823- "description": "The font weight (e.g., `\"bold\"`)."
1741+ "empty": {
1742+ "$ref": "#/definitions/Empty",
1743+ "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
18241744 },
1825- "href": {
1826- "type": "string",
1827- "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
1745+ "encodings": {
1746+ "type": "array",
1747+ "items": {
1748+ "$ref": "#/definitions/SingleDefChannel"
1749+ },
1750+ "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
18281751 },
1829- "interpolate": {
1830- "$ref": "#/definitions/Interpolate",
1831- "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
1752+ "fields": {
1753+ "type": "array",
1754+ "items": {
1755+ "type": "string"
1756+ },
1757+ "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
18321758 },
1833- "limit": {
1834- "type": "number",
1835- "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
1759+ "mark": {
1760+ "$ref": "#/definitions/BrushConfig",
1761+ "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark."
18361762 },
1837- "opacity": {
1838- "type": "number",
1839- "minimum": 0,
1840- "maximum": 1,
1841- "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
1763+ "on": {
1764+ "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
18421765 },
1843- "orient": {
1844- "$ref": "#/definitions/Orient",
1845- "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
1766+ "resolve": {
1767+ "$ref": "#/definitions/SelectionResolution",
1768+ "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
18461769 },
1847- "radius": {
1848- "type": "number",
1849- "minimum": 0,
1850- "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
1770+ "translate": {
1771+ "$ref": "#/definitions/Translate",
1772+ "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it."
18511773 },
1852- "shape": {
1774+ "zoom": {
1775+ "$ref": "#/definitions/Translate",
1776+ "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n\n__Default value:__ `true`, which corresponds to `wheel!`."
1777+ }
1778+ },
1779+ "required": [],
1780+ "title": "IntervalSelectionConfig",
1781+ "description": "The default definition for an [`interval`](selection.html#type) selection. All properties and transformations\nfor an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move\ninterval selections by default."
1782+ },
1783+ "BrushConfig": {
1784+ "type": "object",
1785+ "additionalProperties": false,
1786+ "properties": {
1787+ "fill": {
18531788 "type": "string",
1854- "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
1855- },
1856- "shortTimeLabels": {
1857- "type": "boolean",
1858- "description": "Whether month names and weekday names should be abbreviated."
1789+ "description": "The fill color of the interval mark.\n\n__Default value:__ `#333333`"
18591790 },
1860- "size": {
1791+ "fillOpacity": {
18611792 "type": "number",
1862- "minimum": 0,
1863- "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
1793+ "description": "The fill opacity of the interval mark (a value between 0 and 1).\n\n__Default value:__ `0.125`"
18641794 },
18651795 "stroke": {
18661796 "type": "string",
1867- "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
1797+ "description": "The stroke color of the interval mark.\n\n__Default value:__ `#ffffff`"
18681798 },
18691799 "strokeDash": {
18701800 "type": "array",
18711801 "items": {
18721802 "type": "number"
18731803 },
1874- "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
1804+ "description": "An array of alternating stroke and space lengths,\nfor creating dashed or dotted lines."
18751805 },
18761806 "strokeDashOffset": {
18771807 "type": "number",
1878- "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
1808+ "description": "The offset (in pixels) with which to begin drawing the stroke dash array."
18791809 },
18801810 "strokeOpacity": {
18811811 "type": "number",
1882- "minimum": 0,
1883- "maximum": 1,
1884- "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
1812+ "description": "The stroke opacity of the interval mark (a value between 0 and 1)."
18851813 },
18861814 "strokeWidth": {
18871815 "type": "number",
1888- "minimum": 0,
1889- "description": "The stroke width, in pixels."
1890- },
1891- "tension": {
1892- "type": "number",
1893- "minimum": 0,
1894- "maximum": 1,
1895- "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
1896- },
1897- "text": {
1898- "type": "string",
1899- "description": "Placeholder text if the `text` channel is not specified"
1900- },
1901- "theta": {
1902- "type": "number",
1903- "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
1816+ "description": "The stroke width of the interval mark."
19041817 }
19051818 },
19061819 "required": [],
1907- "title": "TextConfig",
1908- "description": "Text-Specific Config "
1820+ "title": "BrushConfig",
1821+ "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark."
19091822 },
1910- "TickConfig": {
1823+ "MultiSelectionConfig": {
1824+ "type": "object",
1825+ "additionalProperties": false,
1826+ "properties": {
1827+ "empty": {
1828+ "$ref": "#/definitions/Empty",
1829+ "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
1830+ },
1831+ "encodings": {
1832+ "type": "array",
1833+ "items": {
1834+ "$ref": "#/definitions/SingleDefChannel"
1835+ },
1836+ "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
1837+ },
1838+ "fields": {
1839+ "type": "array",
1840+ "items": {
1841+ "type": "string"
1842+ },
1843+ "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
1844+ },
1845+ "nearest": {
1846+ "type": "boolean",
1847+ "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
1848+ },
1849+ "on": {
1850+ "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
1851+ },
1852+ "resolve": {
1853+ "$ref": "#/definitions/SelectionResolution",
1854+ "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
1855+ },
1856+ "toggle": {
1857+ "$ref": "#/definitions/Translate",
1858+ "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\nSee the [toggle transform](toggle.html) documentation for more information."
1859+ }
1860+ },
1861+ "required": [],
1862+ "title": "MultiSelectionConfig",
1863+ "description": "The default definition for a [`multi`](selection.html#type) selection. All properties and transformations\nfor a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to\nmulti selections when clicking with the alt-key pressed by default."
1864+ },
1865+ "SingleSelectionConfig": {
1866+ "type": "object",
1867+ "additionalProperties": false,
1868+ "properties": {
1869+ "bind": {
1870+ "type": "object",
1871+ "additionalProperties": {
1872+ "$ref": "#/definitions/VGBinding"
1873+ },
1874+ "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](bind.html) documentation for more information."
1875+ },
1876+ "empty": {
1877+ "$ref": "#/definitions/Empty",
1878+ "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
1879+ },
1880+ "encodings": {
1881+ "type": "array",
1882+ "items": {
1883+ "$ref": "#/definitions/SingleDefChannel"
1884+ },
1885+ "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
1886+ },
1887+ "fields": {
1888+ "type": "array",
1889+ "items": {
1890+ "type": "string"
1891+ },
1892+ "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
1893+ },
1894+ "nearest": {
1895+ "type": "boolean",
1896+ "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
1897+ },
1898+ "on": {
1899+ "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
1900+ },
1901+ "resolve": {
1902+ "$ref": "#/definitions/SelectionResolution",
1903+ "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
1904+ }
1905+ },
1906+ "required": [],
1907+ "title": "SingleSelectionConfig",
1908+ "description": "The default definition for a [`single`](selection.html#type) selection. All properties and transformations\n for a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on double-click by default."
1909+ },
1910+ "VGCheckboxBinding": {
1911+ "type": "object",
1912+ "additionalProperties": false,
1913+ "properties": {
1914+ "element": {
1915+ "type": "string"
1916+ },
1917+ "input": {
1918+ "$ref": "#/definitions/PurpleInput"
1919+ }
1920+ },
1921+ "required": [
1922+ "input"
1923+ ],
1924+ "title": "VGCheckboxBinding"
1925+ },
1926+ "VGRadioBinding": {
1927+ "type": "object",
1928+ "additionalProperties": false,
1929+ "properties": {
1930+ "element": {
1931+ "type": "string"
1932+ },
1933+ "input": {
1934+ "$ref": "#/definitions/FluffyInput"
1935+ },
1936+ "options": {
1937+ "type": "array",
1938+ "items": {
1939+ "type": "string"
1940+ }
1941+ }
1942+ },
1943+ "required": [
1944+ "input",
1945+ "options"
1946+ ],
1947+ "title": "VGRadioBinding"
1948+ },
1949+ "VGSelectBinding": {
1950+ "type": "object",
1951+ "additionalProperties": false,
1952+ "properties": {
1953+ "element": {
1954+ "type": "string"
1955+ },
1956+ "input": {
1957+ "$ref": "#/definitions/TentacledInput"
1958+ },
1959+ "options": {
1960+ "type": "array",
1961+ "items": {
1962+ "type": "string"
1963+ }
1964+ }
1965+ },
1966+ "required": [
1967+ "input",
1968+ "options"
1969+ ],
1970+ "title": "VGSelectBinding"
1971+ },
1972+ "VGRangeBinding": {
1973+ "type": "object",
1974+ "additionalProperties": false,
1975+ "properties": {
1976+ "element": {
1977+ "type": "string"
1978+ },
1979+ "input": {
1980+ "$ref": "#/definitions/StickyInput"
1981+ },
1982+ "max": {
1983+ "type": "number"
1984+ },
1985+ "min": {
1986+ "type": "number"
1987+ },
1988+ "step": {
1989+ "type": "number"
1990+ }
1991+ },
1992+ "required": [
1993+ "input"
1994+ ],
1995+ "title": "VGRangeBinding"
1996+ },
1997+ "VGGenericBinding": {
1998+ "type": "object",
1999+ "additionalProperties": false,
2000+ "properties": {
2001+ "element": {
2002+ "type": "string"
2003+ },
2004+ "input": {
2005+ "type": "string"
2006+ }
2007+ },
2008+ "required": [
2009+ "input"
2010+ ],
2011+ "title": "VGGenericBinding"
2012+ },
2013+ "VGMarkConfig": {
19112014 "type": "object",
19122015 "additionalProperties": false,
19132016 "properties": {
@@ -1921,19 +2024,10 @@
19212024 "maximum": 360,
19222025 "description": "The rotation angle of the text, in degrees."
19232026 },
1924- "bandSize": {
1925- "type": "number",
1926- "minimum": 0,
1927- "description": "The width of the ticks.\n\n__Default value:__ 2/3 of rangeStep."
1928- },
19292027 "baseline": {
19302028 "$ref": "#/definitions/VerticalAlign",
19312029 "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
19322030 },
1933- "color": {
1934- "type": "string",
1935- "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
1936- },
19372031 "cursor": {
19382032 "$ref": "#/definitions/Cursor",
19392033 "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
@@ -1950,10 +2044,6 @@
19502044 "type": "string",
19512045 "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
19522046 },
1953- "filled": {
1954- "type": "boolean",
1955- "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
1956- },
19572047 "fillOpacity": {
19582048 "type": "number",
19592049 "minimum": 0,
@@ -2052,1838 +2142,2700 @@
20522142 "theta": {
20532143 "type": "number",
20542144 "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
2055- },
2056- "thickness": {
2057- "type": "number",
2058- "minimum": 0,
2059- "description": "Thickness of the tick mark.\n\n__Default value:__ `1`"
20602145 }
20612146 },
20622147 "required": [],
2063- "title": "TickConfig",
2064- "description": "Tick-Specific Config "
2148+ "title": "VGMarkConfig"
20652149 },
2066- "VGTitleConfig": {
2150+ "TextConfig": {
20672151 "type": "object",
20682152 "additionalProperties": false,
20692153 "properties": {
2070- "anchor": {
2071- "$ref": "#/definitions/Anchor",
2072- "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For\nexample, with an orientation of top these anchor positions map to a left-, center-, or\nright-aligned title.\n\n__Default value:__ `\"middle\"` for [single](spec.html) and [layered](layer.html) views.\n`\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only\ncustomizable only for [single](spec.html) and [layered](layer.html) views. For other\ncomposite views, `anchor` is always `\"start\"`."
2154+ "align": {
2155+ "$ref": "#/definitions/HorizontalAlign",
2156+ "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
20732157 },
20742158 "angle": {
20752159 "type": "number",
2076- "description": "Angle in degrees of title text."
2160+ "minimum": 0,
2161+ "maximum": 360,
2162+ "description": "The rotation angle of the text, in degrees."
20772163 },
20782164 "baseline": {
20792165 "$ref": "#/definitions/VerticalAlign",
2080- "description": "Vertical text baseline for title text."
2166+ "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
20812167 },
20822168 "color": {
20832169 "type": "string",
2084- "description": "Text color for title text."
2170+ "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
2171+ },
2172+ "cursor": {
2173+ "$ref": "#/definitions/Cursor",
2174+ "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
2175+ },
2176+ "dx": {
2177+ "type": "number",
2178+ "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
2179+ },
2180+ "dy": {
2181+ "type": "number",
2182+ "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
2183+ },
2184+ "fill": {
2185+ "type": "string",
2186+ "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
2187+ },
2188+ "filled": {
2189+ "type": "boolean",
2190+ "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
2191+ },
2192+ "fillOpacity": {
2193+ "type": "number",
2194+ "minimum": 0,
2195+ "maximum": 1,
2196+ "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
20852197 },
20862198 "font": {
20872199 "type": "string",
2088- "description": "Font name for title text."
2200+ "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
20892201 },
20902202 "fontSize": {
20912203 "type": "number",
20922204 "minimum": 0,
2093- "description": "Font size in pixels for title text.\n\n__Default value:__ `10`."
2205+ "description": "The font size, in pixels."
2206+ },
2207+ "fontStyle": {
2208+ "$ref": "#/definitions/FontStyle",
2209+ "description": "The font style (e.g., `\"italic\"`)."
20942210 },
20952211 "fontWeight": {
20962212 "$ref": "#/definitions/FontWeightUnion",
2097- "description": "Font weight for title text."
2213+ "description": "The font weight (e.g., `\"bold\"`)."
20982214 },
2099- "limit": {
2100- "type": "number",
2101- "minimum": 0,
2102- "description": "The maximum allowed length in pixels of legend labels."
2215+ "href": {
2216+ "type": "string",
2217+ "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
21032218 },
2104- "offset": {
2219+ "interpolate": {
2220+ "$ref": "#/definitions/Interpolate",
2221+ "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
2222+ },
2223+ "limit": {
21052224 "type": "number",
2106- "description": "Offset in pixels of the title from the chart body and axes."
2225+ "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
2226+ },
2227+ "opacity": {
2228+ "type": "number",
2229+ "minimum": 0,
2230+ "maximum": 1,
2231+ "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
21072232 },
21082233 "orient": {
2109- "$ref": "#/definitions/TitleOrient",
2110- "description": "Default title orientation (\"top\", \"bottom\", \"left\", or \"right\")"
2111- }
2112- },
2113- "required": [],
2114- "title": "VGTitleConfig",
2115- "description": "Title configuration, which determines default properties for all [titles](title.html). For a full list of title configuration options, please see the [corresponding section of the title documentation](title.html#config)."
2116- },
2117- "ViewConfig": {
2118- "type": "object",
2119- "additionalProperties": false,
2120- "properties": {
2121- "clip": {
2122- "type": "boolean",
2123- "description": "Whether the view should be clipped."
2234+ "$ref": "#/definitions/Orient",
2235+ "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
21242236 },
2125- "fill": {
2237+ "radius": {
2238+ "type": "number",
2239+ "minimum": 0,
2240+ "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
2241+ },
2242+ "shape": {
21262243 "type": "string",
2127- "description": "The fill color.\n\n__Default value:__ (none)"
2244+ "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
21282245 },
2129- "fillOpacity": {
2130- "type": "number",
2131- "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ (none)"
2246+ "shortTimeLabels": {
2247+ "type": "boolean",
2248+ "description": "Whether month names and weekday names should be abbreviated."
21322249 },
2133- "height": {
2250+ "size": {
21342251 "type": "number",
2135- "description": "The default height of the single plot or each plot in a trellis plot when the\nvisualization has a continuous (non-ordinal) y-scale with `rangeStep` = `null`.\n\n__Default value:__ `200`"
2252+ "minimum": 0,
2253+ "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
21362254 },
21372255 "stroke": {
21382256 "type": "string",
2139- "description": "The stroke color.\n\n__Default value:__ (none)"
2257+ "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
21402258 },
21412259 "strokeDash": {
21422260 "type": "array",
21432261 "items": {
21442262 "type": "number"
21452263 },
2146- "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.\n\n__Default value:__ (none)"
2264+ "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
21472265 },
21482266 "strokeDashOffset": {
21492267 "type": "number",
2150- "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.\n\n__Default value:__ (none)"
2268+ "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
21512269 },
21522270 "strokeOpacity": {
21532271 "type": "number",
2154- "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ (none)"
2272+ "minimum": 0,
2273+ "maximum": 1,
2274+ "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
21552275 },
21562276 "strokeWidth": {
21572277 "type": "number",
2158- "description": "The stroke width, in pixels.\n\n__Default value:__ (none)"
2278+ "minimum": 0,
2279+ "description": "The stroke width, in pixels."
21592280 },
2160- "width": {
2281+ "tension": {
21612282 "type": "number",
2162- "description": "The default width of the single plot or each plot in a trellis plot when the\nvisualization has a continuous (non-ordinal) x-scale or ordinal x-scale with `rangeStep`\n= `null`.\n\n__Default value:__ `200`"
2163- }
2164- },
2165- "required": [],
2166- "title": "ViewConfig",
2167- "description": "Default properties for [single view plots](spec.html#single). "
2168- },
2169- "Data": {
2170- "type": "object",
2171- "additionalProperties": false,
2172- "properties": {
2173- "format": {
2174- "$ref": "#/definitions/DataFormat",
2175- "description": "An object that specifies the format for parsing the data file.\n\nAn object that specifies the format for parsing the data values.\n\nAn object that specifies the format for parsing the data."
2283+ "minimum": 0,
2284+ "maximum": 1,
2285+ "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
21762286 },
2177- "url": {
2287+ "text": {
21782288 "type": "string",
2179- "description": "An URL from which to load the data set. Use the `format.type` property\nto ensure the loaded data is correctly parsed."
2180- },
2181- "values": {
2182- "$ref": "#/definitions/Values",
2183- "description": "The full data set, included inline. This can be an array of objects or primitive values\nor a string.\nArrays of primitive values are ingested as objects with a `data` property. Strings are\nparsed according to the specified format type."
2289+ "description": "Placeholder text if the `text` channel is not specified"
21842290 },
2185- "name": {
2186- "type": "string",
2187- "description": "Provide a placeholder name and bind data at runtime."
2291+ "theta": {
2292+ "type": "number",
2293+ "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
21882294 }
21892295 },
21902296 "required": [],
2191- "title": "Data",
2192- "description": "An object describing the data source\nSecondary data source to lookup in."
2297+ "title": "TextConfig",
2298+ "description": "Text-Specific Config "
21932299 },
2194- "DataFormat": {
2300+ "TickConfig": {
21952301 "type": "object",
21962302 "additionalProperties": false,
21972303 "properties": {
2198- "parse": {
2199- "$ref": "#/definitions/ParseUnion",
2200- "description": "If set to auto (the default), perform automatic type inference to determine the desired\ndata types.\nAlternatively, a parsing directive object can be provided for explicit data types. Each\nproperty of the object corresponds to a field name, and the value to the desired data\ntype (one of `\"number\"`, `\"boolean\"` or `\"date\"`).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each\ninput record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's\n[`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: 'date:\"%m%d%Y\"'}`), using the\n[d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date\nformat parsing is supported similarly (e.g., `{foo: 'utc:\"%m%d%Y\"'}`). See more about\n[UTC time](timeunit.html#utc)"
2304+ "align": {
2305+ "$ref": "#/definitions/HorizontalAlign",
2306+ "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
22012307 },
2202- "type": {
2203- "$ref": "#/definitions/DataFormatType",
2204- "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
2308+ "angle": {
2309+ "type": "number",
2310+ "minimum": 0,
2311+ "maximum": 360,
2312+ "description": "The rotation angle of the text, in degrees."
22052313 },
2206- "property": {
2314+ "bandSize": {
2315+ "type": "number",
2316+ "minimum": 0,
2317+ "description": "The width of the ticks.\n\n__Default value:__ 2/3 of rangeStep."
2318+ },
2319+ "baseline": {
2320+ "$ref": "#/definitions/VerticalAlign",
2321+ "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
2322+ },
2323+ "color": {
22072324 "type": "string",
2208- "description": "The JSON property containing the desired data.\nThis parameter can be used when the loaded JSON file may have surrounding structure or\nmeta-data.\nFor example `\"property\": \"values.features\"` is equivalent to retrieving\n`json.values.features`\nfrom the loaded JSON object."
2325+ "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
22092326 },
2210- "feature": {
2327+ "cursor": {
2328+ "$ref": "#/definitions/Cursor",
2329+ "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
2330+ },
2331+ "dx": {
2332+ "type": "number",
2333+ "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
2334+ },
2335+ "dy": {
2336+ "type": "number",
2337+ "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
2338+ },
2339+ "fill": {
22112340 "type": "string",
2212- "description": "The name of the TopoJSON object set to convert to a GeoJSON feature collection.\nFor example, in a map of the world, there may be an object set named `\"countries\"`.\nUsing the feature property, we can extract this set and generate a GeoJSON feature object\nfor each country."
2341+ "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
22132342 },
2214- "mesh": {
2343+ "filled": {
2344+ "type": "boolean",
2345+ "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
2346+ },
2347+ "fillOpacity": {
2348+ "type": "number",
2349+ "minimum": 0,
2350+ "maximum": 1,
2351+ "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
2352+ },
2353+ "font": {
22152354 "type": "string",
2216- "description": "The name of the TopoJSON object set to convert to mesh.\nSimilar to the `feature` option, `mesh` extracts a named TopoJSON object set.\nUnlike the `feature` option, the corresponding geo data is returned as a single, unified\nmesh instance, not as individual GeoJSON features.\nExtracting a mesh is useful for more efficiently drawing borders or other geographic\nelements that you do not need to associate with specific regions such as individual\ncountries, states or counties."
2217- }
2218- },
2219- "required": [],
2220- "title": "DataFormat",
2221- "description": "An object that specifies the format for parsing the data file.\nAn object that specifies the format for parsing the data values.\nAn object that specifies the format for parsing the data."
2222- },
2223- "EncodingWithFacet": {
2224- "type": "object",
2225- "additionalProperties": false,
2226- "properties": {
2227- "color": {
2228- "$ref": "#/definitions/MarkPropDefWithCondition",
2229- "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark\nconfig](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color\nscheme](scale.html#scheme)."
2355+ "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
22302356 },
2231- "column": {
2232- "$ref": "#/definitions/FacetFieldDef",
2233- "description": "Horizontal facets for trellis plots."
2357+ "fontSize": {
2358+ "type": "number",
2359+ "minimum": 0,
2360+ "description": "The font size, in pixels."
22342361 },
2235- "detail": {
2236- "$ref": "#/definitions/Detail",
2237- "description": "Additional levels of detail for grouping data in aggregate views and\nin line and area marks without mapping data to a specific visual channel."
2362+ "fontStyle": {
2363+ "$ref": "#/definitions/FontStyle",
2364+ "description": "The font style (e.g., `\"italic\"`)."
2365+ },
2366+ "fontWeight": {
2367+ "$ref": "#/definitions/FontWeightUnion",
2368+ "description": "The font weight (e.g., `\"bold\"`)."
22382369 },
22392370 "href": {
2240- "$ref": "#/definitions/DefWithCondition",
2241- "description": "A URL to load upon mouse click."
2371+ "type": "string",
2372+ "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
2373+ },
2374+ "interpolate": {
2375+ "$ref": "#/definitions/Interpolate",
2376+ "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
2377+ },
2378+ "limit": {
2379+ "type": "number",
2380+ "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
22422381 },
22432382 "opacity": {
2244- "$ref": "#/definitions/MarkPropDefWithCondition",
2245- "description": "Opacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark\nconfig](config.html#mark)'s `opacity` property."
2383+ "type": "number",
2384+ "minimum": 0,
2385+ "maximum": 1,
2386+ "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
22462387 },
2247- "order": {
2248- "$ref": "#/definitions/Order",
2249- "description": "Stack order for stacked marks or order of data points in line marks for connected scatter\nplots.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating\nadditional aggregation grouping."
2388+ "orient": {
2389+ "$ref": "#/definitions/Orient",
2390+ "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
22502391 },
2251- "row": {
2252- "$ref": "#/definitions/FacetFieldDef",
2253- "description": "Vertical facets for trellis plots."
2392+ "radius": {
2393+ "type": "number",
2394+ "minimum": 0,
2395+ "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
22542396 },
22552397 "shape": {
2256- "$ref": "#/definitions/MarkPropDefWithCondition",
2257- "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark\nconfig](config.html#point-config)'s `shape` property."
2398+ "type": "string",
2399+ "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
22582400 },
22592401 "size": {
2260- "$ref": "#/definitions/MarkPropDefWithCondition",
2261- "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`."
2262- },
2263- "text": {
2264- "$ref": "#/definitions/TextDefWithCondition",
2265- "description": "Text of the `text` mark."
2402+ "type": "number",
2403+ "minimum": 0,
2404+ "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
22662405 },
2267- "tooltip": {
2268- "$ref": "#/definitions/TextDefWithCondition",
2269- "description": "The tooltip text to show upon mouse hover."
2406+ "stroke": {
2407+ "type": "string",
2408+ "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
22702409 },
2271- "x": {
2272- "$ref": "#/definitions/XClass",
2273- "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`."
2410+ "strokeDash": {
2411+ "type": "array",
2412+ "items": {
2413+ "type": "number"
2414+ },
2415+ "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
22742416 },
2275- "x2": {
2276- "$ref": "#/definitions/X2Class",
2277- "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
2417+ "strokeDashOffset": {
2418+ "type": "number",
2419+ "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
22782420 },
2279- "y": {
2280- "$ref": "#/definitions/XClass",
2281- "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`."
2421+ "strokeOpacity": {
2422+ "type": "number",
2423+ "minimum": 0,
2424+ "maximum": 1,
2425+ "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
22822426 },
2283- "y2": {
2284- "$ref": "#/definitions/X2Class",
2285- "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
2427+ "strokeWidth": {
2428+ "type": "number",
2429+ "minimum": 0,
2430+ "description": "The stroke width, in pixels."
2431+ },
2432+ "tension": {
2433+ "type": "number",
2434+ "minimum": 0,
2435+ "maximum": 1,
2436+ "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
2437+ },
2438+ "text": {
2439+ "type": "string",
2440+ "description": "Placeholder text if the `text` channel is not specified"
2441+ },
2442+ "theta": {
2443+ "type": "number",
2444+ "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
2445+ },
2446+ "thickness": {
2447+ "type": "number",
2448+ "minimum": 0,
2449+ "description": "Thickness of the tick mark.\n\n__Default value:__ `1`"
22862450 }
22872451 },
22882452 "required": [],
2289- "title": "EncodingWithFacet",
2290- "description": "A key-value mapping between encoding channels and definition of fields."
2453+ "title": "TickConfig",
2454+ "description": "Tick-Specific Config "
22912455 },
2292- "MarkPropDefWithCondition": {
2456+ "VGTitleConfig": {
22932457 "type": "object",
22942458 "additionalProperties": false,
22952459 "properties": {
2296- "aggregate": {
2297- "$ref": "#/definitions/AggregateOp",
2298- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
2460+ "anchor": {
2461+ "$ref": "#/definitions/Anchor",
2462+ "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For\nexample, with an orientation of top these anchor positions map to a left-, center-, or\nright-aligned title.\n\n__Default value:__ `\"middle\"` for [single](spec.html) and [layered](layer.html) views.\n`\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only\ncustomizable only for [single](spec.html) and [layered](layer.html) views. For other\ncomposite views, `anchor` is always `\"start\"`."
22992463 },
2300- "bin": {
2301- "$ref": "#/definitions/Bin",
2302- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
2464+ "angle": {
2465+ "type": "number",
2466+ "description": "Angle in degrees of title text."
23032467 },
2304- "condition": {
2305- "$ref": "#/definitions/ColorCondition",
2306- "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value\ndefinitions](encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel.\n\nA field definition or one or more value definition(s) with a selection predicate."
2468+ "baseline": {
2469+ "$ref": "#/definitions/VerticalAlign",
2470+ "description": "Vertical text baseline for title text."
23072471 },
2308- "field": {
2309- "$ref": "#/definitions/Field",
2310- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
2472+ "color": {
2473+ "type": "string",
2474+ "description": "Text color for title text."
23112475 },
2312- "legend": {
2313- "anyOf": [
2314- {
2315- "$ref": "#/definitions/Legend"
2316- },
2317- {
2318- "type": "null"
2319- }
2320- ],
2321- "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](legend.html) are applied."
2476+ "font": {
2477+ "type": "string",
2478+ "description": "Font name for title text."
23222479 },
2323- "scale": {
2324- "$ref": "#/definitions/Scale",
2325- "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
2480+ "fontSize": {
2481+ "type": "number",
2482+ "minimum": 0,
2483+ "description": "Font size in pixels for title text.\n\n__Default value:__ `10`."
23262484 },
2327- "sort": {
2328- "$ref": "#/definitions/SortUnion",
2329- "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
2485+ "fontWeight": {
2486+ "$ref": "#/definitions/FontWeightUnion",
2487+ "description": "Font weight for title text."
23302488 },
2331- "timeUnit": {
2332- "$ref": "#/definitions/TimeUnit",
2333- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
2489+ "limit": {
2490+ "type": "number",
2491+ "minimum": 0,
2492+ "description": "The maximum allowed length in pixels of legend labels."
23342493 },
2335- "type": {
2336- "$ref": "#/definitions/Type",
2337- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
2494+ "offset": {
2495+ "type": "number",
2496+ "description": "Offset in pixels of the title from the chart body and axes."
23382497 },
2339- "value": {
2340- "$ref": "#/definitions/ConditionalValueDefValue",
2341- "description": "A constant value in visual domain."
2498+ "orient": {
2499+ "$ref": "#/definitions/TitleOrient",
2500+ "description": "Default title orientation (\"top\", \"bottom\", \"left\", or \"right\")"
23422501 }
23432502 },
23442503 "required": [],
2345- "title": "MarkPropDefWithCondition",
2346- "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color scheme](scale.html#scheme).\nOpacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](config.html#mark)'s `opacity` property.\nFor `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](config.html#point-config)'s `shape` property.\nSize of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`.\nA FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}\nA ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
2504+ "title": "VGTitleConfig",
2505+ "description": "Title configuration, which determines default properties for all [titles](title.html). For a full list of title configuration options, please see the [corresponding section of the title documentation](title.html#config)."
23472506 },
2348- "BinParams": {
2507+ "ViewConfig": {
23492508 "type": "object",
23502509 "additionalProperties": false,
23512510 "properties": {
2352- "base": {
2511+ "clip": {
2512+ "type": "boolean",
2513+ "description": "Whether the view should be clipped."
2514+ },
2515+ "fill": {
2516+ "type": "string",
2517+ "description": "The fill color.\n\n__Default value:__ (none)"
2518+ },
2519+ "fillOpacity": {
23532520 "type": "number",
2354- "description": "The number base to use for automatic bin determination (default is base 10).\n\n__Default value:__ `10`"
2521+ "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ (none)"
23552522 },
2356- "divide": {
2357- "type": "array",
2358- "items": {
2359- "type": "number"
2360- },
2361- "minItems": 1,
2362- "description": "Scale factors indicating allowable subdivisions. The default value is [5, 2], which\nindicates that for base 10 numbers (the default base), the method may consider dividing\nbin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can\ncheck if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the\ngiven constraints.\n\n__Default value:__ `[5, 2]`"
2523+ "height": {
2524+ "type": "number",
2525+ "description": "The default height of the single plot or each plot in a trellis plot when the\nvisualization has a continuous (non-ordinal) y-scale with `rangeStep` = `null`.\n\n__Default value:__ `200`"
23632526 },
2364- "extent": {
2527+ "stroke": {
2528+ "type": "string",
2529+ "description": "The stroke color.\n\n__Default value:__ (none)"
2530+ },
2531+ "strokeDash": {
23652532 "type": "array",
23662533 "items": {
23672534 "type": "number"
23682535 },
2369- "minItems": 2,
2370- "maxItems": 2,
2371- "description": "A two-element (`[min, max]`) array indicating the range of desired bin values."
2536+ "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.\n\n__Default value:__ (none)"
23722537 },
2373- "maxbins": {
2538+ "strokeDashOffset": {
23742539 "type": "number",
2375- "minimum": 2,
2376- "description": "Maximum number of bins.\n\n__Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels"
2540+ "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.\n\n__Default value:__ (none)"
23772541 },
2378- "minstep": {
2542+ "strokeOpacity": {
23792543 "type": "number",
2380- "description": "A minimum allowable step size (particularly useful for integer values)."
2381- },
2382- "nice": {
2383- "type": "boolean",
2384- "description": "If true (the default), attempts to make the bin boundaries use human-friendly boundaries,\nsuch as multiples of ten."
2544+ "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ (none)"
23852545 },
2386- "step": {
2546+ "strokeWidth": {
23872547 "type": "number",
2388- "description": "An exact step size to use between bins.\n\n__Note:__ If provided, options such as maxbins will be ignored."
2548+ "description": "The stroke width, in pixels.\n\n__Default value:__ (none)"
23892549 },
2390- "steps": {
2391- "type": "array",
2392- "items": {
2393- "type": "number"
2394- },
2395- "minItems": 1,
2396- "description": "An array of allowable step sizes to choose from."
2550+ "width": {
2551+ "type": "number",
2552+ "description": "The default width of the single plot or each plot in a trellis plot when the\nvisualization has a continuous (non-ordinal) x-scale or ordinal x-scale with `rangeStep`\n= `null`.\n\n__Default value:__ `200`"
23972553 }
23982554 },
23992555 "required": [],
2400- "title": "BinParams",
2401- "description": "Binning properties or boolean flag for determining whether to bin data or not."
2556+ "title": "ViewConfig",
2557+ "description": "Default properties for [single view plots](spec.html#single). "
24022558 },
2403- "ConditionalValueDef": {
2559+ "URLData": {
24042560 "type": "object",
24052561 "additionalProperties": false,
24062562 "properties": {
2407- "test": {
2408- "$ref": "#/definitions/LogicalOperandPredicate"
2409- },
2410- "value": {
2411- "$ref": "#/definitions/ConditionalValueDefValue",
2412- "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
2563+ "format": {
2564+ "$ref": "#/definitions/DataFormat",
2565+ "description": "An object that specifies the format for parsing the data file."
24132566 },
2414- "selection": {
2415- "$ref": "#/definitions/SelectionOperand",
2416- "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
2567+ "url": {
2568+ "type": "string",
2569+ "description": "An URL from which to load the data set. Use the `format.type` property\nto ensure the loaded data is correctly parsed."
24172570 }
24182571 },
24192572 "required": [
2420- "value"
2573+ "url"
24212574 ],
2422- "title": "ConditionalValueDef"
2575+ "title": "URLData"
24232576 },
2424- "ConditionalPredicateMarkPropFieldDefClass": {
2577+ "InlineData": {
24252578 "type": "object",
24262579 "additionalProperties": false,
24272580 "properties": {
2428- "test": {
2429- "$ref": "#/definitions/LogicalOperandPredicate"
2430- },
2431- "value": {
2432- "$ref": "#/definitions/ConditionalValueDefValue",
2433- "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
2434- },
2435- "selection": {
2436- "$ref": "#/definitions/SelectionOperand",
2437- "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
2438- },
2439- "aggregate": {
2440- "$ref": "#/definitions/AggregateOp",
2441- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
2442- },
2443- "bin": {
2444- "$ref": "#/definitions/Bin",
2445- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
2446- },
2447- "field": {
2448- "$ref": "#/definitions/Field",
2449- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
2450- },
2451- "legend": {
2452- "anyOf": [
2453- {
2454- "$ref": "#/definitions/Legend"
2455- },
2456- {
2457- "type": "null"
2458- }
2459- ],
2460- "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](legend.html) are applied."
2461- },
2462- "scale": {
2463- "$ref": "#/definitions/Scale",
2464- "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
2465- },
2466- "sort": {
2467- "$ref": "#/definitions/SortUnion",
2468- "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
2469- },
2470- "timeUnit": {
2471- "$ref": "#/definitions/TimeUnit",
2472- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
2581+ "format": {
2582+ "$ref": "#/definitions/DataFormat",
2583+ "description": "An object that specifies the format for parsing the data values."
24732584 },
2474- "type": {
2475- "$ref": "#/definitions/Type",
2476- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
2585+ "values": {
2586+ "$ref": "#/definitions/Values",
2587+ "description": "The full data set, included inline. This can be an array of objects or primitive values\nor a string.\nArrays of primitive values are ingested as objects with a `data` property. Strings are\nparsed according to the specified format type."
24772588 }
24782589 },
2479- "required": [],
2480- "title": "ConditionalPredicateMarkPropFieldDefClass"
2590+ "required": [
2591+ "values"
2592+ ],
2593+ "title": "InlineData"
24812594 },
2482- "Selection": {
2595+ "NamedData": {
24832596 "type": "object",
24842597 "additionalProperties": false,
24852598 "properties": {
2486- "not": {
2487- "$ref": "#/definitions/SelectionOperand"
2488- },
2489- "and": {
2490- "type": "array",
2491- "items": {
2492- "$ref": "#/definitions/SelectionOperand"
2493- }
2599+ "format": {
2600+ "$ref": "#/definitions/DataFormat",
2601+ "description": "An object that specifies the format for parsing the data."
24942602 },
2495- "or": {
2496- "type": "array",
2497- "items": {
2498- "$ref": "#/definitions/SelectionOperand"
2499- }
2603+ "name": {
2604+ "type": "string",
2605+ "description": "Provide a placeholder name and bind data at runtime."
25002606 }
25012607 },
2502- "required": [],
2503- "title": "Selection"
2608+ "required": [
2609+ "name"
2610+ ],
2611+ "title": "NamedData"
25042612 },
2505- "Predicate": {
2613+ "CSVDataFormat": {
25062614 "type": "object",
25072615 "additionalProperties": false,
25082616 "properties": {
2509- "not": {
2510- "$ref": "#/definitions/LogicalOperandPredicate"
2511- },
2512- "and": {
2513- "type": "array",
2514- "items": {
2515- "$ref": "#/definitions/LogicalOperandPredicate"
2516- }
2517- },
2518- "or": {
2519- "type": "array",
2520- "items": {
2521- "$ref": "#/definitions/LogicalOperandPredicate"
2522- }
2617+ "parse": {
2618+ "$ref": "#/definitions/ParseUnion",
2619+ "description": "If set to auto (the default), perform automatic type inference to determine the desired\ndata types.\nAlternatively, a parsing directive object can be provided for explicit data types. Each\nproperty of the object corresponds to a field name, and the value to the desired data\ntype (one of `\"number\"`, `\"boolean\"` or `\"date\"`).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each\ninput record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's\n[`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: 'date:\"%m%d%Y\"'}`), using the\n[d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date\nformat parsing is supported similarly (e.g., `{foo: 'utc:\"%m%d%Y\"'}`). See more about\n[UTC time](timeunit.html#utc)"
25232620 },
2524- "equal": {
2525- "$ref": "#/definitions/Equal",
2526- "description": "The value that the field should be equal to."
2621+ "type": {
2622+ "$ref": "#/definitions/PurpleType",
2623+ "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
2624+ }
2625+ },
2626+ "required": [],
2627+ "title": "CSVDataFormat"
2628+ },
2629+ "JSONDataFormat": {
2630+ "type": "object",
2631+ "additionalProperties": false,
2632+ "properties": {
2633+ "parse": {
2634+ "$ref": "#/definitions/ParseUnion",
2635+ "description": "If set to auto (the default), perform automatic type inference to determine the desired\ndata types.\nAlternatively, a parsing directive object can be provided for explicit data types. Each\nproperty of the object corresponds to a field name, and the value to the desired data\ntype (one of `\"number\"`, `\"boolean\"` or `\"date\"`).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each\ninput record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's\n[`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: 'date:\"%m%d%Y\"'}`), using the\n[d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date\nformat parsing is supported similarly (e.g., `{foo: 'utc:\"%m%d%Y\"'}`). See more about\n[UTC time](timeunit.html#utc)"
25272636 },
2528- "field": {
2637+ "property": {
25292638 "type": "string",
2530- "description": "Field to be filtered.\n\nField to be filtered"
2639+ "description": "The JSON property containing the desired data.\nThis parameter can be used when the loaded JSON file may have surrounding structure or\nmeta-data.\nFor example `\"property\": \"values.features\"` is equivalent to retrieving\n`json.values.features`\nfrom the loaded JSON object."
25312640 },
2532- "timeUnit": {
2533- "$ref": "#/definitions/TimeUnit",
2534- "description": "Time unit for the field to be filtered.\n\ntime unit for the field to be filtered."
2641+ "type": {
2642+ "$ref": "#/definitions/FluffyType",
2643+ "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
2644+ }
2645+ },
2646+ "required": [],
2647+ "title": "JSONDataFormat"
2648+ },
2649+ "TopoDataFormat": {
2650+ "type": "object",
2651+ "additionalProperties": false,
2652+ "properties": {
2653+ "feature": {
2654+ "type": "string",
2655+ "description": "The name of the TopoJSON object set to convert to a GeoJSON feature collection.\nFor example, in a map of the world, there may be an object set named `\"countries\"`.\nUsing the feature property, we can extract this set and generate a GeoJSON feature object\nfor each country."
25352656 },
2536- "range": {
2537- "type": "array",
2538- "items": {
2539- "$ref": "#/definitions/RangeElement"
2540- },
2541- "minItems": 2,
2542- "maxItems": 2,
2543- "description": "An array of inclusive minimum and maximum values\nfor a field value of a data item to be included in the filtered data."
2657+ "mesh": {
2658+ "type": "string",
2659+ "description": "The name of the TopoJSON object set to convert to mesh.\nSimilar to the `feature` option, `mesh` extracts a named TopoJSON object set.\nUnlike the `feature` option, the corresponding geo data is returned as a single, unified\nmesh instance, not as individual GeoJSON features.\nExtracting a mesh is useful for more efficiently drawing borders or other geographic\nelements that you do not need to associate with specific regions such as individual\ncountries, states or counties."
25442660 },
2545- "oneOf": {
2546- "type": "array",
2547- "items": {
2548- "$ref": "#/definitions/Equal"
2549- },
2550- "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data."
2661+ "parse": {
2662+ "$ref": "#/definitions/ParseUnion",
2663+ "description": "If set to auto (the default), perform automatic type inference to determine the desired\ndata types.\nAlternatively, a parsing directive object can be provided for explicit data types. Each\nproperty of the object corresponds to a field name, and the value to the desired data\ntype (one of `\"number\"`, `\"boolean\"` or `\"date\"`).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each\ninput record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's\n[`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: 'date:\"%m%d%Y\"'}`), using the\n[d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date\nformat parsing is supported similarly (e.g., `{foo: 'utc:\"%m%d%Y\"'}`). See more about\n[UTC time](timeunit.html#utc)"
25512664 },
2552- "selection": {
2553- "$ref": "#/definitions/SelectionOperand",
2554- "description": "Filter using a selection name."
2665+ "type": {
2666+ "$ref": "#/definitions/TentacledType",
2667+ "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
25552668 }
25562669 },
25572670 "required": [],
2558- "title": "Predicate"
2671+ "title": "TopoDataFormat"
25592672 },
2560- "DateTime": {
2673+ "EncodingWithFacet": {
25612674 "type": "object",
25622675 "additionalProperties": false,
25632676 "properties": {
2564- "date": {
2565- "type": "number",
2566- "minimum": 1,
2567- "maximum": 31,
2568- "description": "Integer value representing the date from 1-31."
2677+ "color": {
2678+ "$ref": "#/definitions/Color",
2679+ "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark\nconfig](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color\nscheme](scale.html#scheme)."
25692680 },
2570- "day": {
2571- "$ref": "#/definitions/Day",
2572- "description": "Value representing the day of a week. This can be one of: (1) integer value -- `1`\nrepresents Monday; (2) case-insensitive day name (e.g., `\"Monday\"`); (3)\ncase-insensitive, 3-character short day name (e.g., `\"Mon\"`). <br/> **Warning:** A\nDateTime definition object with `day`** should not be combined with `year`, `quarter`,\n`month`, or `date`."
2681+ "column": {
2682+ "$ref": "#/definitions/FacetFieldDef",
2683+ "description": "Horizontal facets for trellis plots."
25732684 },
2574- "hours": {
2575- "type": "number",
2576- "minimum": 0,
2577- "maximum": 23,
2578- "description": "Integer value representing the hour of a day from 0-23."
2685+ "detail": {
2686+ "$ref": "#/definitions/Detail",
2687+ "description": "Additional levels of detail for grouping data in aggregate views and\nin line and area marks without mapping data to a specific visual channel."
25792688 },
2580- "milliseconds": {
2581- "type": "number",
2582- "minimum": 0,
2583- "maximum": 999,
2584- "description": "Integer value representing the millisecond segment of time."
2689+ "href": {
2690+ "$ref": "#/definitions/Href",
2691+ "description": "A URL to load upon mouse click."
25852692 },
2586- "minutes": {
2587- "type": "number",
2588- "minimum": 0,
2589- "maximum": 59,
2590- "description": "Integer value representing the minute segment of time from 0-59."
2693+ "opacity": {
2694+ "$ref": "#/definitions/Color",
2695+ "description": "Opacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark\nconfig](config.html#mark)'s `opacity` property."
25912696 },
2592- "month": {
2593- "$ref": "#/definitions/Month",
2594- "description": "One of: (1) integer value representing the month from `1`-`12`. `1` represents January;\n(2) case-insensitive month name (e.g., `\"January\"`); (3) case-insensitive, 3-character\nshort month name (e.g., `\"Jan\"`)."
2697+ "order": {
2698+ "$ref": "#/definitions/Order",
2699+ "description": "Stack order for stacked marks or order of data points in line marks for connected scatter\nplots.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating\nadditional aggregation grouping."
25952700 },
2596- "quarter": {
2597- "type": "number",
2598- "minimum": 1,
2599- "maximum": 4,
2600- "description": "Integer value representing the quarter of the year (from 1-4)."
2701+ "row": {
2702+ "$ref": "#/definitions/FacetFieldDef",
2703+ "description": "Vertical facets for trellis plots."
26012704 },
2602- "seconds": {
2603- "type": "number",
2604- "minimum": 0,
2605- "maximum": 59,
2606- "description": "Integer value representing the second segment (0-59) of a time value"
2705+ "shape": {
2706+ "$ref": "#/definitions/Color",
2707+ "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark\nconfig](config.html#point-config)'s `shape` property."
26072708 },
2608- "utc": {
2609- "type": "boolean",
2610- "description": "A boolean flag indicating if date time is in utc time. If false, the date time is in\nlocal time"
2709+ "size": {
2710+ "$ref": "#/definitions/Color",
2711+ "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`."
26112712 },
2612- "year": {
2613- "type": "number",
2614- "description": "Integer value representing the year."
2713+ "text": {
2714+ "$ref": "#/definitions/Text",
2715+ "description": "Text of the `text` mark."
2716+ },
2717+ "tooltip": {
2718+ "$ref": "#/definitions/Text",
2719+ "description": "The tooltip text to show upon mouse hover."
2720+ },
2721+ "x": {
2722+ "$ref": "#/definitions/X",
2723+ "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`."
2724+ },
2725+ "x2": {
2726+ "$ref": "#/definitions/X2",
2727+ "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
2728+ },
2729+ "y": {
2730+ "$ref": "#/definitions/X",
2731+ "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`."
2732+ },
2733+ "y2": {
2734+ "$ref": "#/definitions/X2",
2735+ "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
26152736 }
26162737 },
26172738 "required": [],
2618- "title": "DateTime",
2619- "description": "Object for defining datetime in Vega-Lite Filter.\nIf both month and quarter are provided, month has higher precedence.\n`day` cannot be combined with other date.\nWe accept string for month and day names."
2620- },
2621- "RepeatRef": {
2622- "type": "object",
2623- "additionalProperties": false,
2624- "properties": {
2625- "repeat": {
2626- "$ref": "#/definitions/RepeatEnum"
2627- }
2628- },
2629- "required": [
2630- "repeat"
2631- ],
2632- "title": "RepeatRef",
2633- "description": "Reference to a repeated value."
2739+ "title": "EncodingWithFacet",
2740+ "description": "A key-value mapping between encoding channels and definition of fields."
26342741 },
2635- "Legend": {
2742+ "MarkPropFieldDefWithCondition": {
26362743 "type": "object",
26372744 "additionalProperties": false,
26382745 "properties": {
2639- "entryPadding": {
2640- "type": "number",
2641- "description": "Padding (in pixels) between legend entries in a symbol legend."
2642- },
2643- "format": {
2644- "type": "string",
2645- "description": "The formatting pattern for labels. This is D3's [number format\npattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's\n[time format pattern](https://github.com/d3/d3-time-format#locale_format) for time\nfield.\n\nSee the [format documentation](format.html) for more information.\n\n__Default value:__ derived from [numberFormat](config.html#format) config for\nquantitative fields and from [timeFormat](config.html#format) config for temporal fields."
2646- },
2647- "offset": {
2648- "type": "number",
2649- "description": "The offset, in pixels, by which to displace the legend from the edge of the enclosing\ngroup or data rectangle.\n\n__Default value:__ `0`"
2746+ "aggregate": {
2747+ "$ref": "#/definitions/AggregateOp",
2748+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
26502749 },
2651- "orient": {
2652- "$ref": "#/definitions/LegendOrient",
2653- "description": "The orientation of the legend, which determines how the legend is positioned within the\nscene. One of \"left\", \"right\", \"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\",\n\"none\".\n\n__Default value:__ `\"right\"`"
2750+ "bin": {
2751+ "$ref": "#/definitions/Bin",
2752+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
26542753 },
2655- "padding": {
2656- "type": "number",
2657- "description": "The padding, in pixels, between the legend and axis."
2754+ "condition": {
2755+ "$ref": "#/definitions/ConditionUnion",
2756+ "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value\ndefinitions](encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel."
26582757 },
2659- "tickCount": {
2660- "type": "number",
2661- "description": "The desired number of tick values for quantitative legends."
2758+ "field": {
2759+ "$ref": "#/definitions/Field",
2760+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
26622761 },
2663- "title": {
2762+ "legend": {
26642763 "anyOf": [
26652764 {
2666- "type": "null"
2765+ "$ref": "#/definitions/Legend"
26672766 },
26682767 {
2669- "type": "string"
2768+ "type": "null"
26702769 }
26712770 ],
2672- "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function\n(`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the\nfunction is displayed as a part of the title (e.g., `\"Sum of Profit\"`). If the field is\nbinned or has a time unit applied, the applied function will be denoted in parentheses\n(e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is\nsimply the field name.\n\n__Note__: You can customize the default field title format by providing the [`fieldTitle`\nproperty in the [config](config.html) or [`fieldTitle` function via the `compile`\nfunction's options](compile.html#field-title)."
2771+ "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](legend.html) are applied."
26732772 },
2674- "type": {
2675- "$ref": "#/definitions/LegendType",
2676- "description": "The type of the legend. Use `\"symbol\"` to create a discrete legend and `\"gradient\"` for a\ncontinuous color gradient.\n\n__Default value:__ `\"gradient\"` for non-binned quantitative fields and temporal fields;\n`\"symbol\"` otherwise."
2773+ "scale": {
2774+ "$ref": "#/definitions/Scale",
2775+ "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
26772776 },
2678- "values": {
2679- "type": "array",
2680- "items": {
2681- "$ref": "#/definitions/LegendValue"
2682- },
2683- "description": "Explicitly set the visible legend values."
2777+ "sort": {
2778+ "$ref": "#/definitions/SortUnion",
2779+ "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
26842780 },
2685- "zindex": {
2686- "type": "number",
2687- "minimum": 0,
2688- "description": "A non-positive integer indicating z-index of the legend.\nIf zindex is 0, legend should be drawn behind all chart elements.\nTo put them in front, use zindex = 1."
2781+ "timeUnit": {
2782+ "$ref": "#/definitions/TimeUnit",
2783+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
2784+ },
2785+ "type": {
2786+ "$ref": "#/definitions/Type",
2787+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
26892788 }
26902789 },
2691- "required": [],
2692- "title": "Legend",
2693- "description": "Properties of a legend or boolean flag for determining whether to show it."
2790+ "required": [
2791+ "type"
2792+ ],
2793+ "title": "MarkPropFieldDefWithCondition",
2794+ "description": "A FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}"
26942795 },
2695- "Scale": {
2796+ "MarkPropValueDefWithCondition": {
26962797 "type": "object",
26972798 "additionalProperties": false,
26982799 "properties": {
2699- "base": {
2700- "type": "number",
2701- "description": "The logarithm base of the `log` scale (default `10`)."
2702- },
2703- "clamp": {
2704- "type": "boolean",
2705- "description": "If `true`, values that exceed the data domain are clamped to either the minimum or\nmaximum range value\n\n__Default value:__ derived from the [scale config](config.html#scale-config)'s `clamp`\n(`true` by default)."
2800+ "condition": {
2801+ "$ref": "#/definitions/ColorCondition",
2802+ "description": "A field definition or one or more value definition(s) with a selection predicate."
27062803 },
2707- "domain": {
2708- "$ref": "#/definitions/DomainUnion",
2709- "description": "Customized domain values.\n\nFor _quantitative_ fields, `domain` can take the form of a two-element array with minimum\nand maximum values. [Piecewise scales](scale.html#piecewise) can be created by providing\na `domain` with more than two entries.\nIf the input field is aggregated, `domain` can also be a string value `\"unaggregated\"`,\nindicating that the domain should include the raw data values prior to the aggregation.\n\nFor _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in\nthe form of either timestamps or the [DateTime definition objects](types.html#datetime).\n\nFor _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input\nvalues.\n\nThe `selection` property can be used to [interactively\ndetermine](selection.html#scale-domains) the scale domain."
2710- },
2711- "exponent": {
2804+ "value": {
2805+ "$ref": "#/definitions/ConditionValue",
2806+ "description": "A constant value in visual domain."
2807+ }
2808+ },
2809+ "required": [],
2810+ "title": "MarkPropValueDefWithCondition",
2811+ "description": "A ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
2812+ },
2813+ "BinParams": {
2814+ "type": "object",
2815+ "additionalProperties": false,
2816+ "properties": {
2817+ "base": {
27122818 "type": "number",
2713- "description": "The exponent of the `pow` scale."
2714- },
2715- "interpolate": {
2716- "$ref": "#/definitions/InterpolateUnion",
2717- "description": "The interpolation method for range values. By default, a general interpolator for\nnumbers, dates, strings and colors (in RGB space) is used. For color ranges, this\nproperty allows interpolation in alternative color spaces. Legal values include `rgb`,\n`hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long'\nvariants use longer paths in polar coordinate spaces). If object-valued, this property\naccepts an object with a string-valued _type_ property and an optional numeric _gamma_\nproperty applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate\ndocumentation](https://github.com/d3/d3-interpolate).\n\n__Note:__ Sequential scales do not support `interpolate` as they have a fixed\ninterpolator. Since Vega-Lite uses sequential scales for quantitative fields by default,\nyou have to set the scale `type` to other quantitative scale type such as `\"linear\"` to\ncustomize `interpolate`."
2819+ "description": "The number base to use for automatic bin determination (default is base 10).\n\n__Default value:__ `10`"
27182820 },
2719- "nice": {
2720- "$ref": "#/definitions/NiceUnion",
2721- "description": "Extending the domain so that it starts and ends on nice round values. This method\ntypically modifies the scale’s domain, and may only extend the bounds to the nearest\nround value. Nicing is useful if the domain is computed from data and may be irregular.\nFor example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2,\n1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number.\nIf `nice` is a number, it will represent a desired tick count. This allows greater\ncontrol over the step size used to extend the bounds, guaranteeing that the returned\nticks will exactly cover the domain.\n\nFor temporal fields with time and utc scales, the `nice` value can be a string indicating\nthe desired time interval. Legal values are `\"millisecond\"`, `\"second\"`, `\"minute\"`,\n`\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, `time` and `utc`\nscales can accept an object-valued interval specifier of the form `{\"interval\": \"month\",\n\"step\": 3}`, which includes a desired number of interval steps. Here, the domain would\nsnap to quarter (Jan, Apr, Jul, Oct) boundaries.\n\n__Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise."
2821+ "divide": {
2822+ "type": "array",
2823+ "items": {
2824+ "type": "number"
2825+ },
2826+ "minItems": 1,
2827+ "description": "Scale factors indicating allowable subdivisions. The default value is [5, 2], which\nindicates that for base 10 numbers (the default base), the method may consider dividing\nbin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can\ncheck if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the\ngiven constraints.\n\n__Default value:__ `[5, 2]`"
27222828 },
2723- "padding": {
2724- "type": "number",
2725- "minimum": 0,
2726- "description": "For _[continuous](scale.html#continuous)_ scales, expands the scale domain to accommodate\nthe specified number of pixels on each of the scale range. The scale range must represent\npixels for this parameter to function as intended. Padding adjustment is performed prior\nto all other adjustments, including the effects of the zero, nice, domainMin, and\ndomainMax properties.\n\nFor _[band](scale.html#band)_ scales, shortcut for setting `paddingInner` and\n`paddingOuter` to the same value.\n\nFor _[point](scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale\nconfig](scale.html#config)'s `continuousPadding`.\nFor _band and point_ scales, see `paddingInner` and `paddingOuter`."
2829+ "extent": {
2830+ "type": "array",
2831+ "items": {
2832+ "type": "number"
2833+ },
2834+ "minItems": 2,
2835+ "maxItems": 2,
2836+ "description": "A two-element (`[min, max]`) array indicating the range of desired bin values."
27272837 },
2728- "paddingInner": {
2838+ "maxbins": {
27292839 "type": "number",
2730- "minimum": 0,
2731- "maximum": 1,
2732- "description": "The inner padding (spacing) within each band step of band scales, as a fraction of the\nstep size. This value must lie in the range [0,1].\n\nFor point scale, this property is invalid as point scales do not have internal band\nwidths (only step sizes between bands).\n\n__Default value:__ derived from the [scale config](scale.html#config)'s\n`bandPaddingInner`."
2840+ "minimum": 2,
2841+ "description": "Maximum number of bins.\n\n__Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels"
27332842 },
2734- "paddingOuter": {
2843+ "minstep": {
27352844 "type": "number",
2736- "minimum": 0,
2737- "maximum": 1,
2738- "description": "The outer padding (spacing) at the ends of the range of band and point scales,\nas a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](scale.html#config)'s\n`bandPaddingOuter` for band scales and `pointPadding` for point scales."
2739- },
2740- "range": {
2741- "$ref": "#/definitions/ScaleRange",
2742- "description": "The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](scale.html#range-config) (e.g.,\nexample, `\"symbol\"`, or `\"diverging\"`).\n\n- For [continuous scales](scale.html#continuous), two-element array indicating minimum\nand maximum values, or an array with more than two entries for specifying a [piecewise\nscale](scale.html#piecewise).\n\n- For [discrete](scale.html#discrete) and [discretizing](scale.html#discretizing) scales,\nan array of desired output values.\n\n__Notes:__\n\n1) For [sequential](scale.html#sequential), [ordinal](scale.html#ordinal), and\ndiscretizing color scales, you can also specify a color [`scheme`](scale.html#scheme)\ninstead of `range`.\n\n2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be\ncustomized via the view's corresponding [size](size.html) (`width` and `height`) or via\n[range steps and paddings properties](#range-step) for [band](#band) and [point](#point)\nscales."
2743- },
2744- "rangeStep": {
2745- "anyOf": [
2746- {
2747- "type": "number",
2748- "minimum": 0
2749- },
2750- {
2751- "type": "null"
2752- }
2753- ],
2754- "description": "The distance between the starts of adjacent bands or points in [band](scale.html#band)\nand [point](scale.html#point) scales.\n\nIf `rangeStep` is `null` or if the view contains the scale's corresponding\n[size](size.html) (`width` for `x` scales and `height` for `y` scales), `rangeStep` will\nbe automatically determined to fit the size of the view.\n\n__Default value:__ derived the [scale config](config.html#scale-config)'s\n`textXRangeStep` (`90` by default) for x-scales of `text` marks and `rangeStep` (`21` by\ndefault) for x-scales of other marks and y-scales.\n\n__Warning__: If `rangeStep` is `null` and the cardinality of the scale's domain is higher\nthan `width` or `height`, the rangeStep might become less than one pixel and the mark\nmight not appear correctly."
2845+ "description": "A minimum allowable step size (particularly useful for integer values)."
27552846 },
2756- "round": {
2847+ "nice": {
27572848 "type": "boolean",
2758- "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to\nthe pixel grid.\n\n__Default value:__ `false`."
2759- },
2760- "scheme": {
2761- "$ref": "#/definitions/Scheme",
2762- "description": "A string indicating a color [scheme](scale.html#scheme) name (e.g., `\"category10\"` or\n`\"viridis\"`) or a [scheme parameter object](scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](scale.html#discrete) or\n[discretizing](scale.html#discretizing) scales. Continuous color schemes are intended for\nuse with [sequential](scales.html#sequential) scales.\n\nFor the full list of supported scheme, please refer to the [Vega\nScheme](https://vega.github.io/vega/docs/schemes/#reference) reference."
2849+ "description": "If true (the default), attempts to make the bin boundaries use human-friendly boundaries,\nsuch as multiples of ten."
27632850 },
2764- "type": {
2765- "$ref": "#/definitions/ScaleType",
2766- "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](scale.html#continuous) -- mapping continuous domains to\ncontinuous output ranges ([`\"linear\"`](scale.html#linear), [`\"pow\"`](scale.html#pow),\n[`\"sqrt\"`](scale.html#sqrt), [`\"log\"`](scale.html#log), [`\"time\"`](scale.html#time),\n[`\"utc\"`](scale.html#utc), [`\"sequential\"`](scale.html#sequential)).\n\n2) [**Discrete Scales**](scale.html#discrete) -- mapping discrete domains to discrete\n([`\"ordinal\"`](scale.html#ordinal)) or continuous ([`\"band\"`](scale.html#band) and\n[`\"point\"`](scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](scale.html#discretizing) -- mapping continuous domains to\ndiscrete output ranges ([`\"bin-linear\"`](scale.html#bin-linear) and\n[`\"bin-ordinal\"`](scale.html#bin-ordinal)).\n\n__Default value:__ please see the [scale type table](scale.html#type)."
2851+ "step": {
2852+ "type": "number",
2853+ "description": "An exact step size to use between bins.\n\n__Note:__ If provided, options such as maxbins will be ignored."
27672854 },
2768- "zero": {
2769- "type": "boolean",
2770- "description": "If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned\nand no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`."
2855+ "steps": {
2856+ "type": "array",
2857+ "items": {
2858+ "type": "number"
2859+ },
2860+ "minItems": 1,
2861+ "description": "An array of allowable step sizes to choose from."
27712862 }
27722863 },
27732864 "required": [],
2774- "title": "Scale",
2775- "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
2865+ "title": "BinParams",
2866+ "description": "Binning properties or boolean flag for determining whether to bin data or not."
27762867 },
2777- "DomainClass": {
2868+ "ConditionalPredicateValueDef": {
27782869 "type": "object",
27792870 "additionalProperties": false,
27802871 "properties": {
2781- "field": {
2782- "type": "string",
2783- "description": "The field name to extract selected values for, when a selection is\n[projected](project.html)\nover multiple fields or encodings."
2784- },
2785- "selection": {
2786- "type": "string",
2787- "description": "The name of a selection."
2872+ "test": {
2873+ "$ref": "#/definitions/LogicalOperandPredicate"
27882874 },
2789- "encoding": {
2790- "type": "string",
2791- "description": "The encoding channel to extract selected values for, when a selection is\n[projected](project.html)\nover multiple fields or encodings."
2875+ "value": {
2876+ "$ref": "#/definitions/ConditionValue",
2877+ "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
27922878 }
27932879 },
27942880 "required": [
2795- "selection"
2881+ "test",
2882+ "value"
27962883 ],
2797- "title": "DomainClass"
2884+ "title": "ConditionalPredicateValueDef"
27982885 },
2799- "InterpolateParams": {
2886+ "ConditionalSelectionValueDef": {
28002887 "type": "object",
28012888 "additionalProperties": false,
28022889 "properties": {
2803- "gamma": {
2804- "type": "number"
2890+ "selection": {
2891+ "$ref": "#/definitions/SelectionOperand",
2892+ "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
28052893 },
2806- "type": {
2807- "$ref": "#/definitions/InterpolateParamsType"
2894+ "value": {
2895+ "$ref": "#/definitions/ConditionValue",
2896+ "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
28082897 }
28092898 },
28102899 "required": [
2811- "type"
2900+ "selection",
2901+ "value"
28122902 ],
2813- "title": "InterpolateParams"
2903+ "title": "ConditionalSelectionValueDef"
28142904 },
2815- "NiceClass": {
2905+ "LogicalNotPredicate": {
28162906 "type": "object",
28172907 "additionalProperties": false,
28182908 "properties": {
2819- "interval": {
2820- "type": "string"
2821- },
2822- "step": {
2823- "type": "number"
2909+ "not": {
2910+ "$ref": "#/definitions/LogicalOperandPredicate"
28242911 }
28252912 },
28262913 "required": [
2827- "interval",
2828- "step"
2914+ "not"
28292915 ],
2830- "title": "NiceClass"
2916+ "title": "LogicalNotPredicate"
28312917 },
2832- "SchemeParams": {
2918+ "LogicalAndPredicate": {
28332919 "type": "object",
28342920 "additionalProperties": false,
28352921 "properties": {
2836- "extent": {
2922+ "and": {
28372923 "type": "array",
28382924 "items": {
2839- "type": "number"
2840- },
2841- "description": "For sequential and diverging schemes only, determines the extent of the color range to\nuse. For example `[0.2, 1]` will rescale the color scheme such that color values in the\nrange _[0, 0.2)_ are excluded from the scheme."
2842- },
2843- "name": {
2844- "type": "string",
2845- "description": "A color scheme name for sequential/ordinal scales (e.g., `\"category10\"` or `\"viridis\"`).\n\nFor the full list of supported scheme, please refer to the [Vega\nScheme](https://vega.github.io/vega/docs/schemes/#reference) reference."
2925+ "$ref": "#/definitions/LogicalOperandPredicate"
2926+ }
28462927 }
28472928 },
28482929 "required": [
2849- "name"
2930+ "and"
28502931 ],
2851- "title": "SchemeParams"
2932+ "title": "LogicalAndPredicate"
28522933 },
2853- "SortField": {
2934+ "LogicalOrPredicate": {
28542935 "type": "object",
28552936 "additionalProperties": false,
28562937 "properties": {
2857- "field": {
2858- "$ref": "#/definitions/Field",
2859- "description": "The data [field](field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data\nreference."
2860- },
2861- "op": {
2862- "$ref": "#/definitions/AggregateOp",
2863- "description": "An [aggregate operation](aggregate.html#ops) to perform on the field prior to sorting\n(e.g., `\"count\"`, `\"mean\"` and `\"median\"`).\nThis property is required in cases where the sort field and the data reference field do\nnot match.\nThe input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for\n[aggregate](aggregate.html#ops)."
2864- },
2865- "order": {
2866- "anyOf": [
2867- {
2868- "$ref": "#/definitions/SortEnum"
2869- },
2870- {
2871- "type": "null"
2872- }
2873- ],
2874- "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`.\nSort order for a facet field.\nThis can be `\"ascending\"`, `\"descending\"`."
2938+ "or": {
2939+ "type": "array",
2940+ "items": {
2941+ "$ref": "#/definitions/LogicalOperandPredicate"
2942+ }
28752943 }
28762944 },
28772945 "required": [
2878- "op"
2946+ "or"
28792947 ],
2880- "title": "SortField"
2948+ "title": "LogicalOrPredicate"
28812949 },
2882- "FacetFieldDef": {
2950+ "FieldEqualPredicate": {
28832951 "type": "object",
28842952 "additionalProperties": false,
28852953 "properties": {
2886- "aggregate": {
2887- "$ref": "#/definitions/AggregateOp",
2888- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
2889- },
2890- "bin": {
2891- "$ref": "#/definitions/Bin",
2892- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
2954+ "equal": {
2955+ "$ref": "#/definitions/Equal",
2956+ "description": "The value that the field should be equal to."
28932957 },
28942958 "field": {
2895- "$ref": "#/definitions/Field",
2896- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
2897- },
2898- "header": {
2899- "$ref": "#/definitions/Header",
2900- "description": "An object defining properties of a facet's header."
2901- },
2902- "sort": {
2903- "anyOf": [
2904- {
2905- "$ref": "#/definitions/SortEnum"
2906- },
2907- {
2908- "type": "null"
2909- }
2910- ],
2911- "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`.\nSort order for a facet field.\nThis can be `\"ascending\"`, `\"descending\"`."
2959+ "type": "string",
2960+ "description": "Field to be filtered."
29122961 },
29132962 "timeUnit": {
29142963 "$ref": "#/definitions/TimeUnit",
2915- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
2916- },
2917- "type": {
2918- "$ref": "#/definitions/Type",
2919- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
2964+ "description": "Time unit for the field to be filtered."
29202965 }
29212966 },
29222967 "required": [
2923- "type"
2968+ "equal",
2969+ "field"
29242970 ],
2925- "title": "FacetFieldDef",
2926- "description": "Horizontal facets for trellis plots.\nVertical facets for trellis plots."
2971+ "title": "FieldEqualPredicate"
29272972 },
2928- "Header": {
2973+ "FieldRangePredicate": {
29292974 "type": "object",
29302975 "additionalProperties": false,
29312976 "properties": {
2932- "format": {
2977+ "field": {
29332978 "type": "string",
2934- "description": "The formatting pattern for labels. This is D3's [number format\npattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's\n[time format pattern](https://github.com/d3/d3-time-format#locale_format) for time\nfield.\n\nSee the [format documentation](format.html) for more information.\n\n__Default value:__ derived from [numberFormat](config.html#format) config for\nquantitative fields and from [timeFormat](config.html#format) config for temporal fields."
2979+ "description": "Field to be filtered"
29352980 },
2936- "labelAngle": {
2937- "type": "number",
2938- "minimum": -360,
2939- "maximum": 360,
2940- "description": "The rotation angle of the header labels.\n\n__Default value:__ `0`."
2981+ "range": {
2982+ "type": "array",
2983+ "items": {
2984+ "$ref": "#/definitions/RangeElement"
2985+ },
2986+ "minItems": 2,
2987+ "maxItems": 2,
2988+ "description": "An array of inclusive minimum and maximum values\nfor a field value of a data item to be included in the filtered data."
29412989 },
2942- "title": {
2943- "anyOf": [
2944- {
2945- "type": "null"
2946- },
2947- {
2948- "type": "string"
2949- }
2950- ],
2951- "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function\n(`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the\nfunction is displayed as a part of the title (e.g., `\"Sum of Profit\"`). If the field is\nbinned or has a time unit applied, the applied function will be denoted in parentheses\n(e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is\nsimply the field name.\n\n__Note__: You can customize the default field title format by providing the [`fieldTitle`\nproperty in the [config](config.html) or [`fieldTitle` function via the `compile`\nfunction's options](compile.html#field-title)."
2990+ "timeUnit": {
2991+ "$ref": "#/definitions/TimeUnit",
2992+ "description": "time unit for the field to be filtered."
29522993 }
29532994 },
2954- "required": [],
2955- "title": "Header",
2956- "description": "An object defining properties of a facet's header.\nHeaders of row / column channels for faceted plots."
2995+ "required": [
2996+ "field",
2997+ "range"
2998+ ],
2999+ "title": "FieldRangePredicate"
29573000 },
2958- "FieldDef": {
3001+ "FieldOneOfPredicate": {
29593002 "type": "object",
29603003 "additionalProperties": false,
29613004 "properties": {
2962- "aggregate": {
2963- "$ref": "#/definitions/AggregateOp",
2964- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
2965- },
2966- "bin": {
2967- "$ref": "#/definitions/Bin",
2968- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
2969- },
29703005 "field": {
2971- "$ref": "#/definitions/Field",
2972- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3006+ "type": "string",
3007+ "description": "Field to be filtered"
3008+ },
3009+ "oneOf": {
3010+ "type": "array",
3011+ "items": {
3012+ "$ref": "#/definitions/Equal"
3013+ },
3014+ "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data."
29733015 },
29743016 "timeUnit": {
29753017 "$ref": "#/definitions/TimeUnit",
2976- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
2977- },
2978- "type": {
2979- "$ref": "#/definitions/Type",
2980- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3018+ "description": "time unit for the field to be filtered."
29813019 }
29823020 },
29833021 "required": [
2984- "type"
3022+ "field",
3023+ "oneOf"
29853024 ],
2986- "title": "FieldDef",
2987- "description": "Definition object for a data field, its type and transformation of an encoding channel."
3025+ "title": "FieldOneOfPredicate"
29883026 },
2989- "DefWithCondition": {
3027+ "SelectionPredicate": {
29903028 "type": "object",
29913029 "additionalProperties": false,
29923030 "properties": {
2993- "aggregate": {
2994- "$ref": "#/definitions/AggregateOp",
2995- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
2996- },
2997- "bin": {
2998- "$ref": "#/definitions/Bin",
2999- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3000- },
3001- "condition": {
3002- "$ref": "#/definitions/HrefCondition",
3003- "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value\ndefinitions](encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel.\n\nA field definition or one or more value definition(s) with a selection predicate."
3004- },
3005- "field": {
3006- "$ref": "#/definitions/Field",
3007- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3008- },
3009- "timeUnit": {
3010- "$ref": "#/definitions/TimeUnit",
3011- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3012- },
3013- "type": {
3014- "$ref": "#/definitions/Type",
3015- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3016- },
3017- "value": {
3018- "$ref": "#/definitions/ConditionalValueDefValue",
3019- "description": "A constant value in visual domain."
3031+ "selection": {
3032+ "$ref": "#/definitions/SelectionOperand",
3033+ "description": "Filter using a selection name."
30203034 }
30213035 },
3022- "required": [],
3023- "title": "DefWithCondition",
3024- "description": "A URL to load upon mouse click.\nA FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}\nA ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
3036+ "required": [
3037+ "selection"
3038+ ],
3039+ "title": "SelectionPredicate"
30253040 },
3026- "ConditionalPredicateFieldDefClass": {
3041+ "DateTime": {
30273042 "type": "object",
30283043 "additionalProperties": false,
30293044 "properties": {
3030- "test": {
3031- "$ref": "#/definitions/LogicalOperandPredicate"
3045+ "date": {
3046+ "type": "number",
3047+ "minimum": 1,
3048+ "maximum": 31,
3049+ "description": "Integer value representing the date from 1-31."
30323050 },
3033- "value": {
3034- "$ref": "#/definitions/ConditionalValueDefValue",
3035- "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
3051+ "day": {
3052+ "$ref": "#/definitions/Day",
3053+ "description": "Value representing the day of a week. This can be one of: (1) integer value -- `1`\nrepresents Monday; (2) case-insensitive day name (e.g., `\"Monday\"`); (3)\ncase-insensitive, 3-character short day name (e.g., `\"Mon\"`). <br/> **Warning:** A\nDateTime definition object with `day`** should not be combined with `year`, `quarter`,\n`month`, or `date`."
30363054 },
3037- "selection": {
3038- "$ref": "#/definitions/SelectionOperand",
3039- "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
3055+ "hours": {
3056+ "type": "number",
3057+ "minimum": 0,
3058+ "maximum": 23,
3059+ "description": "Integer value representing the hour of a day from 0-23."
30403060 },
3041- "aggregate": {
3042- "$ref": "#/definitions/AggregateOp",
3043- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3061+ "milliseconds": {
3062+ "type": "number",
3063+ "minimum": 0,
3064+ "maximum": 999,
3065+ "description": "Integer value representing the millisecond segment of time."
30443066 },
3045- "bin": {
3046- "$ref": "#/definitions/Bin",
3047- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3067+ "minutes": {
3068+ "type": "number",
3069+ "minimum": 0,
3070+ "maximum": 59,
3071+ "description": "Integer value representing the minute segment of time from 0-59."
30483072 },
3049- "field": {
3050- "$ref": "#/definitions/Field",
3051- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3073+ "month": {
3074+ "$ref": "#/definitions/Month",
3075+ "description": "One of: (1) integer value representing the month from `1`-`12`. `1` represents January;\n(2) case-insensitive month name (e.g., `\"January\"`); (3) case-insensitive, 3-character\nshort month name (e.g., `\"Jan\"`)."
30523076 },
3053- "timeUnit": {
3054- "$ref": "#/definitions/TimeUnit",
3055- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3077+ "quarter": {
3078+ "type": "number",
3079+ "minimum": 1,
3080+ "maximum": 4,
3081+ "description": "Integer value representing the quarter of the year (from 1-4)."
30563082 },
3057- "type": {
3058- "$ref": "#/definitions/Type",
3059- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3083+ "seconds": {
3084+ "type": "number",
3085+ "minimum": 0,
3086+ "maximum": 59,
3087+ "description": "Integer value representing the second segment (0-59) of a time value"
3088+ },
3089+ "utc": {
3090+ "type": "boolean",
3091+ "description": "A boolean flag indicating if date time is in utc time. If false, the date time is in\nlocal time"
3092+ },
3093+ "year": {
3094+ "type": "number",
3095+ "description": "Integer value representing the year."
30603096 }
30613097 },
30623098 "required": [],
3063- "title": "ConditionalPredicateFieldDefClass"
3099+ "title": "DateTime",
3100+ "description": "Object for defining datetime in Vega-Lite Filter.\nIf both month and quarter are provided, month has higher precedence.\n`day` cannot be combined with other date.\nWe accept string for month and day names."
30643101 },
3065- "OrderFieldDef": {
3102+ "SelectionNot": {
30663103 "type": "object",
30673104 "additionalProperties": false,
30683105 "properties": {
3069- "aggregate": {
3070- "$ref": "#/definitions/AggregateOp",
3071- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3072- },
3073- "bin": {
3074- "$ref": "#/definitions/Bin",
3075- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3076- },
3077- "field": {
3078- "$ref": "#/definitions/Field",
3079- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3080- },
3081- "sort": {
3082- "anyOf": [
3083- {
3084- "$ref": "#/definitions/SortEnum"
3085- },
3086- {
3087- "type": "null"
3088- }
3089- ],
3090- "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`.\nSort order for a facet field.\nThis can be `\"ascending\"`, `\"descending\"`."
3091- },
3092- "timeUnit": {
3093- "$ref": "#/definitions/TimeUnit",
3094- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3095- },
3096- "type": {
3097- "$ref": "#/definitions/Type",
3098- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3106+ "not": {
3107+ "$ref": "#/definitions/SelectionOperand"
30993108 }
31003109 },
31013110 "required": [
3102- "type"
3111+ "not"
31033112 ],
3104- "title": "OrderFieldDef"
3113+ "title": "SelectionNot"
31053114 },
3106- "TextDefWithCondition": {
3115+ "SelectionAnd": {
31073116 "type": "object",
31083117 "additionalProperties": false,
31093118 "properties": {
3110- "aggregate": {
3111- "$ref": "#/definitions/AggregateOp",
3112- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3113- },
3114- "bin": {
3115- "$ref": "#/definitions/Bin",
3116- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3117- },
3118- "condition": {
3119- "$ref": "#/definitions/TextCondition",
3120- "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value\ndefinitions](encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel.\n\nA field definition or one or more value definition(s) with a selection predicate."
3121- },
3122- "field": {
3123- "$ref": "#/definitions/Field",
3124- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3125- },
3126- "format": {
3127- "type": "string",
3128- "description": "The [formatting pattern](format.html) for a text field. If not defined, this will be\ndetermined automatically."
3129- },
3130- "timeUnit": {
3131- "$ref": "#/definitions/TimeUnit",
3132- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3133- },
3134- "type": {
3135- "$ref": "#/definitions/Type",
3136- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3137- },
3138- "value": {
3139- "$ref": "#/definitions/ConditionalValueDefValue",
3140- "description": "A constant value in visual domain."
3119+ "and": {
3120+ "type": "array",
3121+ "items": {
3122+ "$ref": "#/definitions/SelectionOperand"
3123+ }
31413124 }
31423125 },
3143- "required": [],
3144- "title": "TextDefWithCondition",
3145- "description": "Text of the `text` mark.\nThe tooltip text to show upon mouse hover.\nA FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}\nA ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
3126+ "required": [
3127+ "and"
3128+ ],
3129+ "title": "SelectionAnd"
31463130 },
3147- "ConditionalPredicateTextFieldDefClass": {
3131+ "SelectionOr": {
31483132 "type": "object",
31493133 "additionalProperties": false,
31503134 "properties": {
3151- "test": {
3152- "$ref": "#/definitions/LogicalOperandPredicate"
3153- },
3154- "value": {
3155- "$ref": "#/definitions/ConditionalValueDefValue",
3156- "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
3157- },
3158- "selection": {
3159- "$ref": "#/definitions/SelectionOperand",
3160- "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
3161- },
3162- "aggregate": {
3163- "$ref": "#/definitions/AggregateOp",
3164- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3165- },
3166- "bin": {
3167- "$ref": "#/definitions/Bin",
3168- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3169- },
3170- "field": {
3171- "$ref": "#/definitions/Field",
3172- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3173- },
3174- "format": {
3175- "type": "string",
3176- "description": "The [formatting pattern](format.html) for a text field. If not defined, this will be\ndetermined automatically."
3177- },
3178- "timeUnit": {
3179- "$ref": "#/definitions/TimeUnit",
3180- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3181- },
3182- "type": {
3183- "$ref": "#/definitions/Type",
3184- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3135+ "or": {
3136+ "type": "array",
3137+ "items": {
3138+ "$ref": "#/definitions/SelectionOperand"
3139+ }
31853140 }
31863141 },
3187- "required": [],
3188- "title": "ConditionalPredicateTextFieldDefClass"
3142+ "required": [
3143+ "or"
3144+ ],
3145+ "title": "SelectionOr"
31893146 },
3190- "XClass": {
3147+ "RepeatRef": {
31913148 "type": "object",
31923149 "additionalProperties": false,
31933150 "properties": {
3194- "aggregate": {
3195- "$ref": "#/definitions/AggregateOp",
3196- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3197- },
3198- "axis": {
3199- "anyOf": [
3200- {
3201- "$ref": "#/definitions/Axis"
3202- },
3203- {
3204- "type": "null"
3205- }
3206- ],
3207- "description": "An object defining properties of axis's gridlines, ticks and labels.\nIf `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](axis.html) are applied."
3208- },
3209- "bin": {
3210- "$ref": "#/definitions/Bin",
3211- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3212- },
3213- "field": {
3214- "$ref": "#/definitions/Field",
3215- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3151+ "repeat": {
3152+ "$ref": "#/definitions/RepeatEnum"
3153+ }
3154+ },
3155+ "required": [
3156+ "repeat"
3157+ ],
3158+ "title": "RepeatRef",
3159+ "description": "Reference to a repeated value."
3160+ },
3161+ "Legend": {
3162+ "type": "object",
3163+ "additionalProperties": false,
3164+ "properties": {
3165+ "entryPadding": {
3166+ "type": "number",
3167+ "description": "Padding (in pixels) between legend entries in a symbol legend."
32163168 },
3217- "scale": {
3218- "$ref": "#/definitions/Scale",
3219- "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
3169+ "format": {
3170+ "type": "string",
3171+ "description": "The formatting pattern for labels. This is D3's [number format\npattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's\n[time format pattern](https://github.com/d3/d3-time-format#locale_format) for time\nfield.\n\nSee the [format documentation](format.html) for more information.\n\n__Default value:__ derived from [numberFormat](config.html#format) config for\nquantitative fields and from [timeFormat](config.html#format) config for temporal fields."
32203172 },
3221- "sort": {
3222- "$ref": "#/definitions/SortUnion",
3223- "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
3173+ "offset": {
3174+ "type": "number",
3175+ "description": "The offset, in pixels, by which to displace the legend from the edge of the enclosing\ngroup or data rectangle.\n\n__Default value:__ `0`"
32243176 },
3225- "stack": {
3177+ "orient": {
3178+ "$ref": "#/definitions/LegendOrient",
3179+ "description": "The orientation of the legend, which determines how the legend is positioned within the\nscene. One of \"left\", \"right\", \"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\",\n\"none\".\n\n__Default value:__ `\"right\"`"
3180+ },
3181+ "padding": {
3182+ "type": "number",
3183+ "description": "The padding, in pixels, between the legend and axis."
3184+ },
3185+ "tickCount": {
3186+ "type": "number",
3187+ "description": "The desired number of tick values for quantitative legends."
3188+ },
3189+ "title": {
32263190 "anyOf": [
32273191 {
3228- "$ref": "#/definitions/StackOffset"
3192+ "type": "null"
32293193 },
32303194 {
3231- "type": "null"
3195+ "type": "string"
32323196 }
32333197 ],
3234- "description": "Type of stacking offset if the field should be stacked.\n`stack` is only applicable for `x` and `y` channels with continuous domains.\nFor example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n\n- `\"zero\"`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](stack.html#bar) and [area](stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](stack.html#normalized). <br/>\n- `\"center\"` - stacking with center baseline (for [streamgraph](stack.html#streamgraph)).\n- `null` - No-stacking. This will produce layered [bar](stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true:\n\n1. The mark is `bar` or `area`;\n2. The stacked measure channel (x or y) has a linear scale;\n3. At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default."
3235- },
3236- "timeUnit": {
3237- "$ref": "#/definitions/TimeUnit",
3238- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3198+ "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function\n(`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the\nfunction is displayed as a part of the title (e.g., `\"Sum of Profit\"`). If the field is\nbinned or has a time unit applied, the applied function will be denoted in parentheses\n(e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is\nsimply the field name.\n\n__Note__: You can customize the default field title format by providing the [`fieldTitle`\nproperty in the [config](config.html) or [`fieldTitle` function via the `compile`\nfunction's options](compile.html#field-title)."
32393199 },
32403200 "type": {
3241- "$ref": "#/definitions/Type",
3242- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3201+ "$ref": "#/definitions/LegendType",
3202+ "description": "The type of the legend. Use `\"symbol\"` to create a discrete legend and `\"gradient\"` for a\ncontinuous color gradient.\n\n__Default value:__ `\"gradient\"` for non-binned quantitative fields and temporal fields;\n`\"symbol\"` otherwise."
32433203 },
3244- "value": {
3245- "$ref": "#/definitions/ConditionalValueDefValue",
3246- "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
3204+ "values": {
3205+ "type": "array",
3206+ "items": {
3207+ "$ref": "#/definitions/LegendValue"
3208+ },
3209+ "description": "Explicitly set the visible legend values."
3210+ },
3211+ "zindex": {
3212+ "type": "number",
3213+ "minimum": 0,
3214+ "description": "A non-positive integer indicating z-index of the legend.\nIf zindex is 0, legend should be drawn behind all chart elements.\nTo put them in front, use zindex = 1."
32473215 }
32483216 },
32493217 "required": [],
3250- "title": "XClass",
3251- "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\nY coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\nDefinition object for a constant value of an encoding channel."
3218+ "title": "Legend",
3219+ "description": "Properties of a legend or boolean flag for determining whether to show it."
32523220 },
3253- "Axis": {
3221+ "Scale": {
32543222 "type": "object",
32553223 "additionalProperties": false,
32563224 "properties": {
3257- "domain": {
3258- "type": "boolean",
3259- "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of\nthe axis.\n\n__Default value:__ `true`"
3260- },
3261- "format": {
3262- "type": "string",
3263- "description": "The formatting pattern for labels. This is D3's [number format\npattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's\n[time format pattern](https://github.com/d3/d3-time-format#locale_format) for time\nfield.\n\nSee the [format documentation](format.html) for more information.\n\n__Default value:__ derived from [numberFormat](config.html#format) config for\nquantitative fields and from [timeFormat](config.html#format) config for temporal fields."
3264- },
3265- "grid": {
3266- "type": "boolean",
3267- "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](scale.html#continuous) that are not\nbinned; otherwise, `false`."
3268- },
3269- "labelAngle": {
3270- "type": "number",
3271- "minimum": -360,
3272- "maximum": 360,
3273- "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise."
3274- },
3275- "labelBound": {
3276- "$ref": "#/definitions/Label",
3277- "description": "Indicates if labels should be hidden if they exceed the axis range. If `false `(the\ndefault) no bounds overlap analysis is performed. If `true`, labels will be hidden if\nthey exceed the axis range by more than 1 pixel. If this property is a number, it\nspecifies the pixel tolerance: the maximum amount by which a label bounding box may\nexceed the axis range.\n\n__Default value:__ `false`."
3278- },
3279- "labelFlush": {
3280- "$ref": "#/definitions/Label",
3281- "description": "Indicates if the first and last axis labels should be aligned flush with the scale range.\nFlush alignment for a horizontal axis will left-align the first label and right-align the\nlast label. For vertical axes, bottom and top text baselines are applied instead. If this\nproperty is a number, it also indicates the number of pixels by which to offset the first\nand last labels; for example, a value of 2 will flush-align the first and last labels and\nalso push them 2 pixels outward from the center of the axis. The additional adjustment\ncan sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`."
3282- },
3283- "labelOverlap": {
3284- "$ref": "#/definitions/LabelOverlapUnion",
3285- "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no\noverlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing\nevery other label is used (this works well for standard linear axes). If set to\n`\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps\nwith the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log\nscales; otherwise `false`."
3286- },
3287- "labelPadding": {
3225+ "base": {
32883226 "type": "number",
3289- "description": "The padding, in pixels, between axis and text labels."
3227+ "description": "The logarithm base of the `log` scale (default `10`)."
32903228 },
3291- "labels": {
3229+ "clamp": {
32923230 "type": "boolean",
3293- "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`."
3231+ "description": "If `true`, values that exceed the data domain are clamped to either the minimum or\nmaximum range value\n\n__Default value:__ derived from the [scale config](config.html#scale-config)'s `clamp`\n(`true` by default)."
32943232 },
3295- "maxExtent": {
3296- "type": "number",
3297- "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a\nmaximum offset value for axis titles.\n\n__Default value:__ `undefined`."
3233+ "domain": {
3234+ "$ref": "#/definitions/DomainUnion",
3235+ "description": "Customized domain values.\n\nFor _quantitative_ fields, `domain` can take the form of a two-element array with minimum\nand maximum values. [Piecewise scales](scale.html#piecewise) can be created by providing\na `domain` with more than two entries.\nIf the input field is aggregated, `domain` can also be a string value `\"unaggregated\"`,\nindicating that the domain should include the raw data values prior to the aggregation.\n\nFor _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in\nthe form of either timestamps or the [DateTime definition objects](types.html#datetime).\n\nFor _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input\nvalues.\n\nThe `selection` property can be used to [interactively\ndetermine](selection.html#scale-domains) the scale domain."
32983236 },
3299- "minExtent": {
3237+ "exponent": {
33003238 "type": "number",
3301- "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a\nminimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis."
3239+ "description": "The exponent of the `pow` scale."
33023240 },
3303- "offset": {
3304- "type": "number",
3305- "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group\nor data rectangle.\n\n__Default value:__ derived from the [axis config](config.html#facet-scale-config)'s\n`offset` (`0` by default)"
3241+ "interpolate": {
3242+ "$ref": "#/definitions/InterpolateUnion",
3243+ "description": "The interpolation method for range values. By default, a general interpolator for\nnumbers, dates, strings and colors (in RGB space) is used. For color ranges, this\nproperty allows interpolation in alternative color spaces. Legal values include `rgb`,\n`hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long'\nvariants use longer paths in polar coordinate spaces). If object-valued, this property\naccepts an object with a string-valued _type_ property and an optional numeric _gamma_\nproperty applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate\ndocumentation](https://github.com/d3/d3-interpolate).\n\n__Note:__ Sequential scales do not support `interpolate` as they have a fixed\ninterpolator. Since Vega-Lite uses sequential scales for quantitative fields by default,\nyou have to set the scale `type` to other quantitative scale type such as `\"linear\"` to\ncustomize `interpolate`."
33063244 },
3307- "orient": {
3308- "$ref": "#/definitions/TitleOrient",
3309- "description": "The orientation of the axis. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`. The\norientation can be used to further specialize the axis type (e.g., a y axis oriented for\nthe right edge of the chart).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes."
3245+ "nice": {
3246+ "$ref": "#/definitions/NiceUnion",
3247+ "description": "Extending the domain so that it starts and ends on nice round values. This method\ntypically modifies the scale’s domain, and may only extend the bounds to the nearest\nround value. Nicing is useful if the domain is computed from data and may be irregular.\nFor example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2,\n1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number.\nIf `nice` is a number, it will represent a desired tick count. This allows greater\ncontrol over the step size used to extend the bounds, guaranteeing that the returned\nticks will exactly cover the domain.\n\nFor temporal fields with time and utc scales, the `nice` value can be a string indicating\nthe desired time interval. Legal values are `\"millisecond\"`, `\"second\"`, `\"minute\"`,\n`\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, `time` and `utc`\nscales can accept an object-valued interval specifier of the form `{\"interval\": \"month\",\n\"step\": 3}`, which includes a desired number of interval steps. Here, the domain would\nsnap to quarter (Jan, Apr, Jul, Oct) boundaries.\n\n__Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise."
33103248 },
3311- "position": {
3249+ "padding": {
33123250 "type": "number",
3313- "description": "The anchor position of the axis in pixels. For x-axis with top or bottom orientation,\nthis sets the axis group x coordinate. For y-axis with left or right orientation, this\nsets the axis group y coordinate.\n\n__Default value__: `0`"
3251+ "minimum": 0,
3252+ "description": "For _[continuous](scale.html#continuous)_ scales, expands the scale domain to accommodate\nthe specified number of pixels on each of the scale range. The scale range must represent\npixels for this parameter to function as intended. Padding adjustment is performed prior\nto all other adjustments, including the effects of the zero, nice, domainMin, and\ndomainMax properties.\n\nFor _[band](scale.html#band)_ scales, shortcut for setting `paddingInner` and\n`paddingOuter` to the same value.\n\nFor _[point](scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale\nconfig](scale.html#config)'s `continuousPadding`.\nFor _band and point_ scales, see `paddingInner` and `paddingOuter`."
33143253 },
3315- "tickCount": {
3254+ "paddingInner": {
33163255 "type": "number",
3317- "description": "A desired number of ticks, for axes visualizing quantitative scales. The resulting number\nmay be different so that values are \"nice\" (multiples of 2, 5, 10) and lie within the\nunderlying scale's range."
3318- },
3319- "ticks": {
3320- "type": "boolean",
3321- "description": "Boolean value that determines whether the axis should include ticks."
3256+ "minimum": 0,
3257+ "maximum": 1,
3258+ "description": "The inner padding (spacing) within each band step of band scales, as a fraction of the\nstep size. This value must lie in the range [0,1].\n\nFor point scale, this property is invalid as point scales do not have internal band\nwidths (only step sizes between bands).\n\n__Default value:__ derived from the [scale config](scale.html#config)'s\n`bandPaddingInner`."
33223259 },
3323- "tickSize": {
3260+ "paddingOuter": {
33243261 "type": "number",
33253262 "minimum": 0,
3326- "description": "The size in pixels of axis ticks."
3263+ "maximum": 1,
3264+ "description": "The outer padding (spacing) at the ends of the range of band and point scales,\nas a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](scale.html#config)'s\n`bandPaddingOuter` for band scales and `pointPadding` for point scales."
33273265 },
3328- "title": {
3266+ "range": {
3267+ "$ref": "#/definitions/ScaleRange",
3268+ "description": "The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](scale.html#range-config) (e.g.,\nexample, `\"symbol\"`, or `\"diverging\"`).\n\n- For [continuous scales](scale.html#continuous), two-element array indicating minimum\nand maximum values, or an array with more than two entries for specifying a [piecewise\nscale](scale.html#piecewise).\n\n- For [discrete](scale.html#discrete) and [discretizing](scale.html#discretizing) scales,\nan array of desired output values.\n\n__Notes:__\n\n1) For [sequential](scale.html#sequential), [ordinal](scale.html#ordinal), and\ndiscretizing color scales, you can also specify a color [`scheme`](scale.html#scheme)\ninstead of `range`.\n\n2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be\ncustomized via the view's corresponding [size](size.html) (`width` and `height`) or via\n[range steps and paddings properties](#range-step) for [band](#band) and [point](#point)\nscales."
3269+ },
3270+ "rangeStep": {
33293271 "anyOf": [
33303272 {
3331- "type": "null"
3273+ "type": "number",
3274+ "minimum": 0
33323275 },
33333276 {
3334- "type": "string"
3277+ "type": "null"
33353278 }
33363279 ],
3337- "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function\n(`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the\nfunction is displayed as a part of the title (e.g., `\"Sum of Profit\"`). If the field is\nbinned or has a time unit applied, the applied function will be denoted in parentheses\n(e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is\nsimply the field name.\n\n__Note__: You can customize the default field title format by providing the [`fieldTitle`\nproperty in the [config](config.html) or [`fieldTitle` function via the `compile`\nfunction's options](compile.html#field-title)."
3280+ "description": "The distance between the starts of adjacent bands or points in [band](scale.html#band)\nand [point](scale.html#point) scales.\n\nIf `rangeStep` is `null` or if the view contains the scale's corresponding\n[size](size.html) (`width` for `x` scales and `height` for `y` scales), `rangeStep` will\nbe automatically determined to fit the size of the view.\n\n__Default value:__ derived the [scale config](config.html#scale-config)'s\n`textXRangeStep` (`90` by default) for x-scales of `text` marks and `rangeStep` (`21` by\ndefault) for x-scales of other marks and y-scales.\n\n__Warning__: If `rangeStep` is `null` and the cardinality of the scale's domain is higher\nthan `width` or `height`, the rangeStep might become less than one pixel and the mark\nmight not appear correctly."
33383281 },
3339- "titleMaxLength": {
3340- "type": "number",
3341- "description": "Max length for axis title if the title is automatically generated from the field's\ndescription."
3282+ "round": {
3283+ "type": "boolean",
3284+ "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to\nthe pixel grid.\n\n__Default value:__ `false`."
3285+ },
3286+ "scheme": {
3287+ "$ref": "#/definitions/Scheme",
3288+ "description": "A string indicating a color [scheme](scale.html#scheme) name (e.g., `\"category10\"` or\n`\"viridis\"`) or a [scheme parameter object](scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](scale.html#discrete) or\n[discretizing](scale.html#discretizing) scales. Continuous color schemes are intended for\nuse with [sequential](scales.html#sequential) scales.\n\nFor the full list of supported scheme, please refer to the [Vega\nScheme](https://vega.github.io/vega/docs/schemes/#reference) reference."
3289+ },
3290+ "type": {
3291+ "$ref": "#/definitions/ScaleType",
3292+ "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](scale.html#continuous) -- mapping continuous domains to\ncontinuous output ranges ([`\"linear\"`](scale.html#linear), [`\"pow\"`](scale.html#pow),\n[`\"sqrt\"`](scale.html#sqrt), [`\"log\"`](scale.html#log), [`\"time\"`](scale.html#time),\n[`\"utc\"`](scale.html#utc), [`\"sequential\"`](scale.html#sequential)).\n\n2) [**Discrete Scales**](scale.html#discrete) -- mapping discrete domains to discrete\n([`\"ordinal\"`](scale.html#ordinal)) or continuous ([`\"band\"`](scale.html#band) and\n[`\"point\"`](scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](scale.html#discretizing) -- mapping continuous domains to\ndiscrete output ranges ([`\"bin-linear\"`](scale.html#bin-linear) and\n[`\"bin-ordinal\"`](scale.html#bin-ordinal)).\n\n__Default value:__ please see the [scale type table](scale.html#type)."
3293+ },
3294+ "zero": {
3295+ "type": "boolean",
3296+ "description": "If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned\nand no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`."
3297+ }
3298+ },
3299+ "required": [],
3300+ "title": "Scale",
3301+ "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
3302+ },
3303+ "PurpleSelectionDomain": {
3304+ "type": "object",
3305+ "additionalProperties": false,
3306+ "properties": {
3307+ "field": {
3308+ "type": "string",
3309+ "description": "The field name to extract selected values for, when a selection is\n[projected](project.html)\nover multiple fields or encodings."
3310+ },
3311+ "selection": {
3312+ "type": "string",
3313+ "description": "The name of a selection."
3314+ }
3315+ },
3316+ "required": [
3317+ "selection"
3318+ ],
3319+ "title": "PurpleSelectionDomain"
3320+ },
3321+ "FluffySelectionDomain": {
3322+ "type": "object",
3323+ "additionalProperties": false,
3324+ "properties": {
3325+ "encoding": {
3326+ "type": "string",
3327+ "description": "The encoding channel to extract selected values for, when a selection is\n[projected](project.html)\nover multiple fields or encodings."
3328+ },
3329+ "selection": {
3330+ "type": "string",
3331+ "description": "The name of a selection."
3332+ }
3333+ },
3334+ "required": [
3335+ "selection"
3336+ ],
3337+ "title": "FluffySelectionDomain"
3338+ },
3339+ "InterpolateParams": {
3340+ "type": "object",
3341+ "additionalProperties": false,
3342+ "properties": {
3343+ "gamma": {
3344+ "type": "number"
3345+ },
3346+ "type": {
3347+ "$ref": "#/definitions/InterpolateParamsType"
3348+ }
3349+ },
3350+ "required": [
3351+ "type"
3352+ ],
3353+ "title": "InterpolateParams"
3354+ },
3355+ "NiceClass": {
3356+ "type": "object",
3357+ "additionalProperties": false,
3358+ "properties": {
3359+ "interval": {
3360+ "type": "string"
3361+ },
3362+ "step": {
3363+ "type": "number"
3364+ }
3365+ },
3366+ "required": [
3367+ "interval",
3368+ "step"
3369+ ],
3370+ "title": "NiceClass"
3371+ },
3372+ "SchemeParams": {
3373+ "type": "object",
3374+ "additionalProperties": false,
3375+ "properties": {
3376+ "extent": {
3377+ "type": "array",
3378+ "items": {
3379+ "type": "number"
3380+ },
3381+ "description": "For sequential and diverging schemes only, determines the extent of the color range to\nuse. For example `[0.2, 1]` will rescale the color scheme such that color values in the\nrange _[0, 0.2)_ are excluded from the scheme."
3382+ },
3383+ "name": {
3384+ "type": "string",
3385+ "description": "A color scheme name for sequential/ordinal scales (e.g., `\"category10\"` or `\"viridis\"`).\n\nFor the full list of supported scheme, please refer to the [Vega\nScheme](https://vega.github.io/vega/docs/schemes/#reference) reference."
3386+ }
3387+ },
3388+ "required": [
3389+ "name"
3390+ ],
3391+ "title": "SchemeParams"
3392+ },
3393+ "SortField": {
3394+ "type": "object",
3395+ "additionalProperties": false,
3396+ "properties": {
3397+ "field": {
3398+ "$ref": "#/definitions/Field",
3399+ "description": "The data [field](field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data\nreference."
3400+ },
3401+ "op": {
3402+ "$ref": "#/definitions/AggregateOp",
3403+ "description": "An [aggregate operation](aggregate.html#ops) to perform on the field prior to sorting\n(e.g., `\"count\"`, `\"mean\"` and `\"median\"`).\nThis property is required in cases where the sort field and the data reference field do\nnot match.\nThe input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for\n[aggregate](aggregate.html#ops)."
3404+ },
3405+ "order": {
3406+ "anyOf": [
3407+ {
3408+ "$ref": "#/definitions/SortOrderEnum"
3409+ },
3410+ {
3411+ "type": "null"
3412+ }
3413+ ],
3414+ "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`.\nSort order for a facet field.\nThis can be `\"ascending\"`, `\"descending\"`."
3415+ }
3416+ },
3417+ "required": [
3418+ "op"
3419+ ],
3420+ "title": "SortField"
3421+ },
3422+ "ConditionalPredicateMarkPropFieldDef": {
3423+ "type": "object",
3424+ "additionalProperties": false,
3425+ "properties": {
3426+ "aggregate": {
3427+ "$ref": "#/definitions/AggregateOp",
3428+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3429+ },
3430+ "bin": {
3431+ "$ref": "#/definitions/Bin",
3432+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3433+ },
3434+ "field": {
3435+ "$ref": "#/definitions/Field",
3436+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3437+ },
3438+ "legend": {
3439+ "anyOf": [
3440+ {
3441+ "$ref": "#/definitions/Legend"
3442+ },
3443+ {
3444+ "type": "null"
3445+ }
3446+ ],
3447+ "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](legend.html) are applied."
3448+ },
3449+ "scale": {
3450+ "$ref": "#/definitions/Scale",
3451+ "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
3452+ },
3453+ "sort": {
3454+ "$ref": "#/definitions/SortUnion",
3455+ "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
3456+ },
3457+ "test": {
3458+ "$ref": "#/definitions/LogicalOperandPredicate"
3459+ },
3460+ "timeUnit": {
3461+ "$ref": "#/definitions/TimeUnit",
3462+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3463+ },
3464+ "type": {
3465+ "$ref": "#/definitions/Type",
3466+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3467+ }
3468+ },
3469+ "required": [
3470+ "test",
3471+ "type"
3472+ ],
3473+ "title": "ConditionalPredicateMarkPropFieldDef"
3474+ },
3475+ "ConditionalSelectionMarkPropFieldDef": {
3476+ "type": "object",
3477+ "additionalProperties": false,
3478+ "properties": {
3479+ "aggregate": {
3480+ "$ref": "#/definitions/AggregateOp",
3481+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3482+ },
3483+ "bin": {
3484+ "$ref": "#/definitions/Bin",
3485+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3486+ },
3487+ "field": {
3488+ "$ref": "#/definitions/Field",
3489+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3490+ },
3491+ "legend": {
3492+ "anyOf": [
3493+ {
3494+ "$ref": "#/definitions/Legend"
3495+ },
3496+ {
3497+ "type": "null"
3498+ }
3499+ ],
3500+ "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](legend.html) are applied."
3501+ },
3502+ "scale": {
3503+ "$ref": "#/definitions/Scale",
3504+ "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
3505+ },
3506+ "selection": {
3507+ "$ref": "#/definitions/SelectionOperand",
3508+ "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
3509+ },
3510+ "sort": {
3511+ "$ref": "#/definitions/SortUnion",
3512+ "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
3513+ },
3514+ "timeUnit": {
3515+ "$ref": "#/definitions/TimeUnit",
3516+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3517+ },
3518+ "type": {
3519+ "$ref": "#/definitions/Type",
3520+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3521+ }
3522+ },
3523+ "required": [
3524+ "selection",
3525+ "type"
3526+ ],
3527+ "title": "ConditionalSelectionMarkPropFieldDef"
3528+ },
3529+ "FacetFieldDef": {
3530+ "type": "object",
3531+ "additionalProperties": false,
3532+ "properties": {
3533+ "aggregate": {
3534+ "$ref": "#/definitions/AggregateOp",
3535+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3536+ },
3537+ "bin": {
3538+ "$ref": "#/definitions/Bin",
3539+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3540+ },
3541+ "field": {
3542+ "$ref": "#/definitions/Field",
3543+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3544+ },
3545+ "header": {
3546+ "$ref": "#/definitions/Header",
3547+ "description": "An object defining properties of a facet's header."
3548+ },
3549+ "sort": {
3550+ "anyOf": [
3551+ {
3552+ "$ref": "#/definitions/SortOrderEnum"
3553+ },
3554+ {
3555+ "type": "null"
3556+ }
3557+ ],
3558+ "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`.\nSort order for a facet field.\nThis can be `\"ascending\"`, `\"descending\"`."
3559+ },
3560+ "timeUnit": {
3561+ "$ref": "#/definitions/TimeUnit",
3562+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3563+ },
3564+ "type": {
3565+ "$ref": "#/definitions/Type",
3566+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3567+ }
3568+ },
3569+ "required": [
3570+ "type"
3571+ ],
3572+ "title": "FacetFieldDef",
3573+ "description": "Horizontal facets for trellis plots.\nVertical facets for trellis plots."
3574+ },
3575+ "Header": {
3576+ "type": "object",
3577+ "additionalProperties": false,
3578+ "properties": {
3579+ "format": {
3580+ "type": "string",
3581+ "description": "The formatting pattern for labels. This is D3's [number format\npattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's\n[time format pattern](https://github.com/d3/d3-time-format#locale_format) for time\nfield.\n\nSee the [format documentation](format.html) for more information.\n\n__Default value:__ derived from [numberFormat](config.html#format) config for\nquantitative fields and from [timeFormat](config.html#format) config for temporal fields."
3582+ },
3583+ "labelAngle": {
3584+ "type": "number",
3585+ "minimum": -360,
3586+ "maximum": 360,
3587+ "description": "The rotation angle of the header labels.\n\n__Default value:__ `0`."
3588+ },
3589+ "title": {
3590+ "anyOf": [
3591+ {
3592+ "type": "null"
3593+ },
3594+ {
3595+ "type": "string"
3596+ }
3597+ ],
3598+ "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function\n(`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the\nfunction is displayed as a part of the title (e.g., `\"Sum of Profit\"`). If the field is\nbinned or has a time unit applied, the applied function will be denoted in parentheses\n(e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is\nsimply the field name.\n\n__Note__: You can customize the default field title format by providing the [`fieldTitle`\nproperty in the [config](config.html) or [`fieldTitle` function via the `compile`\nfunction's options](compile.html#field-title)."
3599+ }
3600+ },
3601+ "required": [],
3602+ "title": "Header",
3603+ "description": "An object defining properties of a facet's header.\nHeaders of row / column channels for faceted plots."
3604+ },
3605+ "FieldDef": {
3606+ "type": "object",
3607+ "additionalProperties": false,
3608+ "properties": {
3609+ "aggregate": {
3610+ "$ref": "#/definitions/AggregateOp",
3611+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3612+ },
3613+ "bin": {
3614+ "$ref": "#/definitions/Bin",
3615+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3616+ },
3617+ "field": {
3618+ "$ref": "#/definitions/Field",
3619+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3620+ },
3621+ "timeUnit": {
3622+ "$ref": "#/definitions/TimeUnit",
3623+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3624+ },
3625+ "type": {
3626+ "$ref": "#/definitions/Type",
3627+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3628+ }
3629+ },
3630+ "required": [
3631+ "type"
3632+ ],
3633+ "title": "FieldDef",
3634+ "description": "Definition object for a data field, its type and transformation of an encoding channel."
3635+ },
3636+ "FieldDefWithCondition": {
3637+ "type": "object",
3638+ "additionalProperties": false,
3639+ "properties": {
3640+ "aggregate": {
3641+ "$ref": "#/definitions/AggregateOp",
3642+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3643+ },
3644+ "bin": {
3645+ "$ref": "#/definitions/Bin",
3646+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3647+ },
3648+ "condition": {
3649+ "$ref": "#/definitions/ConditionUnion",
3650+ "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value\ndefinitions](encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel."
3651+ },
3652+ "field": {
3653+ "$ref": "#/definitions/Field",
3654+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3655+ },
3656+ "timeUnit": {
3657+ "$ref": "#/definitions/TimeUnit",
3658+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3659+ },
3660+ "type": {
3661+ "$ref": "#/definitions/Type",
3662+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3663+ }
3664+ },
3665+ "required": [
3666+ "type"
3667+ ],
3668+ "title": "FieldDefWithCondition",
3669+ "description": "A FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}"
3670+ },
3671+ "ValueDefWithCondition": {
3672+ "type": "object",
3673+ "additionalProperties": false,
3674+ "properties": {
3675+ "condition": {
3676+ "$ref": "#/definitions/HrefCondition",
3677+ "description": "A field definition or one or more value definition(s) with a selection predicate."
3678+ },
3679+ "value": {
3680+ "$ref": "#/definitions/ConditionValue",
3681+ "description": "A constant value in visual domain."
3682+ }
3683+ },
3684+ "required": [],
3685+ "title": "ValueDefWithCondition",
3686+ "description": "A ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
3687+ },
3688+ "ConditionalPredicateFieldDef": {
3689+ "type": "object",
3690+ "additionalProperties": false,
3691+ "properties": {
3692+ "aggregate": {
3693+ "$ref": "#/definitions/AggregateOp",
3694+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3695+ },
3696+ "bin": {
3697+ "$ref": "#/definitions/Bin",
3698+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3699+ },
3700+ "field": {
3701+ "$ref": "#/definitions/Field",
3702+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3703+ },
3704+ "test": {
3705+ "$ref": "#/definitions/LogicalOperandPredicate"
3706+ },
3707+ "timeUnit": {
3708+ "$ref": "#/definitions/TimeUnit",
3709+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3710+ },
3711+ "type": {
3712+ "$ref": "#/definitions/Type",
3713+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3714+ }
3715+ },
3716+ "required": [
3717+ "test",
3718+ "type"
3719+ ],
3720+ "title": "ConditionalPredicateFieldDef"
3721+ },
3722+ "ConditionalSelectionFieldDef": {
3723+ "type": "object",
3724+ "additionalProperties": false,
3725+ "properties": {
3726+ "aggregate": {
3727+ "$ref": "#/definitions/AggregateOp",
3728+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3729+ },
3730+ "bin": {
3731+ "$ref": "#/definitions/Bin",
3732+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3733+ },
3734+ "field": {
3735+ "$ref": "#/definitions/Field",
3736+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3737+ },
3738+ "selection": {
3739+ "$ref": "#/definitions/SelectionOperand",
3740+ "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
3741+ },
3742+ "timeUnit": {
3743+ "$ref": "#/definitions/TimeUnit",
3744+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3745+ },
3746+ "type": {
3747+ "$ref": "#/definitions/Type",
3748+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3749+ }
3750+ },
3751+ "required": [
3752+ "selection",
3753+ "type"
3754+ ],
3755+ "title": "ConditionalSelectionFieldDef"
3756+ },
3757+ "OrderFieldDef": {
3758+ "type": "object",
3759+ "additionalProperties": false,
3760+ "properties": {
3761+ "aggregate": {
3762+ "$ref": "#/definitions/AggregateOp",
3763+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3764+ },
3765+ "bin": {
3766+ "$ref": "#/definitions/Bin",
3767+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3768+ },
3769+ "field": {
3770+ "$ref": "#/definitions/Field",
3771+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3772+ },
3773+ "sort": {
3774+ "anyOf": [
3775+ {
3776+ "$ref": "#/definitions/SortOrderEnum"
3777+ },
3778+ {
3779+ "type": "null"
3780+ }
3781+ ],
3782+ "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`.\nSort order for a facet field.\nThis can be `\"ascending\"`, `\"descending\"`."
3783+ },
3784+ "timeUnit": {
3785+ "$ref": "#/definitions/TimeUnit",
3786+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3787+ },
3788+ "type": {
3789+ "$ref": "#/definitions/Type",
3790+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3791+ }
3792+ },
3793+ "required": [
3794+ "type"
3795+ ],
3796+ "title": "OrderFieldDef"
3797+ },
3798+ "TextFieldDefWithCondition": {
3799+ "type": "object",
3800+ "additionalProperties": false,
3801+ "properties": {
3802+ "aggregate": {
3803+ "$ref": "#/definitions/AggregateOp",
3804+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3805+ },
3806+ "bin": {
3807+ "$ref": "#/definitions/Bin",
3808+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3809+ },
3810+ "condition": {
3811+ "$ref": "#/definitions/ConditionUnion",
3812+ "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value\ndefinitions](encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel."
3813+ },
3814+ "field": {
3815+ "$ref": "#/definitions/Field",
3816+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3817+ },
3818+ "format": {
3819+ "type": "string",
3820+ "description": "The [formatting pattern](format.html) for a text field. If not defined, this will be\ndetermined automatically."
3821+ },
3822+ "timeUnit": {
3823+ "$ref": "#/definitions/TimeUnit",
3824+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3825+ },
3826+ "type": {
3827+ "$ref": "#/definitions/Type",
3828+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3829+ }
3830+ },
3831+ "required": [
3832+ "type"
3833+ ],
3834+ "title": "TextFieldDefWithCondition",
3835+ "description": "A FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}"
3836+ },
3837+ "TextValueDefWithCondition": {
3838+ "type": "object",
3839+ "additionalProperties": false,
3840+ "properties": {
3841+ "condition": {
3842+ "$ref": "#/definitions/TextCondition",
3843+ "description": "A field definition or one or more value definition(s) with a selection predicate."
3844+ },
3845+ "value": {
3846+ "$ref": "#/definitions/ConditionValue",
3847+ "description": "A constant value in visual domain."
3848+ }
3849+ },
3850+ "required": [],
3851+ "title": "TextValueDefWithCondition",
3852+ "description": "A ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
3853+ },
3854+ "ConditionalPredicateTextFieldDef": {
3855+ "type": "object",
3856+ "additionalProperties": false,
3857+ "properties": {
3858+ "aggregate": {
3859+ "$ref": "#/definitions/AggregateOp",
3860+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3861+ },
3862+ "bin": {
3863+ "$ref": "#/definitions/Bin",
3864+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3865+ },
3866+ "field": {
3867+ "$ref": "#/definitions/Field",
3868+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3869+ },
3870+ "format": {
3871+ "type": "string",
3872+ "description": "The [formatting pattern](format.html) for a text field. If not defined, this will be\ndetermined automatically."
3873+ },
3874+ "test": {
3875+ "$ref": "#/definitions/LogicalOperandPredicate"
3876+ },
3877+ "timeUnit": {
3878+ "$ref": "#/definitions/TimeUnit",
3879+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3880+ },
3881+ "type": {
3882+ "$ref": "#/definitions/Type",
3883+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3884+ }
3885+ },
3886+ "required": [
3887+ "test",
3888+ "type"
3889+ ],
3890+ "title": "ConditionalPredicateTextFieldDef"
3891+ },
3892+ "ConditionalSelectionTextFieldDef": {
3893+ "type": "object",
3894+ "additionalProperties": false,
3895+ "properties": {
3896+ "aggregate": {
3897+ "$ref": "#/definitions/AggregateOp",
3898+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3899+ },
3900+ "bin": {
3901+ "$ref": "#/definitions/Bin",
3902+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3903+ },
3904+ "field": {
3905+ "$ref": "#/definitions/Field",
3906+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3907+ },
3908+ "format": {
3909+ "type": "string",
3910+ "description": "The [formatting pattern](format.html) for a text field. If not defined, this will be\ndetermined automatically."
3911+ },
3912+ "selection": {
3913+ "$ref": "#/definitions/SelectionOperand",
3914+ "description": "A [selection name](selection.html), or a series of [composed\nselections](selection.html#compose)."
3915+ },
3916+ "timeUnit": {
3917+ "$ref": "#/definitions/TimeUnit",
3918+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3919+ },
3920+ "type": {
3921+ "$ref": "#/definitions/Type",
3922+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3923+ }
3924+ },
3925+ "required": [
3926+ "selection",
3927+ "type"
3928+ ],
3929+ "title": "ConditionalSelectionTextFieldDef"
3930+ },
3931+ "PositionFieldDef": {
3932+ "type": "object",
3933+ "additionalProperties": false,
3934+ "properties": {
3935+ "aggregate": {
3936+ "$ref": "#/definitions/AggregateOp",
3937+ "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
3938+ },
3939+ "axis": {
3940+ "anyOf": [
3941+ {
3942+ "$ref": "#/definitions/Axis"
3943+ },
3944+ {
3945+ "type": "null"
3946+ }
3947+ ],
3948+ "description": "An object defining properties of axis's gridlines, ticks and labels.\nIf `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](axis.html) are applied."
3949+ },
3950+ "bin": {
3951+ "$ref": "#/definitions/Bin",
3952+ "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
3953+ },
3954+ "field": {
3955+ "$ref": "#/definitions/Field",
3956+ "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
3957+ },
3958+ "scale": {
3959+ "$ref": "#/definitions/Scale",
3960+ "description": "An object defining properties of the channel's scale, which is the function that\ntransforms values in the data domain (numbers, dates, strings, etc) to visual values\n(pixels, colors, sizes) of the encoding channels.\n\n__Default value:__ If undefined, default [scale properties](scale.html) are applied."
3961+ },
3962+ "sort": {
3963+ "$ref": "#/definitions/SortUnion",
3964+ "description": "Sort order for the encoded field.\nSupported `sort` values include `\"ascending\"`, `\"descending\"` and `null` (no sorting).\nFor fields with discrete domains, `sort` can also be a [sort field definition\nobject](sort.html#sort-field).\n\n__Default value:__ `\"ascending\"`"
3965+ },
3966+ "stack": {
3967+ "anyOf": [
3968+ {
3969+ "$ref": "#/definitions/StackOffset"
3970+ },
3971+ {
3972+ "type": "null"
3973+ }
3974+ ],
3975+ "description": "Type of stacking offset if the field should be stacked.\n`stack` is only applicable for `x` and `y` channels with continuous domains.\nFor example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n\n- `\"zero\"`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](stack.html#bar) and [area](stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](stack.html#normalized). <br/>\n- `\"center\"` - stacking with center baseline (for [streamgraph](stack.html#streamgraph)).\n- `null` - No-stacking. This will produce layered [bar](stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true:\n\n1. The mark is `bar` or `area`;\n2. The stacked measure channel (x or y) has a linear scale;\n3. At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default."
3976+ },
3977+ "timeUnit": {
3978+ "$ref": "#/definitions/TimeUnit",
3979+ "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
3980+ },
3981+ "type": {
3982+ "$ref": "#/definitions/Type",
3983+ "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
3984+ }
3985+ },
3986+ "required": [
3987+ "type"
3988+ ],
3989+ "title": "PositionFieldDef"
3990+ },
3991+ "ValueDef": {
3992+ "type": "object",
3993+ "additionalProperties": false,
3994+ "properties": {
3995+ "value": {
3996+ "$ref": "#/definitions/ConditionValue",
3997+ "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
3998+ }
3999+ },
4000+ "required": [
4001+ "value"
4002+ ],
4003+ "title": "ValueDef",
4004+ "description": "Definition object for a constant value of an encoding channel."
4005+ },
4006+ "Axis": {
4007+ "type": "object",
4008+ "additionalProperties": false,
4009+ "properties": {
4010+ "domain": {
4011+ "type": "boolean",
4012+ "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of\nthe axis.\n\n__Default value:__ `true`"
4013+ },
4014+ "format": {
4015+ "type": "string",
4016+ "description": "The formatting pattern for labels. This is D3's [number format\npattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's\n[time format pattern](https://github.com/d3/d3-time-format#locale_format) for time\nfield.\n\nSee the [format documentation](format.html) for more information.\n\n__Default value:__ derived from [numberFormat](config.html#format) config for\nquantitative fields and from [timeFormat](config.html#format) config for temporal fields."
4017+ },
4018+ "grid": {
4019+ "type": "boolean",
4020+ "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](scale.html#continuous) that are not\nbinned; otherwise, `false`."
4021+ },
4022+ "labelAngle": {
4023+ "type": "number",
4024+ "minimum": -360,
4025+ "maximum": 360,
4026+ "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise."
4027+ },
4028+ "labelBound": {
4029+ "$ref": "#/definitions/Label",
4030+ "description": "Indicates if labels should be hidden if they exceed the axis range. If `false `(the\ndefault) no bounds overlap analysis is performed. If `true`, labels will be hidden if\nthey exceed the axis range by more than 1 pixel. If this property is a number, it\nspecifies the pixel tolerance: the maximum amount by which a label bounding box may\nexceed the axis range.\n\n__Default value:__ `false`."
4031+ },
4032+ "labelFlush": {
4033+ "$ref": "#/definitions/Label",
4034+ "description": "Indicates if the first and last axis labels should be aligned flush with the scale range.\nFlush alignment for a horizontal axis will left-align the first label and right-align the\nlast label. For vertical axes, bottom and top text baselines are applied instead. If this\nproperty is a number, it also indicates the number of pixels by which to offset the first\nand last labels; for example, a value of 2 will flush-align the first and last labels and\nalso push them 2 pixels outward from the center of the axis. The additional adjustment\ncan sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`."
4035+ },
4036+ "labelOverlap": {
4037+ "$ref": "#/definitions/LabelOverlapUnion",
4038+ "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no\noverlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing\nevery other label is used (this works well for standard linear axes). If set to\n`\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps\nwith the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log\nscales; otherwise `false`."
4039+ },
4040+ "labelPadding": {
4041+ "type": "number",
4042+ "description": "The padding, in pixels, between axis and text labels."
4043+ },
4044+ "labels": {
4045+ "type": "boolean",
4046+ "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`."
4047+ },
4048+ "maxExtent": {
4049+ "type": "number",
4050+ "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a\nmaximum offset value for axis titles.\n\n__Default value:__ `undefined`."
4051+ },
4052+ "minExtent": {
4053+ "type": "number",
4054+ "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a\nminimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis."
4055+ },
4056+ "offset": {
4057+ "type": "number",
4058+ "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group\nor data rectangle.\n\n__Default value:__ derived from the [axis config](config.html#facet-scale-config)'s\n`offset` (`0` by default)"
4059+ },
4060+ "orient": {
4061+ "$ref": "#/definitions/TitleOrient",
4062+ "description": "The orientation of the axis. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`. The\norientation can be used to further specialize the axis type (e.g., a y axis oriented for\nthe right edge of the chart).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes."
4063+ },
4064+ "position": {
4065+ "type": "number",
4066+ "description": "The anchor position of the axis in pixels. For x-axis with top or bottom orientation,\nthis sets the axis group x coordinate. For y-axis with left or right orientation, this\nsets the axis group y coordinate.\n\n__Default value__: `0`"
4067+ },
4068+ "tickCount": {
4069+ "type": "number",
4070+ "description": "A desired number of ticks, for axes visualizing quantitative scales. The resulting number\nmay be different so that values are \"nice\" (multiples of 2, 5, 10) and lie within the\nunderlying scale's range."
4071+ },
4072+ "ticks": {
4073+ "type": "boolean",
4074+ "description": "Boolean value that determines whether the axis should include ticks."
4075+ },
4076+ "tickSize": {
4077+ "type": "number",
4078+ "minimum": 0,
4079+ "description": "The size in pixels of axis ticks."
4080+ },
4081+ "title": {
4082+ "anyOf": [
4083+ {
4084+ "type": "null"
4085+ },
4086+ {
4087+ "type": "string"
4088+ }
4089+ ],
4090+ "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function\n(`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the\nfunction is displayed as a part of the title (e.g., `\"Sum of Profit\"`). If the field is\nbinned or has a time unit applied, the applied function will be denoted in parentheses\n(e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is\nsimply the field name.\n\n__Note__: You can customize the default field title format by providing the [`fieldTitle`\nproperty in the [config](config.html) or [`fieldTitle` function via the `compile`\nfunction's options](compile.html#field-title)."
4091+ },
4092+ "titleMaxLength": {
4093+ "type": "number",
4094+ "description": "Max length for axis title if the title is automatically generated from the field's\ndescription."
4095+ },
4096+ "titlePadding": {
4097+ "type": "number",
4098+ "description": "The padding, in pixels, between title and axis."
4099+ },
4100+ "values": {
4101+ "type": "array",
4102+ "items": {
4103+ "$ref": "#/definitions/AxisValue"
4104+ },
4105+ "description": "Explicitly set the visible axis tick values."
4106+ },
4107+ "zindex": {
4108+ "type": "number",
4109+ "minimum": 0,
4110+ "description": "A non-positive integer indicating z-index of the axis.\nIf zindex is 0, axes should be drawn behind all chart elements.\nTo put them in front, use `\"zindex = 1\"`.\n\n__Default value:__ `1` (in front of the marks) for actual axis and `0` (behind the marks)\nfor grids."
4111+ }
4112+ },
4113+ "required": [],
4114+ "title": "Axis"
4115+ },
4116+ "MarkDef": {
4117+ "type": "object",
4118+ "additionalProperties": false,
4119+ "properties": {
4120+ "align": {
4121+ "$ref": "#/definitions/HorizontalAlign",
4122+ "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
4123+ },
4124+ "angle": {
4125+ "type": "number",
4126+ "minimum": 0,
4127+ "maximum": 360,
4128+ "description": "The rotation angle of the text, in degrees."
4129+ },
4130+ "baseline": {
4131+ "$ref": "#/definitions/VerticalAlign",
4132+ "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
4133+ },
4134+ "clip": {
4135+ "type": "boolean",
4136+ "description": "Whether a mark be clipped to the enclosing group’s width and height."
4137+ },
4138+ "color": {
4139+ "type": "string",
4140+ "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
4141+ },
4142+ "cursor": {
4143+ "$ref": "#/definitions/Cursor",
4144+ "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
4145+ },
4146+ "dx": {
4147+ "type": "number",
4148+ "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
4149+ },
4150+ "dy": {
4151+ "type": "number",
4152+ "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
4153+ },
4154+ "fill": {
4155+ "type": "string",
4156+ "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
4157+ },
4158+ "filled": {
4159+ "type": "boolean",
4160+ "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
4161+ },
4162+ "fillOpacity": {
4163+ "type": "number",
4164+ "minimum": 0,
4165+ "maximum": 1,
4166+ "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
4167+ },
4168+ "font": {
4169+ "type": "string",
4170+ "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
4171+ },
4172+ "fontSize": {
4173+ "type": "number",
4174+ "minimum": 0,
4175+ "description": "The font size, in pixels."
4176+ },
4177+ "fontStyle": {
4178+ "$ref": "#/definitions/FontStyle",
4179+ "description": "The font style (e.g., `\"italic\"`)."
4180+ },
4181+ "fontWeight": {
4182+ "$ref": "#/definitions/FontWeightUnion",
4183+ "description": "The font weight (e.g., `\"bold\"`)."
4184+ },
4185+ "href": {
4186+ "type": "string",
4187+ "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
4188+ },
4189+ "interpolate": {
4190+ "$ref": "#/definitions/Interpolate",
4191+ "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
4192+ },
4193+ "limit": {
4194+ "type": "number",
4195+ "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
4196+ },
4197+ "opacity": {
4198+ "type": "number",
4199+ "minimum": 0,
4200+ "maximum": 1,
4201+ "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
4202+ },
4203+ "orient": {
4204+ "$ref": "#/definitions/Orient",
4205+ "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
4206+ },
4207+ "radius": {
4208+ "type": "number",
4209+ "minimum": 0,
4210+ "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
4211+ },
4212+ "shape": {
4213+ "type": "string",
4214+ "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
4215+ },
4216+ "size": {
4217+ "type": "number",
4218+ "minimum": 0,
4219+ "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
4220+ },
4221+ "stroke": {
4222+ "type": "string",
4223+ "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
4224+ },
4225+ "strokeDash": {
4226+ "type": "array",
4227+ "items": {
4228+ "type": "number"
4229+ },
4230+ "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
4231+ },
4232+ "strokeDashOffset": {
4233+ "type": "number",
4234+ "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
4235+ },
4236+ "strokeOpacity": {
4237+ "type": "number",
4238+ "minimum": 0,
4239+ "maximum": 1,
4240+ "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
4241+ },
4242+ "strokeWidth": {
4243+ "type": "number",
4244+ "minimum": 0,
4245+ "description": "The stroke width, in pixels."
4246+ },
4247+ "style": {
4248+ "$ref": "#/definitions/Style",
4249+ "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A\nstyle is a named collection of mark property defaults defined within the [style\nconfiguration](mark.html#style-config). If style is an array, later styles will override\nearlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within\nthe `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by\ndefault.\n__Note:__ Any specified style will augment the default style. For example, a bar mark\nwith `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the\nspecified style `\"foo\"` has higher precedence)."
4250+ },
4251+ "tension": {
4252+ "type": "number",
4253+ "minimum": 0,
4254+ "maximum": 1,
4255+ "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
4256+ },
4257+ "text": {
4258+ "type": "string",
4259+ "description": "Placeholder text if the `text` channel is not specified"
4260+ },
4261+ "theta": {
4262+ "type": "number",
4263+ "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
4264+ },
4265+ "type": {
4266+ "$ref": "#/definitions/Mark",
4267+ "description": "The mark type.\nOne of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`."
4268+ }
4269+ },
4270+ "required": [
4271+ "type"
4272+ ],
4273+ "title": "MarkDef"
4274+ },
4275+ "Projection": {
4276+ "type": "object",
4277+ "additionalProperties": false,
4278+ "properties": {
4279+ "center": {
4280+ "type": "array",
4281+ "items": {
4282+ "type": "number"
4283+ },
4284+ "description": "Sets the projection’s center to the specified center, a two-element array of longitude\nand latitude in degrees.\n\n__Default value:__ `[0, 0]`"
4285+ },
4286+ "clipAngle": {
4287+ "type": "number",
4288+ "description": "Sets the projection’s clipping circle radius to the specified angle in degrees. If\n`null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather\nthan small-circle clipping."
4289+ },
4290+ "clipExtent": {
4291+ "type": "array",
4292+ "items": {
4293+ "type": "array",
4294+ "items": {
4295+ "type": "number"
4296+ }
4297+ },
4298+ "description": "Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent\nbounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of\nthe viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no\nviewport clipping is performed."
4299+ },
4300+ "coefficient": {
4301+ "type": "number"
4302+ },
4303+ "distance": {
4304+ "type": "number"
4305+ },
4306+ "fraction": {
4307+ "type": "number"
4308+ },
4309+ "lobes": {
4310+ "type": "number"
4311+ },
4312+ "parallel": {
4313+ "type": "number"
4314+ },
4315+ "precision": {
4316+ "$ref": "#/definitions/FluffyPrecision",
4317+ "description": "Sets the threshold for the projection’s [adaptive\nresampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This\nvalue corresponds to the [Douglas–Peucker\ndistance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).\nIf precision is not specified, returns the projection’s current resampling precision\nwhich defaults to `√0.5 ≅ 0.70710…`."
4318+ },
4319+ "radius": {
4320+ "type": "number"
4321+ },
4322+ "ratio": {
4323+ "type": "number"
4324+ },
4325+ "rotate": {
4326+ "type": "array",
4327+ "items": {
4328+ "type": "number"
4329+ },
4330+ "description": "Sets the projection’s three-axis rotation to the specified angles, which must be a two-\nor three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation\nangles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)\n\n__Default value:__ `[0, 0, 0]`"
4331+ },
4332+ "spacing": {
4333+ "type": "number"
4334+ },
4335+ "tilt": {
4336+ "type": "number"
4337+ },
4338+ "type": {
4339+ "$ref": "#/definitions/VGProjectionType",
4340+ "description": "The cartographic projection to use. This value is case-insensitive, for example\n`\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid\nprojection types [in the\ndocumentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`"
4341+ }
4342+ },
4343+ "required": [],
4344+ "title": "Projection",
4345+ "description": "An object defining properties of geographic projection.\n\nWorks with `\"geoshape\"` marks and `\"point\"` or `\"line\"` marks that have a channel (one or more of `\"X\"`, `\"X2\"`, `\"Y\"`, `\"Y2\"`) with type `\"latitude\"`, or `\"longitude\"`."
4346+ },
4347+ "FluffyPrecision": {
4348+ "type": "object",
4349+ "additionalProperties": {
4350+ "type": "string"
4351+ },
4352+ "properties": {
4353+ "length": {
4354+ "type": "number",
4355+ "description": "Returns the length of a String object."
4356+ }
4357+ },
4358+ "required": [
4359+ "length"
4360+ ],
4361+ "title": "FluffyPrecision",
4362+ "description": "Sets the threshold for the projection’s [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [Douglas–Peucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection’s current resampling precision which defaults to `√0.5 ≅ 0.70710…`."
4363+ },
4364+ "SingleSelection": {
4365+ "type": "object",
4366+ "additionalProperties": false,
4367+ "properties": {
4368+ "bind": {
4369+ "type": "object",
4370+ "additionalProperties": {
4371+ "$ref": "#/definitions/VGBinding"
4372+ },
4373+ "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](bind.html) documentation for more information."
4374+ },
4375+ "empty": {
4376+ "$ref": "#/definitions/Empty",
4377+ "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
33424378 },
3343- "titlePadding": {
3344- "type": "number",
3345- "description": "The padding, in pixels, between title and axis."
4379+ "encodings": {
4380+ "type": "array",
4381+ "items": {
4382+ "$ref": "#/definitions/SingleDefChannel"
4383+ },
4384+ "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
33464385 },
3347- "values": {
4386+ "fields": {
33484387 "type": "array",
33494388 "items": {
3350- "$ref": "#/definitions/AxisValue"
4389+ "type": "string"
33514390 },
3352- "description": "Explicitly set the visible axis tick values."
4391+ "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
33534392 },
3354- "zindex": {
3355- "type": "number",
3356- "minimum": 0,
3357- "description": "A non-positive integer indicating z-index of the axis.\nIf zindex is 0, axes should be drawn behind all chart elements.\nTo put them in front, use `\"zindex = 1\"`.\n\n__Default value:__ `1` (in front of the marks) for actual axis and `0` (behind the marks)\nfor grids."
4393+ "nearest": {
4394+ "type": "boolean",
4395+ "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
4396+ },
4397+ "on": {
4398+ "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
4399+ },
4400+ "resolve": {
4401+ "$ref": "#/definitions/SelectionResolution",
4402+ "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
4403+ },
4404+ "type": {
4405+ "$ref": "#/definitions/StickyType"
33584406 }
33594407 },
3360- "required": [],
3361- "title": "Axis"
4408+ "required": [
4409+ "type"
4410+ ],
4411+ "title": "SingleSelection"
33624412 },
3363- "X2Class": {
4413+ "MultiSelection": {
33644414 "type": "object",
33654415 "additionalProperties": false,
33664416 "properties": {
3367- "aggregate": {
3368- "$ref": "#/definitions/AggregateOp",
3369- "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)"
4417+ "empty": {
4418+ "$ref": "#/definitions/Empty",
4419+ "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
33704420 },
3371- "bin": {
3372- "$ref": "#/definitions/Bin",
3373- "description": "A flag for binning a `quantitative` field, or [an object defining binning\nparameters](bin.html#params).\nIf `true`, default [binning parameters](bin.html) will be applied.\n\n__Default value:__ `false`"
4421+ "encodings": {
4422+ "type": "array",
4423+ "items": {
4424+ "$ref": "#/definitions/SingleDefChannel"
4425+ },
4426+ "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
33744427 },
3375- "field": {
3376- "$ref": "#/definitions/Field",
3377- "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects\n(e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape\ndots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`."
4428+ "fields": {
4429+ "type": "array",
4430+ "items": {
4431+ "type": "string"
4432+ },
4433+ "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
33784434 },
3379- "timeUnit": {
3380- "$ref": "#/definitions/TimeUnit",
3381- "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](type.html#cast).\n\n__Default value:__ `undefined` (None)"
4435+ "nearest": {
4436+ "type": "boolean",
4437+ "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
33824438 },
3383- "type": {
3384- "$ref": "#/definitions/Type",
3385- "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
4439+ "on": {
4440+ "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
33864441 },
3387- "value": {
3388- "$ref": "#/definitions/ConditionalValueDefValue",
3389- "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
3390- }
3391- },
3392- "required": [],
3393- "title": "X2Class",
3394- "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\nY2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\nDefinition object for a data field, its type and transformation of an encoding channel.\nDefinition object for a constant value of an encoding channel."
3395- },
3396- "FacetMapping": {
3397- "type": "object",
3398- "additionalProperties": false,
3399- "properties": {
3400- "column": {
3401- "$ref": "#/definitions/FacetFieldDef",
3402- "description": "Horizontal facets for trellis plots."
4442+ "resolve": {
4443+ "$ref": "#/definitions/SelectionResolution",
4444+ "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
34034445 },
3404- "row": {
3405- "$ref": "#/definitions/FacetFieldDef",
3406- "description": "Vertical facets for trellis plots."
4446+ "toggle": {
4447+ "$ref": "#/definitions/Translate",
4448+ "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\nSee the [toggle transform](toggle.html) documentation for more information."
4449+ },
4450+ "type": {
4451+ "$ref": "#/definitions/IndigoType"
34074452 }
34084453 },
3409- "required": [],
3410- "title": "FacetMapping",
3411- "description": "An object that describes mappings between `row` and `column` channels and their field definitions."
4454+ "required": [
4455+ "type"
4456+ ],
4457+ "title": "MultiSelection"
34124458 },
3413- "Spec": {
4459+ "IntervalSelection": {
34144460 "type": "object",
34154461 "additionalProperties": false,
34164462 "properties": {
3417- "data": {
3418- "$ref": "#/definitions/Data",
3419- "description": "An object describing the data source"
4463+ "bind": {
4464+ "$ref": "#/definitions/Bind",
4465+ "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view."
34204466 },
3421- "description": {
3422- "type": "string",
3423- "description": "Description of this mark for commenting purpose."
4467+ "empty": {
4468+ "$ref": "#/definitions/Empty",
4469+ "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
34244470 },
3425- "height": {
3426- "type": "number",
3427- "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its y-channel has a\n[continuous scale](scale.html#continuous), the height will be the value of\n[`config.view.height`](spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the height is [determined by the range step, paddings, and the\ncardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the height will be the value of\n[`config.view.height`](spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the height of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
4471+ "encodings": {
4472+ "type": "array",
4473+ "items": {
4474+ "$ref": "#/definitions/SingleDefChannel"
4475+ },
4476+ "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
34284477 },
3429- "layer": {
4478+ "fields": {
34304479 "type": "array",
34314480 "items": {
3432- "$ref": "#/definitions/LayerSpec"
4481+ "type": "string"
34334482 },
3434- "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as\nlayering facet specifications is not allowed."
4483+ "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
34354484 },
3436- "name": {
3437- "type": "string",
3438- "description": "Name of the visualization for later reference."
4485+ "mark": {
4486+ "$ref": "#/definitions/BrushConfig",
4487+ "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark."
34394488 },
3440- "resolve": {
3441- "$ref": "#/definitions/Resolve",
3442- "description": "Scale, axis, and legend resolutions for layers.\n\nScale, axis, and legend resolutions for facets.\n\nScale and legend resolutions for repeated charts.\n\nScale, axis, and legend resolutions for vertically concatenated charts.\n\nScale, axis, and legend resolutions for horizontally concatenated charts."
4489+ "on": {
4490+ "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
34434491 },
3444- "title": {
3445- "$ref": "#/definitions/Title",
3446- "description": "Title for the plot."
4492+ "resolve": {
4493+ "$ref": "#/definitions/SelectionResolution",
4494+ "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
34474495 },
3448- "transform": {
3449- "type": "array",
3450- "items": {
3451- "$ref": "#/definitions/Transform"
3452- },
3453- "description": "An array of data transformations such as filter and new field calculation."
4496+ "translate": {
4497+ "$ref": "#/definitions/Translate",
4498+ "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it."
34544499 },
3455- "width": {
3456- "type": "number",
3457- "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its x-channel has a\n[continuous scale](scale.html#continuous), the width will be the value of\n[`config.view.width`](spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the width is [determined by the range step, paddings, and the\ncardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the width will be the value of\n[`config.view.width`](spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of\n[`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and\nthe value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the width of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
4500+ "type": {
4501+ "$ref": "#/definitions/IndecentType"
34584502 },
3459- "encoding": {
3460- "$ref": "#/definitions/Encoding",
3461- "description": "A key-value mapping between encoding channels and definition of fields."
4503+ "zoom": {
4504+ "$ref": "#/definitions/Translate",
4505+ "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n\n__Default value:__ `true`, which corresponds to `wheel!`."
4506+ }
4507+ },
4508+ "required": [
4509+ "type"
4510+ ],
4511+ "title": "IntervalSelection"
4512+ },
4513+ "TitleParams": {
4514+ "type": "object",
4515+ "additionalProperties": false,
4516+ "properties": {
4517+ "anchor": {
4518+ "$ref": "#/definitions/Anchor",
4519+ "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For\nexample, with an orientation of top these anchor positions map to a left-, center-, or\nright-aligned title.\n\n__Default value:__ `\"middle\"` for [single](spec.html) and [layered](layer.html) views.\n`\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only\ncustomizable only for [single](spec.html) and [layered](layer.html) views. For other\ncomposite views, `anchor` is always `\"start\"`."
34624520 },
3463- "mark": {
3464- "$ref": "#/definitions/AnyMark",
3465- "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`,\n`\"line\"`,\n* `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition\nobject](mark.html#mark-def)."
4521+ "offset": {
4522+ "type": "number",
4523+ "description": "The orthogonal offset in pixels by which to displace the title from its position along\nthe edge of the chart."
34664524 },
3467- "projection": {
3468- "$ref": "#/definitions/Projection",
3469- "description": "An object defining properties of geographic projection.\n\nWorks with `\"geoshape\"` marks and `\"point\"` or `\"line\"` marks that have a channel (one or\nmore of `\"X\"`, `\"X2\"`, `\"Y\"`, `\"Y2\"`) with type `\"latitude\"`, or `\"longitude\"`."
4525+ "orient": {
4526+ "$ref": "#/definitions/TitleOrient",
4527+ "description": "The orientation of the title relative to the chart. One of `\"top\"` (the default),\n`\"bottom\"`, `\"left\"`, or `\"right\"`."
34704528 },
3471- "selection": {
3472- "type": "object",
3473- "additionalProperties": {
3474- "$ref": "#/definitions/SelectionDef"
3475- },
3476- "description": "A key-value mapping between selection names and definitions."
4529+ "style": {
4530+ "$ref": "#/definitions/Style",
4531+ "description": "A [mark style property](config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`."
34774532 },
3478- "facet": {
3479- "$ref": "#/definitions/FacetMapping",
3480- "description": "An object that describes mappings between `row` and `column` channels and their field\ndefinitions."
4533+ "text": {
4534+ "type": "string",
4535+ "description": "The title text."
4536+ }
4537+ },
4538+ "required": [
4539+ "text"
4540+ ],
4541+ "title": "TitleParams"
4542+ },
4543+ "FilterTransform": {
4544+ "type": "object",
4545+ "additionalProperties": false,
4546+ "properties": {
4547+ "filter": {
4548+ "$ref": "#/definitions/LogicalOperandPredicate",
4549+ "description": "The `filter` property must be one of the predicate definitions:\n(1) an [expression](types.html#expression) string,\nwhere `datum` can be used to refer to the current data object;\n(2) one of the field predicates: [equal predicate](filter.html#equal-predicate);\n[range predicate](filter.html#range-predicate), [one-of\npredicate](filter.html#one-of-predicate);\n(3) a [selection predicate](filter.html#selection-predicate);\nor (4) a logical operand that combines (1), (2), or (3)."
4550+ }
4551+ },
4552+ "required": [
4553+ "filter"
4554+ ],
4555+ "title": "FilterTransform"
4556+ },
4557+ "CalculateTransform": {
4558+ "type": "object",
4559+ "additionalProperties": false,
4560+ "properties": {
4561+ "as": {
4562+ "type": "string",
4563+ "description": "The field for storing the computed formula value."
34814564 },
3482- "spec": {
3483- "$ref": "#/definitions/Spec",
3484- "description": "A specification of the view that gets faceted."
4565+ "calculate": {
4566+ "type": "string",
4567+ "description": "A [expression](types.html#expression) string. Use the variable `datum` to refer to the\ncurrent data object."
4568+ }
4569+ },
4570+ "required": [
4571+ "as",
4572+ "calculate"
4573+ ],
4574+ "title": "CalculateTransform"
4575+ },
4576+ "LookupTransform": {
4577+ "type": "object",
4578+ "additionalProperties": false,
4579+ "properties": {
4580+ "as": {
4581+ "$ref": "#/definitions/Style",
4582+ "description": "The field or fields for storing the computed formula value.\nIf `from.fields` is specified, the transform will use the same names for `as`.\nIf `from.fields` is not specified, `as` has to be a string and we put the whole object\ninto the data under the specified name."
34854583 },
3486- "repeat": {
3487- "$ref": "#/definitions/Repeat",
3488- "description": "An object that describes what fields should be repeated into views that are laid out as a\n`row` or `column`."
4584+ "default": {
4585+ "type": "string",
4586+ "description": "The default value to use if lookup fails.\n\n__Default value:__ `null`"
34894587 },
3490- "vconcat": {
3491- "type": "array",
3492- "items": {
3493- "$ref": "#/definitions/Spec"
3494- },
3495- "description": "A list of views that should be concatenated and put into a column."
4588+ "from": {
4589+ "$ref": "#/definitions/LookupData",
4590+ "description": "Secondary data reference."
34964591 },
3497- "hconcat": {
3498- "type": "array",
3499- "items": {
3500- "$ref": "#/definitions/Spec"
3501- },
3502- "description": "A list of views that should be concatenated and put into a row."
4592+ "lookup": {
4593+ "type": "string",
4594+ "description": "Key in primary data source."
35034595 }
35044596 },
3505- "required": [],
3506- "title": "Spec",
3507- "description": "Unit spec that can have a composite mark."
4597+ "required": [
4598+ "from",
4599+ "lookup"
4600+ ],
4601+ "title": "LookupTransform"
35084602 },
3509- "Encoding": {
4603+ "BinTransform": {
35104604 "type": "object",
35114605 "additionalProperties": false,
35124606 "properties": {
3513- "color": {
3514- "$ref": "#/definitions/MarkPropDefWithCondition",
3515- "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark\nconfig](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color\nscheme](scale.html#scheme)."
3516- },
3517- "detail": {
3518- "$ref": "#/definitions/Detail",
3519- "description": "Additional levels of detail for grouping data in aggregate views and\nin line and area marks without mapping data to a specific visual channel."
3520- },
3521- "href": {
3522- "$ref": "#/definitions/DefWithCondition",
3523- "description": "A URL to load upon mouse click."
3524- },
3525- "opacity": {
3526- "$ref": "#/definitions/MarkPropDefWithCondition",
3527- "description": "Opacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark\nconfig](config.html#mark)'s `opacity` property."
3528- },
3529- "order": {
3530- "$ref": "#/definitions/Order",
3531- "description": "Stack order for stacked marks or order of data points in line marks for connected scatter\nplots.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating\nadditional aggregation grouping."
3532- },
3533- "shape": {
3534- "$ref": "#/definitions/MarkPropDefWithCondition",
3535- "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark\nconfig](config.html#point-config)'s `shape` property."
3536- },
3537- "size": {
3538- "$ref": "#/definitions/MarkPropDefWithCondition",
3539- "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`."
3540- },
3541- "text": {
3542- "$ref": "#/definitions/TextDefWithCondition",
3543- "description": "Text of the `text` mark."
3544- },
3545- "tooltip": {
3546- "$ref": "#/definitions/TextDefWithCondition",
3547- "description": "The tooltip text to show upon mouse hover."
3548- },
3549- "x": {
3550- "$ref": "#/definitions/XClass",
3551- "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`."
3552- },
3553- "x2": {
3554- "$ref": "#/definitions/X2Class",
3555- "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
4607+ "as": {
4608+ "type": "string",
4609+ "description": "The output fields at which to write the start and end bin values."
35564610 },
3557- "y": {
3558- "$ref": "#/definitions/XClass",
3559- "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`."
4611+ "bin": {
4612+ "$ref": "#/definitions/Bin",
4613+ "description": "An object indicating bin properties, or simply `true` for using default bin parameters."
35604614 },
3561- "y2": {
3562- "$ref": "#/definitions/X2Class",
3563- "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
4615+ "field": {
4616+ "type": "string",
4617+ "description": "The data field to bin."
35644618 }
35654619 },
3566- "required": [],
3567- "title": "Encoding",
3568- "description": "A key-value mapping between encoding channels and definition of fields."
4620+ "required": [
4621+ "as",
4622+ "bin",
4623+ "field"
4624+ ],
4625+ "title": "BinTransform"
35694626 },
3570- "LayerSpec": {
4627+ "TimeUnitTransform": {
35714628 "type": "object",
35724629 "additionalProperties": false,
35734630 "properties": {
3574- "data": {
3575- "$ref": "#/definitions/Data",
3576- "description": "An object describing the data source"
3577- },
3578- "description": {
4631+ "as": {
35794632 "type": "string",
3580- "description": "Description of this mark for commenting purpose."
4633+ "description": "The output field to write the timeUnit value."
35814634 },
3582- "height": {
3583- "type": "number",
3584- "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its y-channel has a\n[continuous scale](scale.html#continuous), the height will be the value of\n[`config.view.height`](spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the height is [determined by the range step, paddings, and the\ncardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the height will be the value of\n[`config.view.height`](spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the height of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
4635+ "field": {
4636+ "type": "string",
4637+ "description": "The data field to apply time unit."
35854638 },
3586- "layer": {
4639+ "timeUnit": {
4640+ "$ref": "#/definitions/TimeUnit",
4641+ "description": "The timeUnit."
4642+ }
4643+ },
4644+ "required": [
4645+ "as",
4646+ "field",
4647+ "timeUnit"
4648+ ],
4649+ "title": "TimeUnitTransform"
4650+ },
4651+ "AggregateTransform": {
4652+ "type": "object",
4653+ "additionalProperties": false,
4654+ "properties": {
4655+ "aggregate": {
35874656 "type": "array",
35884657 "items": {
3589- "$ref": "#/definitions/LayerSpec"
4658+ "$ref": "#/definitions/AggregatedFieldDef"
35904659 },
3591- "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as\nlayering facet specifications is not allowed."
3592- },
3593- "name": {
3594- "type": "string",
3595- "description": "Name of the visualization for later reference."
3596- },
3597- "resolve": {
3598- "$ref": "#/definitions/Resolve",
3599- "description": "Scale, axis, and legend resolutions for layers."
3600- },
3601- "title": {
3602- "$ref": "#/definitions/Title",
3603- "description": "Title for the plot."
4660+ "description": "Array of objects that define fields to aggregate."
36044661 },
3605- "transform": {
4662+ "groupby": {
36064663 "type": "array",
36074664 "items": {
3608- "$ref": "#/definitions/Transform"
3609- },
3610- "description": "An array of data transformations such as filter and new field calculation."
3611- },
3612- "width": {
3613- "type": "number",
3614- "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its x-channel has a\n[continuous scale](scale.html#continuous), the width will be the value of\n[`config.view.width`](spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the width is [determined by the range step, paddings, and the\ncardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the width will be the value of\n[`config.view.width`](spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of\n[`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and\nthe value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the width of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
3615- },
3616- "encoding": {
3617- "$ref": "#/definitions/Encoding",
3618- "description": "A key-value mapping between encoding channels and definition of fields."
3619- },
3620- "mark": {
3621- "$ref": "#/definitions/AnyMark",
3622- "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`,\n`\"line\"`,\n* `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition\nobject](mark.html#mark-def)."
3623- },
3624- "projection": {
3625- "$ref": "#/definitions/Projection",
3626- "description": "An object defining properties of geographic projection.\n\nWorks with `\"geoshape\"` marks and `\"point\"` or `\"line\"` marks that have a channel (one or\nmore of `\"X\"`, `\"X2\"`, `\"Y\"`, `\"Y2\"`) with type `\"latitude\"`, or `\"longitude\"`."
3627- },
3628- "selection": {
3629- "type": "object",
3630- "additionalProperties": {
3631- "$ref": "#/definitions/SelectionDef"
4665+ "type": "string"
36324666 },
3633- "description": "A key-value mapping between selection names and definitions."
4667+ "description": "The data fields to group by. If not specified, a single group containing all data objects\nwill be used."
36344668 }
36354669 },
3636- "required": [],
3637- "title": "LayerSpec",
3638- "description": "Unit spec that can have a composite mark."
4670+ "required": [
4671+ "aggregate"
4672+ ],
4673+ "title": "AggregateTransform"
36394674 },
3640- "MarkDef": {
4675+ "LookupData": {
36414676 "type": "object",
36424677 "additionalProperties": false,
36434678 "properties": {
3644- "align": {
3645- "$ref": "#/definitions/HorizontalAlign",
3646- "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
3647- },
3648- "angle": {
3649- "type": "number",
3650- "minimum": 0,
3651- "maximum": 360,
3652- "description": "The rotation angle of the text, in degrees."
3653- },
3654- "baseline": {
3655- "$ref": "#/definitions/VerticalAlign",
3656- "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
3657- },
3658- "clip": {
3659- "type": "boolean",
3660- "description": "Whether a mark be clipped to the enclosing group’s width and height."
3661- },
3662- "color": {
3663- "type": "string",
3664- "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and\nwill override `color`.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
3665- },
3666- "cursor": {
3667- "$ref": "#/definitions/Cursor",
3668- "description": "The mouse cursor used over the mark. Any valid [CSS cursor\ntype](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
3669- },
3670- "dx": {
3671- "type": "number",
3672- "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
4679+ "data": {
4680+ "$ref": "#/definitions/Data",
4681+ "description": "Secondary data source to lookup in."
36734682 },
3674- "dy": {
3675- "type": "number",
3676- "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset\nis applied after rotation by the _angle_ property."
4683+ "fields": {
4684+ "type": "array",
4685+ "items": {
4686+ "type": "string"
4687+ },
4688+ "description": "Fields in foreign data to lookup.\nIf not specified, the entire object is queried."
36774689 },
3678- "fill": {
4690+ "key": {
36794691 "type": "string",
3680- "description": "Default Fill Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
3681- },
3682- "filled": {
3683- "type": "boolean",
3684- "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `true` for all marks except `point` and `false` for `point`.\n\n__Applicable for:__ `bar`, `point`, `circle`, `square`, and `area` marks.\n\n__Note:__ This property cannot be used in a [style config](mark.html#style-config)."
3685- },
3686- "fillOpacity": {
3687- "type": "number",
3688- "minimum": 0,
3689- "maximum": 1,
3690- "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`"
3691- },
3692- "font": {
4692+ "description": "Key in data to lookup."
4693+ }
4694+ },
4695+ "required": [
4696+ "data",
4697+ "key"
4698+ ],
4699+ "title": "LookupData",
4700+ "description": "Secondary data reference."
4701+ },
4702+ "AggregatedFieldDef": {
4703+ "type": "object",
4704+ "additionalProperties": false,
4705+ "properties": {
4706+ "as": {
36934707 "type": "string",
3694- "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`)."
3695- },
3696- "fontSize": {
3697- "type": "number",
3698- "minimum": 0,
3699- "description": "The font size, in pixels."
3700- },
3701- "fontStyle": {
3702- "$ref": "#/definitions/FontStyle",
3703- "description": "The font style (e.g., `\"italic\"`)."
3704- },
3705- "fontWeight": {
3706- "$ref": "#/definitions/FontWeightUnion",
3707- "description": "The font weight (e.g., `\"bold\"`)."
4708+ "description": "The output field names to use for each aggregated field."
37084709 },
3709- "href": {
4710+ "field": {
37104711 "type": "string",
3711- "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink."
3712- },
3713- "interpolate": {
3714- "$ref": "#/definitions/Interpolate",
3715- "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step\nfunction.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step\nfunction.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but\nwill intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the\nspline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y."
3716- },
3717- "limit": {
3718- "type": "number",
3719- "description": "The maximum length of the text mark in pixels (default 0, indicating no limit). The text\nvalue will be automatically truncated if the rendered size exceeds the limit."
3720- },
3721- "opacity": {
3722- "type": "number",
3723- "minimum": 0,
3724- "maximum": 1,
3725- "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or\n`square` marks or layered `bar` charts and `1` otherwise."
3726- },
3727- "orient": {
3728- "$ref": "#/definitions/Orient",
3729- "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored."
4712+ "description": "The data field for which to compute aggregate function."
37304713 },
3731- "radius": {
3732- "type": "number",
3733- "minimum": 0,
3734- "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined\nby the `x` and `y` properties."
4714+ "op": {
4715+ "$ref": "#/definitions/AggregateOp",
4716+ "description": "The aggregation operations to apply to the fields, such as sum, average or count.\nSee the [full list of supported aggregation\noperations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)\nfor more information."
4717+ }
4718+ },
4719+ "required": [
4720+ "as",
4721+ "field",
4722+ "op"
4723+ ],
4724+ "title": "AggregatedFieldDef"
4725+ },
4726+ "LayerSpec": {
4727+ "type": "object",
4728+ "additionalProperties": false,
4729+ "properties": {
4730+ "data": {
4731+ "$ref": "#/definitions/Data",
4732+ "description": "An object describing the data source"
37354733 },
3736- "shape": {
4734+ "description": {
37374735 "type": "string",
3738- "description": "The default symbol shape to use. One of: `\"circle\"` (default), `\"square\"`, `\"cross\"`,\n`\"diamond\"`, `\"triangle-up\"`, or `\"triangle-down\"`, or a custom SVG path.\n\n__Default value:__ `\"circle\"`"
4736+ "description": "Description of this mark for commenting purpose."
37394737 },
3740- "size": {
4738+ "height": {
37414739 "type": "number",
3742- "minimum": 0,
3743- "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root\nof the size value.\n\n__Default value:__ `30`"
3744- },
3745- "stroke": {
3746- "type": "string",
3747- "description": "Default Stroke Color. This has higher precedence than config.color\n\n__Default value:__ (None)"
4740+ "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its y-channel has a\n[continuous scale](scale.html#continuous), the height will be the value of\n[`config.view.height`](spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the height is [determined by the range step, paddings, and the\ncardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the height will be the value of\n[`config.view.height`](spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the height of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
37484741 },
3749- "strokeDash": {
4742+ "layer": {
37504743 "type": "array",
37514744 "items": {
3752- "type": "number"
4745+ "$ref": "#/definitions/SpecElement"
37534746 },
3754- "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines."
3755- },
3756- "strokeDashOffset": {
3757- "type": "number",
3758- "description": "The offset (in pixels) into which to begin drawing with the stroke dash array."
3759- },
3760- "strokeOpacity": {
3761- "type": "number",
3762- "minimum": 0,
3763- "maximum": 1,
3764- "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`"
4747+ "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as\nlayering facet specifications is not allowed."
37654748 },
3766- "strokeWidth": {
3767- "type": "number",
3768- "minimum": 0,
3769- "description": "The stroke width, in pixels."
4749+ "name": {
4750+ "type": "string",
4751+ "description": "Name of the visualization for later reference."
37704752 },
3771- "style": {
3772- "$ref": "#/definitions/Style",
3773- "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A\nstyle is a named collection of mark property defaults defined within the [style\nconfiguration](mark.html#style-config). If style is an array, later styles will override\nearlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within\nthe `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by\ndefault.\n__Note:__ Any specified style will augment the default style. For example, a bar mark\nwith `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the\nspecified style `\"foo\"` has higher precedence)."
4753+ "resolve": {
4754+ "$ref": "#/definitions/Resolve",
4755+ "description": "Scale, axis, and legend resolutions for layers."
37744756 },
3775- "tension": {
3776- "type": "number",
3777- "minimum": 0,
3778- "maximum": 1,
3779- "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks)."
4757+ "title": {
4758+ "$ref": "#/definitions/Title",
4759+ "description": "Title for the plot."
37804760 },
3781- "text": {
3782- "type": "string",
3783- "description": "Placeholder text if the `text` channel is not specified"
4761+ "transform": {
4762+ "type": "array",
4763+ "items": {
4764+ "$ref": "#/definitions/Transform"
4765+ },
4766+ "description": "An array of data transformations such as filter and new field calculation."
37844767 },
3785- "theta": {
4768+ "width": {
37864769 "type": "number",
3787- "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the\n`x` and `y` properties. Values for `theta` follow the same convention of `arc` mark\n`startAngle` and `endAngle` properties: angles are measured in radians, with `0`\nindicating \"north\"."
3788- },
3789- "type": {
3790- "$ref": "#/definitions/Mark",
3791- "description": "The mark type.\nOne of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`."
4770+ "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its x-channel has a\n[continuous scale](scale.html#continuous), the width will be the value of\n[`config.view.width`](spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the width is [determined by the range step, paddings, and the\ncardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the width will be the value of\n[`config.view.width`](spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of\n[`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and\nthe value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the width of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
37924771 }
37934772 },
37944773 "required": [
3795- "type"
4774+ "layer"
37964775 ],
3797- "title": "MarkDef"
4776+ "title": "LayerSpec"
37984777 },
3799- "Projection": {
4778+ "CompositeUnitSpecAlias": {
38004779 "type": "object",
38014780 "additionalProperties": false,
38024781 "properties": {
3803- "center": {
3804- "type": "array",
3805- "items": {
3806- "type": "number"
3807- },
3808- "description": "Sets the projection’s center to the specified center, a two-element array of longitude\nand latitude in degrees.\n\n__Default value:__ `[0, 0]`"
3809- },
3810- "clipAngle": {
3811- "type": "number",
3812- "description": "Sets the projection’s clipping circle radius to the specified angle in degrees. If\n`null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather\nthan small-circle clipping."
3813- },
3814- "clipExtent": {
3815- "type": "array",
3816- "items": {
3817- "type": "array",
3818- "items": {
3819- "type": "number"
3820- }
3821- },
3822- "description": "Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent\nbounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of\nthe viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no\nviewport clipping is performed."
4782+ "data": {
4783+ "$ref": "#/definitions/Data",
4784+ "description": "An object describing the data source"
38234785 },
3824- "coefficient": {
3825- "type": "number"
4786+ "description": {
4787+ "type": "string",
4788+ "description": "Description of this mark for commenting purpose."
38264789 },
3827- "distance": {
3828- "type": "number"
4790+ "encoding": {
4791+ "$ref": "#/definitions/Encoding",
4792+ "description": "A key-value mapping between encoding channels and definition of fields."
38294793 },
3830- "fraction": {
3831- "type": "number"
4794+ "height": {
4795+ "type": "number",
4796+ "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its y-channel has a\n[continuous scale](scale.html#continuous), the height will be the value of\n[`config.view.height`](spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the height is [determined by the range step, paddings, and the\ncardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the height will be the value of\n[`config.view.height`](spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the height of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
38324797 },
3833- "lobes": {
3834- "type": "number"
4798+ "mark": {
4799+ "$ref": "#/definitions/AnyMark",
4800+ "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`,\n`\"line\"`,\n* `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition\nobject](mark.html#mark-def)."
38354801 },
3836- "parallel": {
3837- "type": "number"
4802+ "name": {
4803+ "type": "string",
4804+ "description": "Name of the visualization for later reference."
38384805 },
3839- "precision": {
3840- "$ref": "#/definitions/FluffyPrecision",
3841- "description": "Sets the threshold for the projection’s [adaptive\nresampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This\nvalue corresponds to the [Douglas–Peucker\ndistance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).\nIf precision is not specified, returns the projection’s current resampling precision\nwhich defaults to `√0.5 ≅ 0.70710…`."
4806+ "projection": {
4807+ "$ref": "#/definitions/Projection",
4808+ "description": "An object defining properties of geographic projection.\n\nWorks with `\"geoshape\"` marks and `\"point\"` or `\"line\"` marks that have a channel (one or\nmore of `\"X\"`, `\"X2\"`, `\"Y\"`, `\"Y2\"`) with type `\"latitude\"`, or `\"longitude\"`."
38424809 },
3843- "radius": {
3844- "type": "number"
4810+ "selection": {
4811+ "type": "object",
4812+ "additionalProperties": {
4813+ "$ref": "#/definitions/SelectionDef"
4814+ },
4815+ "description": "A key-value mapping between selection names and definitions."
38454816 },
3846- "ratio": {
3847- "type": "number"
4817+ "title": {
4818+ "$ref": "#/definitions/Title",
4819+ "description": "Title for the plot."
38484820 },
3849- "rotate": {
4821+ "transform": {
38504822 "type": "array",
38514823 "items": {
3852- "type": "number"
4824+ "$ref": "#/definitions/Transform"
38534825 },
3854- "description": "Sets the projection’s three-axis rotation to the specified angles, which must be a two-\nor three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation\nangles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)\n\n__Default value:__ `[0, 0, 0]`"
3855- },
3856- "spacing": {
3857- "type": "number"
3858- },
3859- "tilt": {
3860- "type": "number"
4826+ "description": "An array of data transformations such as filter and new field calculation."
38614827 },
3862- "type": {
3863- "$ref": "#/definitions/VGProjectionType",
3864- "description": "The cartographic projection to use. This value is case-insensitive, for example\n`\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid\nprojection types [in the\ndocumentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`"
3865- }
3866- },
3867- "required": [],
3868- "title": "Projection",
3869- "description": "An object defining properties of geographic projection.\n\nWorks with `\"geoshape\"` marks and `\"point\"` or `\"line\"` marks that have a channel (one or more of `\"X\"`, `\"X2\"`, `\"Y\"`, `\"Y2\"`) with type `\"latitude\"`, or `\"longitude\"`."
3870- },
3871- "FluffyPrecision": {
3872- "type": "object",
3873- "additionalProperties": {
3874- "type": "string"
3875- },
3876- "properties": {
3877- "length": {
4828+ "width": {
38784829 "type": "number",
3879- "description": "Returns the length of a String object."
4830+ "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](size.html#autosize) type is `\"fit\"` or its x-channel has a\n[continuous scale](scale.html#continuous), the width will be the value of\n[`config.view.width`](spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric\nvalue or unspecified, the width is [determined by the range step, paddings, and the\ncardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the\n`rangeStep` is `null`, the width will be the value of\n[`config.view.width`](spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of\n[`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and\nthe value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this\nrepresents the width of a single view.\n\n__See also:__ The documentation for [width and height](size.html) contains more examples."
38804831 }
38814832 },
38824833 "required": [
3883- "length"
4834+ "encoding",
4835+ "mark"
38844836 ],
3885- "title": "FluffyPrecision",
3886- "description": "Sets the threshold for the projection’s [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [Douglas–Peucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection’s current resampling precision which defaults to `√0.5 ≅ 0.70710…`."
4837+ "title": "CompositeUnitSpecAlias",
4838+ "description": "Unit spec that can have a composite mark."
38874839 },
38884840 "Resolve": {
38894841 "type": "object",
@@ -3963,260 +4915,308 @@
39634915 "required": [],
39644916 "title": "ScaleResolveMap"
39654917 },
3966- "SelectionDef": {
4918+ "Encoding": {
39674919 "type": "object",
39684920 "additionalProperties": false,
39694921 "properties": {
3970- "bind": {
3971- "$ref": "#/definitions/BindUnion",
3972- "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](bind.html) documentation for more information.\n\nEstablishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view."
4922+ "color": {
4923+ "$ref": "#/definitions/Color",
4924+ "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark\nconfig](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color\nscheme](scale.html#scheme)."
39734925 },
3974- "empty": {
3975- "$ref": "#/definitions/Empty",
3976- "description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values."
4926+ "detail": {
4927+ "$ref": "#/definitions/Detail",
4928+ "description": "Additional levels of detail for grouping data in aggregate views and\nin line and area marks without mapping data to a specific visual channel."
39774929 },
3978- "encodings": {
3979- "type": "array",
3980- "items": {
3981- "$ref": "#/definitions/SingleDefChannel"
3982- },
3983- "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection."
4930+ "href": {
4931+ "$ref": "#/definitions/Href",
4932+ "description": "A URL to load upon mouse click."
39844933 },
3985- "fields": {
3986- "type": "array",
3987- "items": {
3988- "type": "string"
3989- },
3990- "description": "An array of field names whose values must match for a data tuple to\nfall within the selection."
4934+ "opacity": {
4935+ "$ref": "#/definitions/Color",
4936+ "description": "Opacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark\nconfig](config.html#mark)'s `opacity` property."
39914937 },
3992- "nearest": {
3993- "type": "boolean",
3994- "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](nearest.html) documentation for more information."
4938+ "order": {
4939+ "$ref": "#/definitions/Order",
4940+ "description": "Stack order for stacked marks or order of data points in line marks for connected scatter\nplots.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating\nadditional aggregation grouping."
39954941 },
3996- "on": {
3997- "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or\nselector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and\nend](https://vega.github.io/vega/docs/event-streams/#between-filters)."
4942+ "shape": {
4943+ "$ref": "#/definitions/Color",
4944+ "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark\nconfig](config.html#point-config)'s `shape` property."
39984945 },
3999- "resolve": {
4000- "$ref": "#/definitions/SelectionResolution",
4001- "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
4946+ "size": {
4947+ "$ref": "#/definitions/Color",
4948+ "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`."
40024949 },
4003- "type": {
4004- "$ref": "#/definitions/SelectionDefType"
4950+ "text": {
4951+ "$ref": "#/definitions/Text",
4952+ "description": "Text of the `text` mark."
40054953 },
4006- "toggle": {
4007- "$ref": "#/definitions/Translate",
4008- "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\nSee the [toggle transform](toggle.html) documentation for more information."
4954+ "tooltip": {
4955+ "$ref": "#/definitions/Text",
4956+ "description": "The tooltip text to show upon mouse hover."
40094957 },
4010- "mark": {
4011- "$ref": "#/definitions/BrushConfig",
4012- "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark."
4958+ "x": {
4959+ "$ref": "#/definitions/X",
4960+ "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`."
40134961 },
4014- "translate": {
4015- "$ref": "#/definitions/Translate",
4016- "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it."
4962+ "x2": {
4963+ "$ref": "#/definitions/X2",
4964+ "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
40174965 },
4018- "zoom": {
4019- "$ref": "#/definitions/Translate",
4020- "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n\n__Default value:__ `true`, which corresponds to `wheel!`."
4966+ "y": {
4967+ "$ref": "#/definitions/X",
4968+ "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`."
4969+ },
4970+ "y2": {
4971+ "$ref": "#/definitions/X2",
4972+ "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
40214973 }
40224974 },
4023- "required": [
4024- "type"
4025- ],
4026- "title": "SelectionDef"
4975+ "required": [],
4976+ "title": "Encoding",
4977+ "description": "A key-value mapping between encoding channels and definition of fields."
40274978 },
4028- "VGBinding": {
4979+ "FacetMapping": {
40294980 "type": "object",
40304981 "additionalProperties": false,
40314982 "properties": {
4032- "element": {
4033- "type": "string"
4034- },
4035- "input": {
4036- "type": "string"
4983+ "column": {
4984+ "$ref": "#/definitions/FacetFieldDef",
4985+ "description": "Horizontal facets for trellis plots."
40374986 },
4038- "options": {
4987+ "row": {
4988+ "$ref": "#/definitions/FacetFieldDef",
4989+ "description": "Vertical facets for trellis plots."
4990+ }
4991+ },
4992+ "required": [],
4993+ "title": "FacetMapping",
4994+ "description": "An object that describes mappings between `row` and `column` channels and their field definitions."
4995+ },
4996+ "Repeat": {
4997+ "type": "object",
4998+ "additionalProperties": false,
4999+ "properties": {
5000+ "column": {
40395001 "type": "array",
40405002 "items": {
40415003 "type": "string"
4042- }
4043- },
4044- "max": {
4045- "type": "number"
4046- },
4047- "min": {
4048- "type": "number"
5004+ },
5005+ "description": "Horizontal repeated views."
40495006 },
4050- "step": {
4051- "type": "number"
5007+ "row": {
5008+ "type": "array",
5009+ "items": {
5010+ "type": "string"
5011+ },
5012+ "description": "Vertical repeated views."
40525013 }
40535014 },
4054- "required": [
4055- "input"
4056- ],
4057- "title": "VGBinding"
5015+ "required": [],
5016+ "title": "Repeat",
5017+ "description": "An object that describes what fields should be repeated into views that are laid out as a `row` or `column`."
40585018 },
4059- "TitleParams": {
5019+ "FacetSpec": {
40605020 "type": "object",
40615021 "additionalProperties": false,
40625022 "properties": {
4063- "anchor": {
4064- "$ref": "#/definitions/Anchor",
4065- "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For\nexample, with an orientation of top these anchor positions map to a left-, center-, or\nright-aligned title.\n\n__Default value:__ `\"middle\"` for [single](spec.html) and [layered](layer.html) views.\n`\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only\ncustomizable only for [single](spec.html) and [layered](layer.html) views. For other\ncomposite views, `anchor` is always `\"start\"`."
4066- },
4067- "offset": {
4068- "type": "number",
4069- "description": "The orthogonal offset in pixels by which to displace the title from its position along\nthe edge of the chart."
5023+ "data": {
5024+ "$ref": "#/definitions/Data",
5025+ "description": "An object describing the data source"
40705026 },
4071- "orient": {
4072- "$ref": "#/definitions/TitleOrient",
4073- "description": "The orientation of the title relative to the chart. One of `\"top\"` (the default),\n`\"bottom\"`, `\"left\"`, or `\"right\"`."
5027+ "description": {
5028+ "type": "string",
5029+ "description": "Description of this mark for commenting purpose."
40745030 },
4075- "style": {
4076- "$ref": "#/definitions/Style",
4077- "description": "A [mark style property](config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`."
5031+ "facet": {
5032+ "$ref": "#/definitions/FacetMapping",
5033+ "description": "An object that describes mappings between `row` and `column` channels and their field\ndefinitions."
40785034 },
4079- "text": {
5035+ "name": {
40805036 "type": "string",
4081- "description": "The title text."
5037+ "description": "Name of the visualization for later reference."
5038+ },
5039+ "resolve": {
5040+ "$ref": "#/definitions/Resolve",
5041+ "description": "Scale, axis, and legend resolutions for facets."
5042+ },
5043+ "spec": {
5044+ "$ref": "#/definitions/SpecElement",
5045+ "description": "A specification of the view that gets faceted."
5046+ },
5047+ "title": {
5048+ "$ref": "#/definitions/Title",
5049+ "description": "Title for the plot."
5050+ },
5051+ "transform": {
5052+ "type": "array",
5053+ "items": {
5054+ "$ref": "#/definitions/Transform"
5055+ },
5056+ "description": "An array of data transformations such as filter and new field calculation."
40825057 }
40835058 },
40845059 "required": [
4085- "text"
5060+ "facet",
5061+ "spec"
40865062 ],
4087- "title": "TitleParams"
5063+ "title": "FacetSpec"
40885064 },
4089- "Transform": {
5065+ "RepeatSpec": {
40905066 "type": "object",
40915067 "additionalProperties": false,
40925068 "properties": {
4093- "filter": {
4094- "$ref": "#/definitions/LogicalOperandPredicate",
4095- "description": "The `filter` property must be one of the predicate definitions:\n(1) an [expression](types.html#expression) string,\nwhere `datum` can be used to refer to the current data object;\n(2) one of the field predicates: [equal predicate](filter.html#equal-predicate);\n[range predicate](filter.html#range-predicate), [one-of\npredicate](filter.html#one-of-predicate);\n(3) a [selection predicate](filter.html#selection-predicate);\nor (4) a logical operand that combines (1), (2), or (3)."
4096- },
4097- "as": {
4098- "$ref": "#/definitions/Style",
4099- "description": "The field for storing the computed formula value.\n\nThe field or fields for storing the computed formula value.\nIf `from.fields` is specified, the transform will use the same names for `as`.\nIf `from.fields` is not specified, `as` has to be a string and we put the whole object\ninto the data under the specified name.\n\nThe output fields at which to write the start and end bin values.\n\nThe output field to write the timeUnit value."
4100- },
4101- "calculate": {
4102- "type": "string",
4103- "description": "A [expression](types.html#expression) string. Use the variable `datum` to refer to the\ncurrent data object."
5069+ "data": {
5070+ "$ref": "#/definitions/Data",
5071+ "description": "An object describing the data source"
41045072 },
4105- "default": {
5073+ "description": {
41065074 "type": "string",
4107- "description": "The default value to use if lookup fails.\n\n__Default value:__ `null`"
4108- },
4109- "from": {
4110- "$ref": "#/definitions/LookupData",
4111- "description": "Secondary data reference."
5075+ "description": "Description of this mark for commenting purpose."
41125076 },
4113- "lookup": {
5077+ "name": {
41145078 "type": "string",
4115- "description": "Key in primary data source."
5079+ "description": "Name of the visualization for later reference."
41165080 },
4117- "bin": {
4118- "$ref": "#/definitions/Bin",
4119- "description": "An object indicating bin properties, or simply `true` for using default bin parameters."
5081+ "repeat": {
5082+ "$ref": "#/definitions/Repeat",
5083+ "description": "An object that describes what fields should be repeated into views that are laid out as a\n`row` or `column`."
41205084 },
4121- "field": {
4122- "type": "string",
4123- "description": "The data field to bin.\n\nThe data field to apply time unit."
5085+ "resolve": {
5086+ "$ref": "#/definitions/Resolve",
5087+ "description": "Scale and legend resolutions for repeated charts."
41245088 },
4125- "timeUnit": {
4126- "$ref": "#/definitions/TimeUnit",
4127- "description": "The timeUnit."
5089+ "spec": {
5090+ "$ref": "#/definitions/Spec"
41285091 },
4129- "aggregate": {
4130- "type": "array",
4131- "items": {
4132- "$ref": "#/definitions/AggregatedFieldDef"
4133- },
4134- "description": "Array of objects that define fields to aggregate."
5092+ "title": {
5093+ "$ref": "#/definitions/Title",
5094+ "description": "Title for the plot."
41355095 },
4136- "groupby": {
5096+ "transform": {
41375097 "type": "array",
41385098 "items": {
4139- "type": "string"
5099+ "$ref": "#/definitions/Transform"
41405100 },
4141- "description": "The data fields to group by. If not specified, a single group containing all data objects\nwill be used."
5101+ "description": "An array of data transformations such as filter and new field calculation."
41425102 }
41435103 },
4144- "required": [],
4145- "title": "Transform"
5104+ "required": [
5105+ "repeat",
5106+ "spec"
5107+ ],
5108+ "title": "RepeatSpec"
41465109 },
4147- "AggregatedFieldDef": {
5110+ "VConcatSpec": {
41485111 "type": "object",
41495112 "additionalProperties": false,
41505113 "properties": {
4151- "as": {
5114+ "data": {
5115+ "$ref": "#/definitions/Data",
5116+ "description": "An object describing the data source"
5117+ },
5118+ "description": {
41525119 "type": "string",
4153- "description": "The output field names to use for each aggregated field."
5120+ "description": "Description of this mark for commenting purpose."
41545121 },
4155- "field": {
5122+ "name": {
41565123 "type": "string",
4157- "description": "The data field for which to compute aggregate function."
5124+ "description": "Name of the visualization for later reference."
41585125 },
4159- "op": {
4160- "$ref": "#/definitions/AggregateOp",
4161- "description": "The aggregation operations to apply to the fields, such as sum, average or count.\nSee the [full list of supported aggregation\noperations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)\nfor more information."
5126+ "resolve": {
5127+ "$ref": "#/definitions/Resolve",
5128+ "description": "Scale, axis, and legend resolutions for vertically concatenated charts."
5129+ },
5130+ "title": {
5131+ "$ref": "#/definitions/Title",
5132+ "description": "Title for the plot."
5133+ },
5134+ "transform": {
5135+ "type": "array",
5136+ "items": {
5137+ "$ref": "#/definitions/Transform"
5138+ },
5139+ "description": "An array of data transformations such as filter and new field calculation."
5140+ },
5141+ "vconcat": {
5142+ "type": "array",
5143+ "items": {
5144+ "$ref": "#/definitions/Spec"
5145+ },
5146+ "description": "A list of views that should be concatenated and put into a column."
41625147 }
41635148 },
41645149 "required": [
4165- "as",
4166- "field",
4167- "op"
5150+ "vconcat"
41685151 ],
4169- "title": "AggregatedFieldDef"
5152+ "title": "VConcatSpec"
41705153 },
4171- "LookupData": {
5154+ "HConcatSpec": {
41725155 "type": "object",
41735156 "additionalProperties": false,
41745157 "properties": {
41755158 "data": {
41765159 "$ref": "#/definitions/Data",
4177- "description": "Secondary data source to lookup in."
5160+ "description": "An object describing the data source"
41785161 },
4179- "fields": {
5162+ "description": {
5163+ "type": "string",
5164+ "description": "Description of this mark for commenting purpose."
5165+ },
5166+ "hconcat": {
41805167 "type": "array",
41815168 "items": {
4182- "type": "string"
5169+ "$ref": "#/definitions/Spec"
41835170 },
4184- "description": "Fields in foreign data to lookup.\nIf not specified, the entire object is queried."
5171+ "description": "A list of views that should be concatenated and put into a row."
41855172 },
4186- "key": {
5173+ "name": {
41875174 "type": "string",
4188- "description": "Key in data to lookup."
5175+ "description": "Name of the visualization for later reference."
5176+ },
5177+ "resolve": {
5178+ "$ref": "#/definitions/Resolve",
5179+ "description": "Scale, axis, and legend resolutions for horizontally concatenated charts."
5180+ },
5181+ "title": {
5182+ "$ref": "#/definitions/Title",
5183+ "description": "Title for the plot."
5184+ },
5185+ "transform": {
5186+ "type": "array",
5187+ "items": {
5188+ "$ref": "#/definitions/Transform"
5189+ },
5190+ "description": "An array of data transformations such as filter and new field calculation."
41895191 }
41905192 },
41915193 "required": [
4192- "data",
4193- "key"
5194+ "hconcat"
41945195 ],
4195- "title": "LookupData",
4196- "description": "Secondary data reference."
5196+ "title": "HConcatSpec"
41975197 },
4198- "Repeat": {
4199- "type": "object",
4200- "additionalProperties": false,
4201- "properties": {
4202- "column": {
4203- "type": "array",
4204- "items": {
4205- "type": "string"
4206- },
4207- "description": "Horizontal repeated views."
5198+ "TopLevel": {
5199+ "anyOf": [
5200+ {
5201+ "$ref": "#/definitions/TopLevelFacetedUnitSpec"
5202+ },
5203+ {
5204+ "$ref": "#/definitions/TopLevelLayerSpec"
5205+ },
5206+ {
5207+ "$ref": "#/definitions/TopLevelFacetSpec"
5208+ },
5209+ {
5210+ "$ref": "#/definitions/TopLevelRepeatSpec"
42085211 },
4209- "row": {
4210- "type": "array",
4211- "items": {
4212- "type": "string"
4213- },
4214- "description": "Vertical repeated views."
5212+ {
5213+ "$ref": "#/definitions/TopLevelVConcatSpec"
5214+ },
5215+ {
5216+ "$ref": "#/definitions/TopLevelHConcatSpec"
42155217 }
4216- },
4217- "required": [],
4218- "title": "Repeat",
4219- "description": "An object that describes what fields should be repeated into views that are laid out as a `row` or `column`."
5218+ ],
5219+ "title": "TopLevel"
42205220 },
42215221 "Autosize": {
42225222 "anyOf": [
@@ -4288,7 +5288,7 @@
42885288 }
42895289 },
42905290 {
4291- "$ref": "#/definitions/CategoryVGScheme"
5291+ "$ref": "#/definitions/VGScheme"
42925292 }
42935293 ],
42945294 "title": "Category",
@@ -4303,7 +5303,10 @@
43035303 }
43045304 },
43055305 {
4306- "$ref": "#/definitions/RangeConfigValueVGScheme"
5306+ "$ref": "#/definitions/VGScheme"
5307+ },
5308+ {
5309+ "$ref": "#/definitions/RangeConfigValueClass"
43075310 }
43085311 ],
43095312 "title": "RangeConfigValue"
@@ -4332,6 +5335,56 @@
43325335 "title": "Translate",
43335336 "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it.\nWhen truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n\n__Default value:__ `true`, which corresponds to `wheel!`.\nControls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\nSee the [toggle transform](toggle.html) documentation for more information."
43345337 },
5338+ "VGBinding": {
5339+ "anyOf": [
5340+ {
5341+ "$ref": "#/definitions/VGCheckboxBinding"
5342+ },
5343+ {
5344+ "$ref": "#/definitions/VGRadioBinding"
5345+ },
5346+ {
5347+ "$ref": "#/definitions/VGSelectBinding"
5348+ },
5349+ {
5350+ "$ref": "#/definitions/VGRangeBinding"
5351+ },
5352+ {
5353+ "$ref": "#/definitions/VGGenericBinding"
5354+ }
5355+ ],
5356+ "title": "VGBinding"
5357+ },
5358+ "Data": {
5359+ "anyOf": [
5360+ {
5361+ "$ref": "#/definitions/URLData"
5362+ },
5363+ {
5364+ "$ref": "#/definitions/InlineData"
5365+ },
5366+ {
5367+ "$ref": "#/definitions/NamedData"
5368+ }
5369+ ],
5370+ "title": "Data",
5371+ "description": "An object describing the data source\nSecondary data source to lookup in."
5372+ },
5373+ "DataFormat": {
5374+ "anyOf": [
5375+ {
5376+ "$ref": "#/definitions/CSVDataFormat"
5377+ },
5378+ {
5379+ "$ref": "#/definitions/JSONDataFormat"
5380+ },
5381+ {
5382+ "$ref": "#/definitions/TopoDataFormat"
5383+ }
5384+ ],
5385+ "title": "DataFormat",
5386+ "description": "An object that specifies the format for parsing the data file.\nAn object that specifies the format for parsing the data values.\nAn object that specifies the format for parsing the data."
5387+ },
43355388 "ParseUnion": {
43365389 "anyOf": [
43375390 {
@@ -4381,6 +5434,18 @@
43815434 ],
43825435 "title": "ValuesValue"
43835436 },
5437+ "Color": {
5438+ "anyOf": [
5439+ {
5440+ "$ref": "#/definitions/MarkPropFieldDefWithCondition"
5441+ },
5442+ {
5443+ "$ref": "#/definitions/MarkPropValueDefWithCondition"
5444+ }
5445+ ],
5446+ "title": "Color",
5447+ "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color scheme](scale.html#scheme).\nOpacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](config.html#mark)'s `opacity` property.\nFor `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](config.html#point-config)'s `shape` property.\nSize of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`."
5448+ },
43845449 "Bin": {
43855450 "anyOf": [
43865451 {
@@ -4392,7 +5457,7 @@
43925457 ],
43935458 "title": "Bin"
43945459 },
4395- "ColorCondition": {
5460+ "ConditionUnion": {
43965461 "anyOf": [
43975462 {
43985463 "type": "array",
@@ -4401,27 +5466,47 @@
44015466 }
44025467 },
44035468 {
4404- "$ref": "#/definitions/ConditionalPredicateMarkPropFieldDefClass"
5469+ "$ref": "#/definitions/ConditionalPredicateValueDef"
5470+ },
5471+ {
5472+ "$ref": "#/definitions/ConditionalSelectionValueDef"
44055473 }
44065474 ],
4407- "title": "ColorCondition"
5475+ "title": "ConditionUnion"
44085476 },
4409- "SelectionOperand": {
5477+ "ConditionalValueDef": {
44105478 "anyOf": [
44115479 {
4412- "$ref": "#/definitions/Selection"
5480+ "$ref": "#/definitions/ConditionalPredicateValueDef"
44135481 },
44145482 {
4415- "type": "string"
5483+ "$ref": "#/definitions/ConditionalSelectionValueDef"
44165484 }
44175485 ],
4418- "title": "SelectionOperand",
4419- "description": "Filter using a selection name.\nA [selection name](selection.html), or a series of [composed selections](selection.html#compose)."
5486+ "title": "ConditionalValueDef"
44205487 },
44215488 "LogicalOperandPredicate": {
44225489 "anyOf": [
44235490 {
4424- "$ref": "#/definitions/Predicate"
5491+ "$ref": "#/definitions/LogicalNotPredicate"
5492+ },
5493+ {
5494+ "$ref": "#/definitions/LogicalAndPredicate"
5495+ },
5496+ {
5497+ "$ref": "#/definitions/LogicalOrPredicate"
5498+ },
5499+ {
5500+ "$ref": "#/definitions/FieldEqualPredicate"
5501+ },
5502+ {
5503+ "$ref": "#/definitions/FieldRangePredicate"
5504+ },
5505+ {
5506+ "$ref": "#/definitions/FieldOneOfPredicate"
5507+ },
5508+ {
5509+ "$ref": "#/definitions/SelectionPredicate"
44255510 },
44265511 {
44275512 "type": "string"
@@ -4472,7 +5557,25 @@
44725557 ],
44735558 "title": "RangeElement"
44745559 },
4475- "ConditionalValueDefValue": {
5560+ "SelectionOperand": {
5561+ "anyOf": [
5562+ {
5563+ "$ref": "#/definitions/SelectionNot"
5564+ },
5565+ {
5566+ "$ref": "#/definitions/SelectionAnd"
5567+ },
5568+ {
5569+ "$ref": "#/definitions/SelectionOr"
5570+ },
5571+ {
5572+ "type": "string"
5573+ }
5574+ ],
5575+ "title": "SelectionOperand",
5576+ "description": "Filter using a selection name.\nA [selection name](selection.html), or a series of [composed selections](selection.html#compose)."
5577+ },
5578+ "ConditionValue": {
44765579 "anyOf": [
44775580 {
44785581 "type": "boolean"
@@ -4484,7 +5587,7 @@
44845587 "type": "string"
44855588 }
44865589 ],
4487- "title": "ConditionalValueDefValue",
5590+ "title": "ConditionValue",
44885591 "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).\nA constant value in visual domain."
44895592 },
44905593 "Field": {
@@ -4522,7 +5625,10 @@
45225625 "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data."
45235626 },
45245627 {
4525- "$ref": "#/definitions/DomainClass"
5628+ "$ref": "#/definitions/PurpleSelectionDomain"
5629+ },
5630+ {
5631+ "$ref": "#/definitions/FluffySelectionDomain"
45265632 },
45275633 {
45285634 "$ref": "#/definitions/Domain"
@@ -4612,7 +5718,7 @@
46125718 "$ref": "#/definitions/SortField"
46135719 },
46145720 {
4615- "$ref": "#/definitions/SortEnum"
5721+ "$ref": "#/definitions/SortOrderEnum"
46165722 },
46175723 {
46185724 "type": "null"
@@ -4620,6 +5726,30 @@
46205726 ],
46215727 "title": "SortUnion"
46225728 },
5729+ "ColorCondition": {
5730+ "anyOf": [
5731+ {
5732+ "type": "array",
5733+ "items": {
5734+ "$ref": "#/definitions/ConditionalValueDef"
5735+ }
5736+ },
5737+ {
5738+ "$ref": "#/definitions/ConditionalPredicateMarkPropFieldDef"
5739+ },
5740+ {
5741+ "$ref": "#/definitions/ConditionalSelectionMarkPropFieldDef"
5742+ },
5743+ {
5744+ "$ref": "#/definitions/ConditionalPredicateValueDef"
5745+ },
5746+ {
5747+ "$ref": "#/definitions/ConditionalSelectionValueDef"
5748+ }
5749+ ],
5750+ "title": "ColorCondition",
5751+ "description": "A field definition or one or more value definition(s) with a selection predicate."
5752+ },
46235753 "Detail": {
46245754 "anyOf": [
46255755 {
@@ -4634,6 +5764,18 @@
46345764 ],
46355765 "title": "Detail"
46365766 },
5767+ "Href": {
5768+ "anyOf": [
5769+ {
5770+ "$ref": "#/definitions/FieldDefWithCondition"
5771+ },
5772+ {
5773+ "$ref": "#/definitions/ValueDefWithCondition"
5774+ }
5775+ ],
5776+ "title": "Href",
5777+ "description": "A URL to load upon mouse click."
5778+ },
46375779 "HrefCondition": {
46385780 "anyOf": [
46395781 {
@@ -4643,10 +5785,20 @@
46435785 }
46445786 },
46455787 {
4646- "$ref": "#/definitions/ConditionalPredicateFieldDefClass"
5788+ "$ref": "#/definitions/ConditionalPredicateFieldDef"
5789+ },
5790+ {
5791+ "$ref": "#/definitions/ConditionalSelectionFieldDef"
5792+ },
5793+ {
5794+ "$ref": "#/definitions/ConditionalPredicateValueDef"
5795+ },
5796+ {
5797+ "$ref": "#/definitions/ConditionalSelectionValueDef"
46475798 }
46485799 ],
4649- "title": "HrefCondition"
5800+ "title": "HrefCondition",
5801+ "description": "A field definition or one or more value definition(s) with a selection predicate."
46505802 },
46515803 "Order": {
46525804 "anyOf": [
@@ -4662,6 +5814,18 @@
46625814 ],
46635815 "title": "Order"
46645816 },
5817+ "Text": {
5818+ "anyOf": [
5819+ {
5820+ "$ref": "#/definitions/TextFieldDefWithCondition"
5821+ },
5822+ {
5823+ "$ref": "#/definitions/TextValueDefWithCondition"
5824+ }
5825+ ],
5826+ "title": "Text",
5827+ "description": "Text of the `text` mark.\nThe tooltip text to show upon mouse hover."
5828+ },
46655829 "TextCondition": {
46665830 "anyOf": [
46675831 {
@@ -4671,10 +5835,32 @@
46715835 }
46725836 },
46735837 {
4674- "$ref": "#/definitions/ConditionalPredicateTextFieldDefClass"
5838+ "$ref": "#/definitions/ConditionalPredicateTextFieldDef"
5839+ },
5840+ {
5841+ "$ref": "#/definitions/ConditionalSelectionTextFieldDef"
5842+ },
5843+ {
5844+ "$ref": "#/definitions/ConditionalPredicateValueDef"
5845+ },
5846+ {
5847+ "$ref": "#/definitions/ConditionalSelectionValueDef"
5848+ }
5849+ ],
5850+ "title": "TextCondition",
5851+ "description": "A field definition or one or more value definition(s) with a selection predicate."
5852+ },
5853+ "X": {
5854+ "anyOf": [
5855+ {
5856+ "$ref": "#/definitions/PositionFieldDef"
5857+ },
5858+ {
5859+ "$ref": "#/definitions/ValueDef"
46755860 }
46765861 ],
4677- "title": "TextCondition"
5862+ "title": "X",
5863+ "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\nY coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`."
46785864 },
46795865 "AxisValue": {
46805866 "anyOf": [
@@ -4687,6 +5873,18 @@
46875873 ],
46885874 "title": "AxisValue"
46895875 },
5876+ "X2": {
5877+ "anyOf": [
5878+ {
5879+ "$ref": "#/definitions/FieldDef"
5880+ },
5881+ {
5882+ "$ref": "#/definitions/ValueDef"
5883+ }
5884+ ],
5885+ "title": "X2",
5886+ "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\nY2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`."
5887+ },
46905888 "AnyMark": {
46915889 "anyOf": [
46925890 {
@@ -4712,22 +5910,21 @@
47125910 }
47135911 ],
47145912 "title": "Style",
4715- "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the [style configuration](mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default.\n__Note:__ Any specified style will augment the default style. For example, a bar mark with `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the specified style `\"foo\"` has higher precedence).\nA [mark style property](config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`."
5913+ "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the [style configuration](mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default.\n__Note:__ Any specified style will augment the default style. For example, a bar mark with `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the specified style `\"foo\"` has higher precedence).\nA [mark style property](config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`.\nThe field or fields for storing the computed formula value.\nIf `from.fields` is specified, the transform will use the same names for `as`.\nIf `from.fields` is not specified, `as` has to be a string and we put the whole object into the data under the specified name."
47165914 },
4717- "BindUnion": {
5915+ "SelectionDef": {
47185916 "anyOf": [
47195917 {
4720- "$ref": "#/definitions/BindEnum"
5918+ "$ref": "#/definitions/SingleSelection"
47215919 },
47225920 {
4723- "type": "object",
4724- "additionalProperties": {
4725- "$ref": "#/definitions/VGBinding"
4726- },
4727- "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](bind.html) documentation for more information."
5921+ "$ref": "#/definitions/MultiSelection"
5922+ },
5923+ {
5924+ "$ref": "#/definitions/IntervalSelection"
47285925 }
47295926 ],
4730- "title": "BindUnion"
5927+ "title": "SelectionDef"
47315928 },
47325929 "Title": {
47335930 "anyOf": [
@@ -4740,6 +5937,63 @@
47405937 ],
47415938 "title": "Title"
47425939 },
5940+ "Transform": {
5941+ "anyOf": [
5942+ {
5943+ "$ref": "#/definitions/FilterTransform"
5944+ },
5945+ {
5946+ "$ref": "#/definitions/CalculateTransform"
5947+ },
5948+ {
5949+ "$ref": "#/definitions/LookupTransform"
5950+ },
5951+ {
5952+ "$ref": "#/definitions/BinTransform"
5953+ },
5954+ {
5955+ "$ref": "#/definitions/TimeUnitTransform"
5956+ },
5957+ {
5958+ "$ref": "#/definitions/AggregateTransform"
5959+ }
5960+ ],
5961+ "title": "Transform"
5962+ },
5963+ "SpecElement": {
5964+ "anyOf": [
5965+ {
5966+ "$ref": "#/definitions/LayerSpec"
5967+ },
5968+ {
5969+ "$ref": "#/definitions/CompositeUnitSpecAlias"
5970+ }
5971+ ],
5972+ "title": "SpecElement"
5973+ },
5974+ "Spec": {
5975+ "anyOf": [
5976+ {
5977+ "$ref": "#/definitions/CompositeUnitSpecAlias"
5978+ },
5979+ {
5980+ "$ref": "#/definitions/LayerSpec"
5981+ },
5982+ {
5983+ "$ref": "#/definitions/FacetSpec"
5984+ },
5985+ {
5986+ "$ref": "#/definitions/RepeatSpec"
5987+ },
5988+ {
5989+ "$ref": "#/definitions/VConcatSpec"
5990+ },
5991+ {
5992+ "$ref": "#/definitions/HConcatSpec"
5993+ }
5994+ ],
5995+ "title": "Spec"
5996+ },
47435997 "AutosizeType": {
47445998 "type": "string",
47455999 "enum": [
@@ -4908,6 +6162,14 @@
49086162 "title": "VGProjectionType",
49096163 "description": "The cartographic projection to use. This value is case-insensitive, for example `\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid projection types [in the documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`"
49106164 },
6165+ "Bind": {
6166+ "type": "string",
6167+ "enum": [
6168+ "scales"
6169+ ],
6170+ "title": "Bind",
6171+ "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view."
6172+ },
49116173 "Empty": {
49126174 "type": "string",
49136175 "enum": [
@@ -4946,6 +6208,34 @@
49466208 "title": "SelectionResolution",
49476209 "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain."
49486210 },
6211+ "PurpleInput": {
6212+ "type": "string",
6213+ "enum": [
6214+ "checkbox"
6215+ ],
6216+ "title": "PurpleInput"
6217+ },
6218+ "FluffyInput": {
6219+ "type": "string",
6220+ "enum": [
6221+ "radio"
6222+ ],
6223+ "title": "FluffyInput"
6224+ },
6225+ "TentacledInput": {
6226+ "type": "string",
6227+ "enum": [
6228+ "select"
6229+ ],
6230+ "title": "TentacledInput"
6231+ },
6232+ "StickyInput": {
6233+ "type": "string",
6234+ "enum": [
6235+ "range"
6236+ ],
6237+ "title": "StickyInput"
6238+ },
49496239 "Anchor": {
49506240 "type": "string",
49516241 "enum": [
@@ -4974,15 +6264,29 @@
49746264 ],
49756265 "title": "ParseEnum"
49766266 },
4977- "DataFormatType": {
6267+ "PurpleType": {
49786268 "type": "string",
49796269 "enum": [
49806270 "csv",
4981- "tsv",
4982- "json",
6271+ "tsv"
6272+ ],
6273+ "title": "PurpleType",
6274+ "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
6275+ },
6276+ "FluffyType": {
6277+ "type": "string",
6278+ "enum": [
6279+ "json"
6280+ ],
6281+ "title": "FluffyType",
6282+ "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
6283+ },
6284+ "TentacledType": {
6285+ "type": "string",
6286+ "enum": [
49836287 "topojson"
49846288 ],
4985- "title": "DataFormatType",
6289+ "title": "TentacledType",
49866290 "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default."
49876291 },
49886292 "AggregateOp": {
@@ -5149,13 +6453,13 @@
51496453 "title": "ScaleType",
51506454 "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`\"linear\"`](scale.html#linear), [`\"pow\"`](scale.html#pow), [`\"sqrt\"`](scale.html#sqrt), [`\"log\"`](scale.html#log), [`\"time\"`](scale.html#time), [`\"utc\"`](scale.html#utc), [`\"sequential\"`](scale.html#sequential)).\n\n2) [**Discrete Scales**](scale.html#discrete) -- mapping discrete domains to discrete ([`\"ordinal\"`](scale.html#ordinal)) or continuous ([`\"band\"`](scale.html#band) and [`\"point\"`](scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](scale.html#discretizing) -- mapping continuous domains to discrete output ranges ([`\"bin-linear\"`](scale.html#bin-linear) and [`\"bin-ordinal\"`](scale.html#bin-ordinal)).\n\n__Default value:__ please see the [scale type table](scale.html#type)."
51516455 },
5152- "SortEnum": {
6456+ "SortOrderEnum": {
51536457 "type": "string",
51546458 "enum": [
51556459 "ascending",
51566460 "descending"
51576461 ],
5158- "title": "SortEnum"
6462+ "title": "SortOrderEnum"
51596463 },
51606464 "Type": {
51616465 "type": "string",
@@ -5199,30 +6503,34 @@
51996503 "title": "Mark",
52006504 "description": "All types of primitive marks.\nThe mark type.\nOne of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`."
52016505 },
5202- "ResolveMode": {
6506+ "StickyType": {
52036507 "type": "string",
52046508 "enum": [
5205- "independent",
5206- "shared"
6509+ "single"
52076510 ],
5208- "title": "ResolveMode"
6511+ "title": "StickyType"
52096512 },
5210- "BindEnum": {
6513+ "IndigoType": {
52116514 "type": "string",
52126515 "enum": [
5213- "scales"
6516+ "multi"
52146517 ],
5215- "title": "BindEnum",
5216- "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view."
6518+ "title": "IndigoType"
52176519 },
5218- "SelectionDefType": {
6520+ "IndecentType": {
52196521 "type": "string",
52206522 "enum": [
5221- "single",
5222- "multi",
52236523 "interval"
52246524 ],
5225- "title": "SelectionDefType"
6525+ "title": "IndecentType"
6526+ },
6527+ "ResolveMode": {
6528+ "type": "string",
6529+ "enum": [
6530+ "independent",
6531+ "shared"
6532+ ],
6533+ "title": "ResolveMode"
52266534 }
52276535 }
52286536 }
Aschema-swift/test/inputs/schema/one-of-objects.schema/default/quicktype.swift+142 −0
@@ -0,0 +1,142 @@
1+// This file was generated from JSON Schema using quicktype, do not modify it directly.
2+// To parse the JSON, add this file to your project and do:
3+//
4+// let topLevel = try TopLevel(json)
5+
6+import Foundation
7+
8+// MARK: - TopLevel
9+struct TopLevel: Codable {
10+ let items: [Item]
11+
12+ enum CodingKeys: String, CodingKey {
13+ case items = "items"
14+ }
15+}
16+
17+// MARK: TopLevel convenience initializers and mutators
18+
19+extension TopLevel {
20+ init(data: Data) throws {
21+ self = try newJSONDecoder().decode(TopLevel.self, from: data)
22+ }
23+
24+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
25+ guard let data = json.data(using: encoding) else {
26+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
27+ }
28+ try self.init(data: data)
29+ }
30+
31+ init(fromURL url: URL) throws {
32+ try self.init(data: try Data(contentsOf: url))
33+ }
34+
35+ func with(
36+ items: [Item]? = nil
37+ ) -> TopLevel {
38+ return TopLevel(
39+ items: items ?? self.items
40+ )
41+ }
42+
43+ func jsonData() throws -> Data {
44+ return try newJSONEncoder().encode(self)
45+ }
46+
47+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
48+ return String(data: try self.jsonData(), encoding: encoding)
49+ }
50+}
51+
52+// MARK: - Item
53+struct Item: Codable {
54+ let aa: String?
55+ let bb: String?
56+ let cc: String?
57+ let dd: String?
58+
59+ enum CodingKeys: String, CodingKey {
60+ case aa = "aa"
61+ case bb = "bb"
62+ case cc = "cc"
63+ case dd = "dd"
64+ }
65+}
66+
67+// MARK: Item convenience initializers and mutators
68+
69+extension Item {
70+ init(data: Data) throws {
71+ self = try newJSONDecoder().decode(Item.self, from: data)
72+ }
73+
74+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
75+ guard let data = json.data(using: encoding) else {
76+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
77+ }
78+ try self.init(data: data)
79+ }
80+
81+ init(fromURL url: URL) throws {
82+ try self.init(data: try Data(contentsOf: url))
83+ }
84+
85+ func with(
86+ aa: String?? = nil,
87+ bb: String?? = nil,
88+ cc: String?? = nil,
89+ dd: String?? = nil
90+ ) -> Item {
91+ return Item(
92+ aa: aa ?? self.aa,
93+ bb: bb ?? self.bb,
94+ cc: cc ?? self.cc,
95+ dd: dd ?? self.dd
96+ )
97+ }
98+
99+ func jsonData() throws -> Data {
100+ return try newJSONEncoder().encode(self)
101+ }
102+
103+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
104+ return String(data: try self.jsonData(), encoding: encoding)
105+ }
106+}
107+
108+// MARK: - Helper functions for creating encoders and decoders
109+
110+func newJSONDecoder() -> JSONDecoder {
111+ let decoder = JSONDecoder()
112+ decoder.dateDecodingStrategy = .custom({ (decoder) -> Date in
113+ let container = try decoder.singleValueContainer()
114+ let dateStr = try container.decode(String.self)
115+
116+ let formatter = DateFormatter()
117+ formatter.calendar = Calendar(identifier: .iso8601)
118+ formatter.locale = Locale(identifier: "en_US_POSIX")
119+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
120+ formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
121+ if let date = formatter.date(from: dateStr) {
122+ return date
123+ }
124+ formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX"
125+ if let date = formatter.date(from: dateStr) {
126+ return date
127+ }
128+ throw DecodingError.typeMismatch(Date.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Could not decode date"))
129+ })
130+ return decoder
131+}
132+
133+func newJSONEncoder() -> JSONEncoder {
134+ let encoder = JSONEncoder()
135+ let formatter = DateFormatter()
136+ formatter.calendar = Calendar(identifier: .iso8601)
137+ formatter.locale = Locale(identifier: "en_US_POSIX")
138+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
139+ formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX"
140+ encoder.dateEncodingStrategy = .formatted(formatter)
141+ return encoder
142+}
Aschema-typescript-zod/test/inputs/schema/one-of-objects.schema/default/TopLevel.ts+25 −11
@@ -11,11 +11,21 @@ export interface TopLevel {
1111 input: Item[];
1212 }
1313
14-export interface Item {
15- content?: string;
16- id?: string;
17- output?: string;
18- summary?: string;
14+export type Item = (Message & { "id"?: never; "output"?: never; "summary"?: never; }) | (FunctionOutput & { "content"?: never; "summary"?: never; }) | (ReasoningItem & { "content"?: never; "id"?: never; "output"?: never; });
15+
16+export interface Message {
17+ content: string;
18+ [property: string]: unknown;
19+}
20+
21+export interface FunctionOutput {
22+ id: string;
23+ output: string;
24+ [property: string]: unknown;
25+}
26+
27+export interface ReasoningItem {
28+ summary: string;
1929 [property: string]: unknown;
2030 }
2131
@@ -186,12 +196,16 @@ function r(name: string) {
186196
187197 const typeMap: any = {
188198 "TopLevel": o([
189- { json: "input", js: "input", typ: a(r("Item")) },
199+ { json: "input", js: "input", typ: a(u(r("Message"), r("FunctionOutput"), r("ReasoningItem"))) },
190200 ], false),
191- "Item": o([
192- { json: "content", js: "content", typ: u(undefined, "") },
193- { json: "id", js: "id", typ: u(undefined, "") },
194- { json: "output", js: "output", typ: u(undefined, "") },
195- { json: "summary", js: "summary", typ: u(undefined, "") },
201+ "Message": o([
202+ { json: "content", js: "content", typ: "" },
203+ ], "any"),
204+ "FunctionOutput": o([
205+ { json: "id", js: "id", typ: "" },
206+ { json: "output", js: "output", typ: "" },
207+ ], "any"),
208+ "ReasoningItem": o([
209+ { json: "summary", js: "summary", typ: "" },
196210 ], "any"),
197211 };
Mschema-typescript/test/inputs/schema/nested-intersection-union.schema/default/TopLevel.ts+24 −8
@@ -7,23 +7,33 @@
77 // These functions will throw an error if the JSON doesn't
88 // match the expected interface, even if the JSON is valid.
99
10-export interface TopLevel {
10+export type TopLevel = One | Two;
11+
12+export interface One {
13+ b: null | string;
14+ kind: PurpleKind;
15+ [property: string]: unknown;
16+}
17+
18+export type PurpleKind = "one";
19+
20+export interface Two {
1121 b?: null | string;
12- kind: Kind;
22+ kind: FluffyKind;
1323 [property: string]: unknown;
1424 }
1525
16-export type Kind = "one" | "two";
26+export type FluffyKind = "two";
1727
1828 // Converts JSON strings to/from your types
1929 // and asserts the results of JSON.parse at runtime
2030 export class Convert {
2131 public static toTopLevel(json: string): TopLevel {
22- return cast(JSON.parse(json), r("TopLevel"));
32+ return cast(JSON.parse(json), u(r("One"), r("Two")));
2333 }
2434
2535 public static topLevelToJson(value: TopLevel): string {
26- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
36+ return JSON.stringify(uncast(value, u(r("One"), r("Two"))), null, 2);
2737 }
2838 }
2939
@@ -181,12 +191,18 @@ function r(name: string) {
181191 }
182192
183193 const typeMap: any = {
184- "TopLevel": o([
194+ "One": o([
195+ { json: "b", js: "b", typ: u(null, "") },
196+ { json: "kind", js: "kind", typ: r("PurpleKind") },
197+ ], "any"),
198+ "Two": o([
185199 { json: "b", js: "b", typ: u(undefined, u(null, "")) },
186- { json: "kind", js: "kind", typ: r("Kind") },
200+ { json: "kind", js: "kind", typ: r("FluffyKind") },
187201 ], "any"),
188- "Kind": [
202+ "PurpleKind": [
189203 "one",
204+ ],
205+ "FluffyKind": [
190206 "two",
191207 ],
192208 };
Mschema-typescript/test/inputs/schema/nullable-optional-one-of.schema/default/TopLevel.ts+203 −0
@@ -0,0 +1,203 @@
1+// To parse this data:
2+//
3+// import { Convert, TopLevel } from "./TopLevel";
4+//
5+// const topLevel = Convert.toTopLevel(json);
6+//
7+// These functions will throw an error if the JSON doesn't
8+// match the expected interface, even if the JSON is valid.
9+
10+export interface TopLevel {
11+ items: ItemElement[];
12+}
13+
14+export type ItemElement = (PurpleItem & { "cc"?: never; "dd"?: never; }) | (FluffyItem & { "aa"?: never; "bb"?: never; });
15+
16+export interface PurpleItem {
17+ aa?: string;
18+ bb?: string;
19+}
20+
21+export interface FluffyItem {
22+ cc?: string;
23+ dd?: string;
24+}
25+
26+// Converts JSON strings to/from your types
27+// and asserts the results of JSON.parse at runtime
28+export class Convert {
29+ public static toTopLevel(json: string): TopLevel {
30+ return cast(JSON.parse(json), r("TopLevel"));
31+ }
32+
33+ public static topLevelToJson(value: TopLevel): string {
34+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
35+ }
36+}
37+
38+function invalidValue(typ: any, val: any, key: any, parent: any = ''): never {
39+ const prettyTyp = prettyTypeName(typ);
40+ const parentText = parent ? ` on ${parent}` : '';
41+ const keyText = key ? ` for key "${key}"` : '';
42+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
43+}
44+
45+function prettyTypeName(typ: any): string {
46+ if (Array.isArray(typ)) {
47+ if (typ.length === 2 && typ[0] === undefined) {
48+ return `an optional ${prettyTypeName(typ[1])}`;
49+ } else {
50+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
51+ }
52+ } else if (typeof typ === "object" && typ.literal !== undefined) {
53+ return typ.literal;
54+ } else {
55+ return typeof typ;
56+ }
57+}
58+
59+function jsonToJSProps(typ: any): any {
60+ if (typ.jsonToJS === undefined) {
61+ const map: any = {};
62+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
63+ typ.jsonToJS = map;
64+ }
65+ return typ.jsonToJS;
66+}
67+
68+function jsToJSONProps(typ: any): any {
69+ if (typ.jsToJSON === undefined) {
70+ const map: any = {};
71+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
72+ typ.jsToJSON = map;
73+ }
74+ return typ.jsToJSON;
75+}
76+
77+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
78+ function transformPrimitive(typ: string, val: any): any {
79+ if (typeof typ === typeof val) return val;
80+ return invalidValue(typ, val, key, parent);
81+ }
82+
83+ function transformUnion(typs: any[], val: any): any {
84+ // val must validate against one typ in typs
85+ const l = typs.length;
86+ for (let i = 0; i < l; i++) {
87+ const typ = typs[i];
88+ try {
89+ return transform(val, typ, getProps);
90+ } catch (_) {}
91+ }
92+ return invalidValue(typs, val, key, parent);
93+ }
94+
95+ function transformEnum(cases: string[], val: any): any {
96+ if (cases.indexOf(val) !== -1) return val;
97+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
98+ }
99+
100+ function transformArray(typ: any, val: any): any {
101+ // val must be an array with no invalid elements
102+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
103+ return val.map(el => transform(el, typ, getProps));
104+ }
105+
106+ function transformDate(val: any): any {
107+ if (val === null) {
108+ return null;
109+ }
110+ const d = new Date(val);
111+ if (isNaN(d.valueOf())) {
112+ return invalidValue(l("Date"), val, key, parent);
113+ }
114+ return d;
115+ }
116+
117+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
118+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
119+ return invalidValue(l(ref || "object"), val, key, parent);
120+ }
121+ const result: any = {};
122+ Object.getOwnPropertyNames(props).forEach(key => {
123+ const prop = props[key];
124+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
125+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
126+ });
127+ Object.getOwnPropertyNames(val).forEach(key => {
128+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
129+ result[key] = transform(val[key], additional, getProps, key, ref);
130+ }
131+ });
132+ return result;
133+ }
134+
135+ if (typ === "any") return val;
136+ if (typ === null) {
137+ if (val === null) return val;
138+ return invalidValue(typ, val, key, parent);
139+ }
140+ if (typ === false) return invalidValue(typ, val, key, parent);
141+ let ref: any = undefined;
142+ while (typeof typ === "object" && typ.ref !== undefined) {
143+ ref = typ.ref;
144+ typ = typeMap[typ.ref];
145+ }
146+ if (Array.isArray(typ)) return transformEnum(typ, val);
147+ if (typeof typ === "object") {
148+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
149+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
150+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
151+ : invalidValue(typ, val, key, parent);
152+ }
153+ // Numbers can be parsed by Date but shouldn't be.
154+ if (typ === Date && typeof val !== "number") return transformDate(val);
155+ return transformPrimitive(typ, val);
156+}
157+
158+function cast<T>(val: any, typ: any): T {
159+ return transform(val, typ, jsonToJSProps);
160+}
161+
162+function uncast<T>(val: T, typ: any): any {
163+ return transform(val, typ, jsToJSONProps);
164+}
165+
166+function l(typ: any) {
167+ return { literal: typ };
168+}
169+
170+function a(typ: any) {
171+ return { arrayItems: typ };
172+}
173+
174+function u(...typs: any[]) {
175+ return { unionMembers: typs };
176+}
177+
178+function o(props: any[], additional: any) {
179+ return { props, additional };
180+}
181+
182+function m(additional: any) {
183+ const props: any[] = [];
184+ return { props, additional };
185+}
186+
187+function r(name: string) {
188+ return { ref: name };
189+}
190+
191+const typeMap: any = {
192+ "TopLevel": o([
193+ { json: "items", js: "items", typ: a(u(r("PurpleItem"), r("FluffyItem"))) },
194+ ], false),
195+ "PurpleItem": o([
196+ { json: "aa", js: "aa", typ: u(undefined, "") },
197+ { json: "bb", js: "bb", typ: u(undefined, "") },
198+ ], false),
199+ "FluffyItem": o([
200+ { json: "cc", js: "cc", typ: u(undefined, "") },
201+ { json: "dd", js: "dd", typ: u(undefined, "") },
202+ ], false),
203+};
Aschema-typescript/test/inputs/schema/one-of-objects.schema/default/TopLevel.ts+14 −6
@@ -7,11 +7,17 @@
77 // These functions will throw an error if the JSON doesn't
88 // match the expected interface, even if the JSON is valid.
99
10+export interface Group {
11+ item?: TopLevel[];
12+ [property: string]: unknown;
13+}
14+
1015 /**
1116 * Postman collection
1217 */
13-export interface TopLevel {
14- item?: TopLevel[];
18+export type TopLevel = (Group & { "name"?: never; "response"?: never; }) | (Item & { "item"?: never; });
19+
20+export interface Item {
1521 name?: string;
1622 response?: Response[];
1723 [property: string]: unknown;
@@ -26,11 +32,11 @@ export interface Response {
2632 // and asserts the results of JSON.parse at runtime
2733 export class Convert {
2834 public static toTopLevel(json: string): TopLevel {
29- return cast(JSON.parse(json), r("TopLevel"));
35+ return cast(JSON.parse(json), u(r("Group"), r("Item")));
3036 }
3137
3238 public static topLevelToJson(value: TopLevel): string {
33- return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
39+ return JSON.stringify(uncast(value, u(r("Group"), r("Item"))), null, 2);
3440 }
3541 }
3642
@@ -188,8 +194,10 @@ function r(name: string) {
188194 }
189195
190196 const typeMap: any = {
191- "TopLevel": o([
192- { json: "item", js: "item", typ: u(undefined, a(r("TopLevel"))) },
197+ "Group": o([
198+ { json: "item", js: "item", typ: u(undefined, a(u(r("Group"), r("Item")))) },
199+ ], "any"),
200+ "Item": o([
193201 { json: "name", js: "name", typ: u(undefined, "") },
194202 { json: "response", js: "response", typ: u(undefined, a(r("Response"))) },
195203 ], "any"),
Mschema-typescript/test/inputs/schema/postman-collection.schema/default/TopLevel.ts+19 −9
@@ -7,10 +7,17 @@
77 // These functions will throw an error if the JSON doesn't
88 // match the expected interface, even if the JSON is valid.
99
10-export interface TopLevel {
11- one?: number;
12- two: boolean;
13- three?: number;
10+export type TopLevel = (PurpleTopLevel & { "three"?: never; }) | (FluffyTopLevel & { "one"?: never; });
11+
12+export interface PurpleTopLevel {
13+ one: number;
14+ two: boolean;
15+ [property: string]: unknown;
16+}
17+
18+export interface FluffyTopLevel {
19+ three: number;
20+ two: boolean;
1421 [property: string]: unknown;
1522 }
1623
@@ -18,11 +25,11 @@ export interface TopLevel {
1825 // and asserts the results of JSON.parse at runtime
1926 export class Convert {
2027 public static toTopLevel(json: string): TopLevel[] {
21- return cast(JSON.parse(json), a(r("TopLevel")));
28+ return cast(JSON.parse(json), a(u(r("PurpleTopLevel"), r("FluffyTopLevel"))));
2229 }
2330
2431 public static topLevelToJson(value: TopLevel[]): string {
25- return JSON.stringify(uncast(value, a(r("TopLevel"))), null, 2);
32+ return JSON.stringify(uncast(value, a(u(r("PurpleTopLevel"), r("FluffyTopLevel")))), null, 2);
2633 }
2734 }
2835
@@ -180,9 +187,12 @@ function r(name: string) {
180187 }
181188
182189 const typeMap: any = {
183- "TopLevel": o([
184- { json: "one", js: "one", typ: u(undefined, 0) },
190+ "PurpleTopLevel": o([
191+ { json: "one", js: "one", typ: 0 },
192+ { json: "two", js: "two", typ: true },
193+ ], "any"),
194+ "FluffyTopLevel": o([
195+ { json: "three", js: "three", typ: 3.14 },
185196 { json: "two", js: "two", typ: true },
186- { json: "three", js: "three", typ: u(undefined, 3.14) },
187197 ], "any"),
188198 };
Mschema-typescript/test/inputs/schema/union.schema/default/TopLevel.ts+15 −0
@@ -0,0 +1,15 @@
1+import * as z from "zod";
2+
3+
4+export const ItemSchema = z.object({
5+ "aa": z.string().optional(),
6+ "bb": z.string().optional(),
7+ "cc": z.string().optional(),
8+ "dd": z.string().optional(),
9+});
10+export type Item = z.infer<typeof ItemSchema>;
11+
12+export const TopLevelSchema = z.object({
13+ "items": z.array(ItemSchema),
14+});
15+export type TopLevel = z.infer<typeof TopLevelSchema>;
No generated files match these filters.