Test case
1 generated file · +10 −10test/inputs/json/priority/bug427.json
Mcplusplusdefault / quicktype.hpp+10 −10
| @@ -1067,7 +1067,7 @@ namespace quicktype { | ||
| 1067 | 1067 | std::string name; |
| 1068 | 1068 | std::shared_ptr<ExtendedBy> overwrites; |
| 1069 | 1069 | std::optional<std::vector<PurpleParameter>> parameters; |
| 1070 | - ExtendedBy type; | |
| 1070 | + std::shared_ptr<ExtendedBy> type; | |
| 1071 | 1071 | std::optional<std::vector<GetSignature>> type_parameter; |
| 1072 | 1072 | |
| 1073 | 1073 | public: |
| @@ -1111,9 +1111,9 @@ namespace quicktype { | ||
| 1111 | 1111 | std::optional<std::vector<PurpleParameter>> & get_mutable_parameters() { return parameters; } |
| 1112 | 1112 | void set_parameters(const std::optional<std::vector<PurpleParameter>> & value) { this->parameters = value; } |
| 1113 | 1113 | |
| 1114 | - const ExtendedBy & get_type() const { return type; } | |
| 1115 | - ExtendedBy & get_mutable_type() { return type; } | |
| 1116 | - void set_type(const ExtendedBy & value) { this->type = value; } | |
| 1114 | + const std::shared_ptr<ExtendedBy> & get_type() const { return type; } | |
| 1115 | + std::shared_ptr<ExtendedBy> & get_mutable_type() { return type; } | |
| 1116 | + void set_type(const std::shared_ptr<ExtendedBy> & value) { this->type = value; } | |
| 1117 | 1117 | |
| 1118 | 1118 | const std::optional<std::vector<GetSignature>> & get_type_parameter() const { return type_parameter; } |
| 1119 | 1119 | std::optional<std::vector<GetSignature>> & get_mutable_type_parameter() { return type_parameter; } |
| @@ -1342,7 +1342,7 @@ namespace quicktype { | ||
| 1342 | 1342 | SignatureKindString kind_string; |
| 1343 | 1343 | std::string name; |
| 1344 | 1344 | std::optional<std::vector<FluffyParameter>> parameters; |
| 1345 | - ExtendedBy type; | |
| 1345 | + std::shared_ptr<ExtendedBy> type; | |
| 1346 | 1346 | |
| 1347 | 1347 | public: |
| 1348 | 1348 | const std::optional<IndigoComment> & get_comment() const { return comment; } |
| @@ -1373,9 +1373,9 @@ namespace quicktype { | ||
| 1373 | 1373 | std::optional<std::vector<FluffyParameter>> & get_mutable_parameters() { return parameters; } |
| 1374 | 1374 | void set_parameters(const std::optional<std::vector<FluffyParameter>> & value) { this->parameters = value; } |
| 1375 | 1375 | |
| 1376 | - const ExtendedBy & get_type() const { return type; } | |
| 1377 | - ExtendedBy & get_mutable_type() { return type; } | |
| 1378 | - void set_type(const ExtendedBy & value) { this->type = value; } | |
| 1376 | + const std::shared_ptr<ExtendedBy> & get_type() const { return type; } | |
| 1377 | + std::shared_ptr<ExtendedBy> & get_mutable_type() { return type; } | |
| 1378 | + void set_type(const std::shared_ptr<ExtendedBy> & value) { this->type = value; } | |
| 1379 | 1379 | }; |
| 1380 | 1380 | |
| 1381 | 1381 | class FluffyDeclaration { |
| @@ -3190,7 +3190,7 @@ namespace quicktype { | ||
| 3190 | 3190 | x.set_name(j.at("name").get<std::string>()); |
| 3191 | 3191 | x.set_overwrites(get_heap_optional<ExtendedBy>(j, "overwrites")); |
| 3192 | 3192 | x.set_parameters(get_stack_optional<std::vector<PurpleParameter>>(j, "parameters")); |
| 3193 | - x.set_type(j.at("type").get<ExtendedBy>()); | |
| 3193 | + x.set_type(j.at("type").get<std::shared_ptr<ExtendedBy>>()); | |
| 3194 | 3194 | x.set_type_parameter(get_stack_optional<std::vector<GetSignature>>(j, "typeParameter")); |
| 3195 | 3195 | } |
| 3196 | 3196 | |
| @@ -3322,7 +3322,7 @@ namespace quicktype { | ||
| 3322 | 3322 | x.set_kind_string(j.at("kindString").get<SignatureKindString>()); |
| 3323 | 3323 | x.set_name(j.at("name").get<std::string>()); |
| 3324 | 3324 | x.set_parameters(get_stack_optional<std::vector<FluffyParameter>>(j, "parameters")); |
| 3325 | - x.set_type(j.at("type").get<ExtendedBy>()); | |
| 3325 | + x.set_type(j.at("type").get<std::shared_ptr<ExtendedBy>>()); | |
| 3326 | 3326 | } |
| 3327 | 3327 | |
| 3328 | 3328 | inline void to_json(json & j, const TentacledSignature & x) { |
Test case
35 generated files · +2,694 −0test/inputs/schema/required-in-any-of.schema
Aschema-cjsondefault / TopLevel.c+137 −0
| @@ -0,0 +1,137 @@ | ||
| 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 Anyof * cJSON_ParseAnyof(const char * s) { | |
| 9 | + struct Anyof * x = NULL; | |
| 10 | + if (NULL != s) { | |
| 11 | + cJSON * j = cJSON_Parse(s); | |
| 12 | + if (NULL != j) { | |
| 13 | + x = cJSON_GetAnyofValue(j); | |
| 14 | + cJSON_Delete(j); | |
| 15 | + } | |
| 16 | + } | |
| 17 | + return x; | |
| 18 | +} | |
| 19 | + | |
| 20 | +struct Anyof * cJSON_GetAnyofValue(const cJSON * j) { | |
| 21 | + struct Anyof * x = NULL; | |
| 22 | + if (NULL != j) { | |
| 23 | + if (NULL != (x = cJSON_malloc(sizeof(struct Anyof)))) { | |
| 24 | + memset(x, 0, sizeof(struct Anyof)); | |
| 25 | + if (cJSON_HasObjectItem(j, "name")) { | |
| 26 | + x->name = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "name"))); | |
| 27 | + } | |
| 28 | + else { | |
| 29 | + if (NULL != (x->name = cJSON_malloc(sizeof(char)))) { | |
| 30 | + x->name[0] = '\0'; | |
| 31 | + } | |
| 32 | + } | |
| 33 | + if (cJSON_HasObjectItem(j, "size")) { | |
| 34 | + x->size = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "size"))); | |
| 35 | + } | |
| 36 | + } | |
| 37 | + } | |
| 38 | + return x; | |
| 39 | +} | |
| 40 | + | |
| 41 | +cJSON * cJSON_CreateAnyof(const struct Anyof * x) { | |
| 42 | + cJSON * j = NULL; | |
| 43 | + if (NULL != x) { | |
| 44 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 45 | + if (NULL != x->name) { | |
| 46 | + cJSON_AddStringToObject(j, "name", x->name); | |
| 47 | + } | |
| 48 | + else { | |
| 49 | + cJSON_AddStringToObject(j, "name", ""); | |
| 50 | + } | |
| 51 | + if (NULL != x->size) { | |
| 52 | + cJSON_AddStringToObject(j, "size", x->size); | |
| 53 | + } | |
| 54 | + } | |
| 55 | + } | |
| 56 | + return j; | |
| 57 | +} | |
| 58 | + | |
| 59 | +char * cJSON_PrintAnyof(const struct Anyof * x) { | |
| 60 | + char * s = NULL; | |
| 61 | + if (NULL != x) { | |
| 62 | + cJSON * j = cJSON_CreateAnyof(x); | |
| 63 | + if (NULL != j) { | |
| 64 | + s = cJSON_Print(j); | |
| 65 | + cJSON_Delete(j); | |
| 66 | + } | |
| 67 | + } | |
| 68 | + return s; | |
| 69 | +} | |
| 70 | + | |
| 71 | +void cJSON_DeleteAnyof(struct Anyof * x) { | |
| 72 | + if (NULL != x) { | |
| 73 | + if (NULL != x->name) { | |
| 74 | + cJSON_free(x->name); | |
| 75 | + } | |
| 76 | + if (NULL != x->size) { | |
| 77 | + cJSON_free(x->size); | |
| 78 | + } | |
| 79 | + cJSON_free(x); | |
| 80 | + } | |
| 81 | +} | |
| 82 | + | |
| 83 | +struct TopLevel * cJSON_ParseTopLevel(const char * s) { | |
| 84 | + struct TopLevel * x = NULL; | |
| 85 | + if (NULL != s) { | |
| 86 | + cJSON * j = cJSON_Parse(s); | |
| 87 | + if (NULL != j) { | |
| 88 | + x = cJSON_GetTopLevelValue(j); | |
| 89 | + cJSON_Delete(j); | |
| 90 | + } | |
| 91 | + } | |
| 92 | + return x; | |
| 93 | +} | |
| 94 | + | |
| 95 | +struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | |
| 96 | + struct TopLevel * x = NULL; | |
| 97 | + if (NULL != j) { | |
| 98 | + if (NULL != (x = cJSON_malloc(sizeof(struct TopLevel)))) { | |
| 99 | + memset(x, 0, sizeof(struct TopLevel)); | |
| 100 | + if (cJSON_HasObjectItem(j, "anyof")) { | |
| 101 | + x->anyof = cJSON_GetAnyofValue(cJSON_GetObjectItemCaseSensitive(j, "anyof")); | |
| 102 | + } | |
| 103 | + } | |
| 104 | + } | |
| 105 | + return x; | |
| 106 | +} | |
| 107 | + | |
| 108 | +cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) { | |
| 109 | + cJSON * j = NULL; | |
| 110 | + if (NULL != x) { | |
| 111 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 112 | + cJSON_AddItemToObject(j, "anyof", cJSON_CreateAnyof(x->anyof)); | |
| 113 | + } | |
| 114 | + } | |
| 115 | + return j; | |
| 116 | +} | |
| 117 | + | |
| 118 | +char * cJSON_PrintTopLevel(const struct TopLevel * x) { | |
| 119 | + char * s = NULL; | |
| 120 | + if (NULL != x) { | |
| 121 | + cJSON * j = cJSON_CreateTopLevel(x); | |
| 122 | + if (NULL != j) { | |
| 123 | + s = cJSON_Print(j); | |
| 124 | + cJSON_Delete(j); | |
| 125 | + } | |
| 126 | + } | |
| 127 | + return s; | |
| 128 | +} | |
| 129 | + | |
| 130 | +void cJSON_DeleteTopLevel(struct TopLevel * x) { | |
| 131 | + if (NULL != x) { | |
| 132 | + if (NULL != x->anyof) { | |
| 133 | + cJSON_DeleteAnyof(x->anyof); | |
| 134 | + } | |
| 135 | + cJSON_free(x); | |
| 136 | + } | |
| 137 | +} |
Aschema-cjsondefault / TopLevel.h+62 −0
| @@ -0,0 +1,62 @@ | ||
| 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 Anyof { | |
| 38 | + char * name; | |
| 39 | + char * size; | |
| 40 | +}; | |
| 41 | + | |
| 42 | +struct TopLevel { | |
| 43 | + struct Anyof * anyof; | |
| 44 | +}; | |
| 45 | + | |
| 46 | +struct Anyof * cJSON_ParseAnyof(const char * s); | |
| 47 | +struct Anyof * cJSON_GetAnyofValue(const cJSON * j); | |
| 48 | +cJSON * cJSON_CreateAnyof(const struct Anyof * x); | |
| 49 | +char * cJSON_PrintAnyof(const struct Anyof * x); | |
| 50 | +void cJSON_DeleteAnyof(struct Anyof * x); | |
| 51 | + | |
| 52 | +struct TopLevel * cJSON_ParseTopLevel(const char * s); | |
| 53 | +struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j); | |
| 54 | +cJSON * cJSON_CreateTopLevel(const struct TopLevel * x); | |
| 55 | +char * cJSON_PrintTopLevel(const struct TopLevel * x); | |
| 56 | +void cJSON_DeleteTopLevel(struct TopLevel * x); | |
| 57 | + | |
| 58 | +#ifdef __cplusplus | |
| 59 | +} | |
| 60 | +#endif | |
| 61 | + | |
| 62 | +#endif /* __TOPLEVEL_H__ */ |
Aschema-cplusplusdefault / quicktype.hpp+151 −0
| @@ -0,0 +1,151 @@ | ||
| 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 Anyof { | |
| 92 | + public: | |
| 93 | + Anyof() = default; | |
| 94 | + virtual ~Anyof() = default; | |
| 95 | + | |
| 96 | + private: | |
| 97 | + std::string name; | |
| 98 | + std::optional<std::string> size; | |
| 99 | + | |
| 100 | + public: | |
| 101 | + const std::string & get_name() const { return name; } | |
| 102 | + std::string & get_mutable_name() { return name; } | |
| 103 | + void set_name(const std::string & value) { this->name = value; } | |
| 104 | + | |
| 105 | + const std::optional<std::string> & get_size() const { return size; } | |
| 106 | + std::optional<std::string> & get_mutable_size() { return size; } | |
| 107 | + void set_size(const std::optional<std::string> & value) { this->size = value; } | |
| 108 | + }; | |
| 109 | + | |
| 110 | + class TopLevel { | |
| 111 | + public: | |
| 112 | + TopLevel() = default; | |
| 113 | + virtual ~TopLevel() = default; | |
| 114 | + | |
| 115 | + private: | |
| 116 | + Anyof anyof; | |
| 117 | + | |
| 118 | + public: | |
| 119 | + const Anyof & get_anyof() const { return anyof; } | |
| 120 | + Anyof & get_mutable_anyof() { return anyof; } | |
| 121 | + void set_anyof(const Anyof & value) { this->anyof = value; } | |
| 122 | + }; | |
| 123 | +} | |
| 124 | + | |
| 125 | +namespace quicktype { | |
| 126 | + void from_json(const json & j, Anyof & x); | |
| 127 | + void to_json(json & j, const Anyof & x); | |
| 128 | + | |
| 129 | + void from_json(const json & j, TopLevel & x); | |
| 130 | + void to_json(json & j, const TopLevel & x); | |
| 131 | + | |
| 132 | + inline void from_json(const json & j, Anyof& x) { | |
| 133 | + x.set_name(j.at("name").get<std::string>()); | |
| 134 | + x.set_size(get_stack_optional<std::string>(j, "size")); | |
| 135 | + } | |
| 136 | + | |
| 137 | + inline void to_json(json & j, const Anyof & x) { | |
| 138 | + j = json::object(); | |
| 139 | + j["name"] = x.get_name(); | |
| 140 | + j["size"] = x.get_size(); | |
| 141 | + } | |
| 142 | + | |
| 143 | + inline void from_json(const json & j, TopLevel& x) { | |
| 144 | + x.set_anyof(j.at("anyof").get<Anyof>()); | |
| 145 | + } | |
| 146 | + | |
| 147 | + inline void to_json(json & j, const TopLevel & x) { | |
| 148 | + j = json::object(); | |
| 149 | + j["anyof"] = x.get_anyof(); | |
| 150 | + } | |
| 151 | +} |
Aschema-csharp-recordsdefault / QuickType.cs+70 −0
| @@ -0,0 +1,70 @@ | ||
| 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 record TopLevel | |
| 27 | + { | |
| 28 | + [JsonProperty("anyof", Required = Required.Always)] | |
| 29 | + public Anyof Anyof { get; set; } | |
| 30 | + } | |
| 31 | + | |
| 32 | + public partial record Anyof | |
| 33 | + { | |
| 34 | + [JsonProperty("name", Required = Required.Always)] | |
| 35 | + public string Name { get; set; } | |
| 36 | + | |
| 37 | + [JsonProperty("size", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 38 | + public string? Size { get; set; } | |
| 39 | + } | |
| 40 | + | |
| 41 | + public partial record TopLevel | |
| 42 | + { | |
| 43 | + public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings); | |
| 44 | + } | |
| 45 | + | |
| 46 | + public static partial class Serialize | |
| 47 | + { | |
| 48 | + public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings); | |
| 49 | + } | |
| 50 | + | |
| 51 | + internal static partial class Converter | |
| 52 | + { | |
| 53 | + public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings | |
| 54 | + { | |
| 55 | + MetadataPropertyHandling = MetadataPropertyHandling.Ignore, | |
| 56 | + DateParseHandling = DateParseHandling.None, | |
| 57 | + Converters = | |
| 58 | + { | |
| 59 | + new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } | |
| 60 | + }, | |
| 61 | + }; | |
| 62 | + } | |
| 63 | +} | |
| 64 | +#pragma warning restore CS8618 | |
| 65 | +#pragma warning restore CS8601 | |
| 66 | +#pragma warning restore CS8602 | |
| 67 | +#pragma warning restore CS8603 | |
| 68 | +#pragma warning restore CS8604 | |
| 69 | +#pragma warning restore CS8625 | |
| 70 | +#pragma warning restore CS8765 |
Aschema-csharp-SystemTextJsondefault / QuickType.cs+177 −0
| @@ -0,0 +1,177 @@ | ||
| 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("anyof")] | |
| 27 | + public Anyof Anyof { get; set; } | |
| 28 | + } | |
| 29 | + | |
| 30 | + public partial class Anyof | |
| 31 | + { | |
| 32 | + [JsonRequired] | |
| 33 | + [JsonPropertyName("name")] | |
| 34 | + public string Name { get; set; } | |
| 35 | + | |
| 36 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 37 | + [JsonPropertyName("size")] | |
| 38 | + public string? Size { get; set; } | |
| 39 | + } | |
| 40 | + | |
| 41 | + public partial class TopLevel | |
| 42 | + { | |
| 43 | + public static TopLevel FromJson(string json) => JsonSerializer.Deserialize<TopLevel>(json, QuickType.Converter.Settings); | |
| 44 | + } | |
| 45 | + | |
| 46 | + public static partial class Serialize | |
| 47 | + { | |
| 48 | + public static string ToJson(this TopLevel self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings); | |
| 49 | + } | |
| 50 | + | |
| 51 | + internal static partial class Converter | |
| 52 | + { | |
| 53 | + public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General) | |
| 54 | + { | |
| 55 | + Converters = | |
| 56 | + { | |
| 57 | + new DateOnlyConverter(), | |
| 58 | + new TimeOnlyConverter(), | |
| 59 | + IsoDateTimeOffsetConverter.Singleton | |
| 60 | + }, | |
| 61 | + }; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public class DateOnlyConverter : JsonConverter<DateOnly> | |
| 65 | + { | |
| 66 | + private readonly string serializationFormat; | |
| 67 | + public DateOnlyConverter() : this(null) { } | |
| 68 | + | |
| 69 | + public DateOnlyConverter(string? serializationFormat) | |
| 70 | + { | |
| 71 | + this.serializationFormat = serializationFormat ?? "yyyy-MM-dd"; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 75 | + { | |
| 76 | + var value = reader.GetString(); | |
| 77 | + return DateOnly.Parse(value!); | |
| 78 | + } | |
| 79 | + | |
| 80 | + public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options) | |
| 81 | + => writer.WriteStringValue(value.ToString(serializationFormat)); | |
| 82 | + } | |
| 83 | + | |
| 84 | + public class TimeOnlyConverter : JsonConverter<TimeOnly> | |
| 85 | + { | |
| 86 | + private readonly string serializationFormat; | |
| 87 | + | |
| 88 | + public TimeOnlyConverter() : this(null) { } | |
| 89 | + | |
| 90 | + public TimeOnlyConverter(string? serializationFormat) | |
| 91 | + { | |
| 92 | + this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff"; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 96 | + { | |
| 97 | + var value = reader.GetString(); | |
| 98 | + return TimeOnly.Parse(value!); | |
| 99 | + } | |
| 100 | + | |
| 101 | + public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options) | |
| 102 | + => writer.WriteStringValue(value.ToString(serializationFormat)); | |
| 103 | + } | |
| 104 | + | |
| 105 | + internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset> | |
| 106 | + { | |
| 107 | + public override bool CanConvert(Type t) => t == typeof(DateTimeOffset); | |
| 108 | + | |
| 109 | + private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; | |
| 110 | + | |
| 111 | + private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind; | |
| 112 | + private string? _dateTimeFormat; | |
| 113 | + private CultureInfo? _culture; | |
| 114 | + | |
| 115 | + public DateTimeStyles DateTimeStyles | |
| 116 | + { | |
| 117 | + get => _dateTimeStyles; | |
| 118 | + set => _dateTimeStyles = value; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public string? DateTimeFormat | |
| 122 | + { | |
| 123 | + get => _dateTimeFormat ?? string.Empty; | |
| 124 | + set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public CultureInfo Culture | |
| 128 | + { | |
| 129 | + get => _culture ?? CultureInfo.CurrentCulture; | |
| 130 | + set => _culture = value; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options) | |
| 134 | + { | |
| 135 | + string text; | |
| 136 | + | |
| 137 | + | |
| 138 | + if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal | |
| 139 | + || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal) | |
| 140 | + { | |
| 141 | + value = value.ToUniversalTime(); | |
| 142 | + } | |
| 143 | + | |
| 144 | + text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture); | |
| 145 | + | |
| 146 | + writer.WriteStringValue(text); | |
| 147 | + } | |
| 148 | + | |
| 149 | + public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 150 | + { | |
| 151 | + string? dateText = reader.GetString(); | |
| 152 | + | |
| 153 | + if (string.IsNullOrEmpty(dateText) == false) | |
| 154 | + { | |
| 155 | + if (!string.IsNullOrEmpty(_dateTimeFormat)) | |
| 156 | + { | |
| 157 | + return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles); | |
| 158 | + } | |
| 159 | + else | |
| 160 | + { | |
| 161 | + return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles); | |
| 162 | + } | |
| 163 | + } | |
| 164 | + else | |
| 165 | + { | |
| 166 | + return default(DateTimeOffset); | |
| 167 | + } | |
| 168 | + } | |
| 169 | + | |
| 170 | + | |
| 171 | + public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter(); | |
| 172 | + } | |
| 173 | +} | |
| 174 | +#pragma warning restore CS8618 | |
| 175 | +#pragma warning restore CS8601 | |
| 176 | +#pragma warning restore CS8602 | |
| 177 | +#pragma warning restore CS8603 |
Aschema-csharpdefault / QuickType.cs+70 −0
| @@ -0,0 +1,70 @@ | ||
| 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("anyof", Required = Required.Always)] | |
| 29 | + public Anyof Anyof { get; set; } | |
| 30 | + } | |
| 31 | + | |
| 32 | + public partial class Anyof | |
| 33 | + { | |
| 34 | + [JsonProperty("name", Required = Required.Always)] | |
| 35 | + public string Name { get; set; } | |
| 36 | + | |
| 37 | + [JsonProperty("size", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 38 | + public string? Size { get; set; } | |
| 39 | + } | |
| 40 | + | |
| 41 | + public partial class TopLevel | |
| 42 | + { | |
| 43 | + public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings); | |
| 44 | + } | |
| 45 | + | |
| 46 | + public static partial class Serialize | |
| 47 | + { | |
| 48 | + public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings); | |
| 49 | + } | |
| 50 | + | |
| 51 | + internal static partial class Converter | |
| 52 | + { | |
| 53 | + public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings | |
| 54 | + { | |
| 55 | + MetadataPropertyHandling = MetadataPropertyHandling.Ignore, | |
| 56 | + DateParseHandling = DateParseHandling.None, | |
| 57 | + Converters = | |
| 58 | + { | |
| 59 | + new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } | |
| 60 | + }, | |
| 61 | + }; | |
| 62 | + } | |
| 63 | +} | |
| 64 | +#pragma warning restore CS8618 | |
| 65 | +#pragma warning restore CS8601 | |
| 66 | +#pragma warning restore CS8602 | |
| 67 | +#pragma warning restore CS8603 | |
| 68 | +#pragma warning restore CS8604 | |
| 69 | +#pragma warning restore CS8625 | |
| 70 | +#pragma warning restore CS8765 |
Aschema-dartdefault / TopLevel.dart+45 −0
| @@ -0,0 +1,45 @@ | ||
| 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 Anyof anyof; | |
| 13 | + | |
| 14 | + TopLevel({ | |
| 15 | + required this.anyof, | |
| 16 | + }); | |
| 17 | + | |
| 18 | + factory TopLevel.fromJson(Map<String, dynamic> json) => TopLevel( | |
| 19 | + anyof: Anyof.fromJson(json["anyof"]), | |
| 20 | + ); | |
| 21 | + | |
| 22 | + Map<String, dynamic> toJson() => { | |
| 23 | + "anyof": anyof.toJson(), | |
| 24 | + }; | |
| 25 | +} | |
| 26 | + | |
| 27 | +class Anyof { | |
| 28 | + final String name; | |
| 29 | + final String? size; | |
| 30 | + | |
| 31 | + Anyof({ | |
| 32 | + required this.name, | |
| 33 | + this.size, | |
| 34 | + }); | |
| 35 | + | |
| 36 | + factory Anyof.fromJson(Map<String, dynamic> json) => Anyof( | |
| 37 | + name: json["name"], | |
| 38 | + size: json["size"], | |
| 39 | + ); | |
| 40 | + | |
| 41 | + Map<String, dynamic> toJson() => { | |
| 42 | + "name": name, | |
| 43 | + "size": size, | |
| 44 | + }; | |
| 45 | +} |
Aschema-elmdefault / QuickType.elm+70 −0
| @@ -0,0 +1,70 @@ | ||
| 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 | + , Anyof | |
| 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 | + { anyof : Anyof | |
| 28 | + } | |
| 29 | + | |
| 30 | +type alias Anyof = | |
| 31 | + { name : String | |
| 32 | + , size : Maybe String | |
| 33 | + } | |
| 34 | + | |
| 35 | +-- decoders and encoders | |
| 36 | + | |
| 37 | +quickTypeToString : QuickType -> String | |
| 38 | +quickTypeToString r = Jenc.encode 0 (encodeQuickType r) | |
| 39 | + | |
| 40 | +quickType : Jdec.Decoder QuickType | |
| 41 | +quickType = | |
| 42 | + Jdec.succeed QuickType | |
| 43 | + |> Jpipe.required "anyof" anyof | |
| 44 | + | |
| 45 | +encodeQuickType : QuickType -> Jenc.Value | |
| 46 | +encodeQuickType x = | |
| 47 | + Jenc.object | |
| 48 | + [ ("anyof", encodeAnyof x.anyof) | |
| 49 | + ] | |
| 50 | + | |
| 51 | +anyof : Jdec.Decoder Anyof | |
| 52 | +anyof = | |
| 53 | + Jdec.succeed Anyof | |
| 54 | + |> Jpipe.required "name" Jdec.string | |
| 55 | + |> Jpipe.optional "size" (Jdec.nullable Jdec.string) Nothing | |
| 56 | + | |
| 57 | +encodeAnyof : Anyof -> Jenc.Value | |
| 58 | +encodeAnyof x = | |
| 59 | + Jenc.object | |
| 60 | + [ ("name", Jenc.string x.name) | |
| 61 | + , ("size", makeNullableEncoder Jenc.string x.size) | |
| 62 | + ] | |
| 63 | + | |
| 64 | +--- encoder helpers | |
| 65 | + | |
| 66 | +makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value | |
| 67 | +makeNullableEncoder f m = | |
| 68 | + case m of | |
| 69 | + Just x -> f x | |
| 70 | + Nothing -> Jenc.null |
Aschema-flowdefault / TopLevel.js+197 −0
| @@ -0,0 +1,197 @@ | ||
| 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 | + anyof: Anyof; | |
| 14 | +}; | |
| 15 | + | |
| 16 | +export type Anyof = { | |
| 17 | + name: string; | |
| 18 | + size?: string; | |
| 19 | +}; | |
| 20 | + | |
| 21 | +// Converts JSON strings to/from your types | |
| 22 | +// and asserts the results of JSON.parse at runtime | |
| 23 | +function toTopLevel(json: string): TopLevel { | |
| 24 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 25 | +} | |
| 26 | + | |
| 27 | +function topLevelToJson(value: TopLevel): string { | |
| 28 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 29 | +} | |
| 30 | + | |
| 31 | +function invalidValue(typ: any, val: any, key: any, parent: any = '') { | |
| 32 | + const prettyTyp = prettyTypeName(typ); | |
| 33 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 34 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 35 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 36 | +} | |
| 37 | + | |
| 38 | +function prettyTypeName(typ: any): string { | |
| 39 | + if (Array.isArray(typ)) { | |
| 40 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 41 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 42 | + } else { | |
| 43 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 44 | + } | |
| 45 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 46 | + return typ.literal; | |
| 47 | + } else { | |
| 48 | + return typeof typ; | |
| 49 | + } | |
| 50 | +} | |
| 51 | + | |
| 52 | +function jsonToJSProps(typ: any): any { | |
| 53 | + if (typ.jsonToJS === undefined) { | |
| 54 | + const map: any = {}; | |
| 55 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 56 | + typ.jsonToJS = map; | |
| 57 | + } | |
| 58 | + return typ.jsonToJS; | |
| 59 | +} | |
| 60 | + | |
| 61 | +function jsToJSONProps(typ: any): any { | |
| 62 | + if (typ.jsToJSON === undefined) { | |
| 63 | + const map: any = {}; | |
| 64 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 65 | + typ.jsToJSON = map; | |
| 66 | + } | |
| 67 | + return typ.jsToJSON; | |
| 68 | +} | |
| 69 | + | |
| 70 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 71 | + function transformPrimitive(typ: string, val: any): any { | |
| 72 | + if (typeof typ === typeof val) return val; | |
| 73 | + return invalidValue(typ, val, key, parent); | |
| 74 | + } | |
| 75 | + | |
| 76 | + function transformUnion(typs: any[], val: any): any { | |
| 77 | + // val must validate against one typ in typs | |
| 78 | + const l = typs.length; | |
| 79 | + for (let i = 0; i < l; i++) { | |
| 80 | + const typ = typs[i]; | |
| 81 | + try { | |
| 82 | + return transform(val, typ, getProps); | |
| 83 | + } catch (_) {} | |
| 84 | + } | |
| 85 | + return invalidValue(typs, val, key, parent); | |
| 86 | + } | |
| 87 | + | |
| 88 | + function transformEnum(cases: string[], val: any): any { | |
| 89 | + if (cases.indexOf(val) !== -1) return val; | |
| 90 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 91 | + } | |
| 92 | + | |
| 93 | + function transformArray(typ: any, val: any): any { | |
| 94 | + // val must be an array with no invalid elements | |
| 95 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 96 | + return val.map(el => transform(el, typ, getProps)); | |
| 97 | + } | |
| 98 | + | |
| 99 | + function transformDate(val: any): any { | |
| 100 | + if (val === null) { | |
| 101 | + return null; | |
| 102 | + } | |
| 103 | + const d = new Date(val); | |
| 104 | + if (isNaN(d.valueOf())) { | |
| 105 | + return invalidValue(l("Date"), val, key, parent); | |
| 106 | + } | |
| 107 | + return d; | |
| 108 | + } | |
| 109 | + | |
| 110 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 111 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 112 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 113 | + } | |
| 114 | + const result: any = {}; | |
| 115 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 116 | + const prop = props[key]; | |
| 117 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 118 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 119 | + }); | |
| 120 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 121 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 122 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 123 | + } | |
| 124 | + }); | |
| 125 | + return result; | |
| 126 | + } | |
| 127 | + | |
| 128 | + if (typ === "any") return val; | |
| 129 | + if (typ === null) { | |
| 130 | + if (val === null) return val; | |
| 131 | + return invalidValue(typ, val, key, parent); | |
| 132 | + } | |
| 133 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 134 | + let ref: any = undefined; | |
| 135 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 136 | + ref = typ.ref; | |
| 137 | + typ = typeMap[typ.ref]; | |
| 138 | + } | |
| 139 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 140 | + if (typeof typ === "object") { | |
| 141 | + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 142 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 143 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 144 | + : invalidValue(typ, val, key, parent); | |
| 145 | + } | |
| 146 | + // Numbers can be parsed by Date but shouldn't be. | |
| 147 | + if (typ === Date && typeof val !== "number") return transformDate(val); | |
| 148 | + return transformPrimitive(typ, val); | |
| 149 | +} | |
| 150 | + | |
| 151 | +function cast<T>(val: any, typ: any): T { | |
| 152 | + return transform(val, typ, jsonToJSProps); | |
| 153 | +} | |
| 154 | + | |
| 155 | +function uncast<T>(val: T, typ: any): any { | |
| 156 | + return transform(val, typ, jsToJSONProps); | |
| 157 | +} | |
| 158 | + | |
| 159 | +function l(typ: any) { | |
| 160 | + return { literal: typ }; | |
| 161 | +} | |
| 162 | + | |
| 163 | +function a(typ: any) { | |
| 164 | + return { arrayItems: typ }; | |
| 165 | +} | |
| 166 | + | |
| 167 | +function u(...typs: any[]) { | |
| 168 | + return { unionMembers: typs }; | |
| 169 | +} | |
| 170 | + | |
| 171 | +function o(props: any[], additional: any) { | |
| 172 | + return { props, additional }; | |
| 173 | +} | |
| 174 | + | |
| 175 | +function m(additional: any) { | |
| 176 | + const props: any[] = []; | |
| 177 | + return { props, additional }; | |
| 178 | +} | |
| 179 | + | |
| 180 | +function r(name: string) { | |
| 181 | + return { ref: name }; | |
| 182 | +} | |
| 183 | + | |
| 184 | +const typeMap: any = { | |
| 185 | + "TopLevel": o([ | |
| 186 | + { json: "anyof", js: "anyof", typ: r("Anyof") }, | |
| 187 | + ], false), | |
| 188 | + "Anyof": o([ | |
| 189 | + { json: "name", js: "name", typ: "" }, | |
| 190 | + { json: "size", js: "size", typ: u(undefined, "") }, | |
| 191 | + ], false), | |
| 192 | +}; | |
| 193 | + | |
| 194 | +module.exports = { | |
| 195 | + "topLevelToJson": topLevelToJson, | |
| 196 | + "toTopLevel": toTopLevel, | |
| 197 | +}; |
Aschema-golangdefault / quicktype.go+28 −0
| @@ -0,0 +1,28 @@ | ||
| 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 | + Anyof Anyof `json:"anyof"` | |
| 23 | +} | |
| 24 | + | |
| 25 | +type Anyof struct { | |
| 26 | + Name string `json:"name"` | |
| 27 | + Size *string `json:"size,omitempty"` | |
| 28 | +} |
Aschema-haskelldefault / QuickType.hs+48 −0
| @@ -0,0 +1,48 @@ | ||
| 1 | +{-# LANGUAGE StrictData #-} | |
| 2 | +{-# LANGUAGE OverloadedStrings #-} | |
| 3 | + | |
| 4 | +module QuickType | |
| 5 | + ( QuickType (..) | |
| 6 | + , Anyof (..) | |
| 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 | + { anyofQuickType :: Anyof | |
| 18 | + } deriving (Show) | |
| 19 | + | |
| 20 | +data Anyof = Anyof | |
| 21 | + { nameAnyof :: Text | |
| 22 | + , sizeAnyof :: Maybe Text | |
| 23 | + } deriving (Show) | |
| 24 | + | |
| 25 | +decodeTopLevel :: ByteString -> Maybe QuickType | |
| 26 | +decodeTopLevel = decode | |
| 27 | + | |
| 28 | +instance ToJSON QuickType where | |
| 29 | + toJSON (QuickType anyofQuickType) = | |
| 30 | + object | |
| 31 | + [ "anyof" .= anyofQuickType | |
| 32 | + ] | |
| 33 | + | |
| 34 | +instance FromJSON QuickType where | |
| 35 | + parseJSON (Object v) = QuickType | |
| 36 | + <$> v .: "anyof" | |
| 37 | + | |
| 38 | +instance ToJSON Anyof where | |
| 39 | + toJSON (Anyof nameAnyof sizeAnyof) = | |
| 40 | + object | |
| 41 | + [ "name" .= nameAnyof | |
| 42 | + , "size" .= sizeAnyof | |
| 43 | + ] | |
| 44 | + | |
| 45 | +instance FromJSON Anyof where | |
| 46 | + parseJSON (Object v) = Anyof | |
| 47 | + <$> v .: "name" | |
| 48 | + <*> v .:? "size" |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / Anyof.java+18 −0
| @@ -0,0 +1,18 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class Anyof { | |
| 6 | + private String name; | |
| 7 | + private String size; | |
| 8 | + | |
| 9 | + @JsonProperty("name") | |
| 10 | + public String getName() { return name; } | |
| 11 | + @JsonProperty("name") | |
| 12 | + public void setName(String value) { this.name = value; } | |
| 13 | + | |
| 14 | + @JsonProperty("size") | |
| 15 | + public String getSize() { return size; } | |
| 16 | + @JsonProperty("size") | |
| 17 | + public void setSize(String value) { this.size = value; } | |
| 18 | +} |
Aschema-java-datetime-legacydefault / 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-datetime-legacydefault / src / main / java / io / quicktype / TopLevel.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class TopLevel { | |
| 6 | + private Anyof anyof; | |
| 7 | + | |
| 8 | + @JsonProperty("anyof") | |
| 9 | + public Anyof getAnyof() { return anyof; } | |
| 10 | + @JsonProperty("anyof") | |
| 11 | + public void setAnyof(Anyof value) { this.anyof = value; } | |
| 12 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / Anyof.java+18 −0
| @@ -0,0 +1,18 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class Anyof { | |
| 6 | + private String name; | |
| 7 | + private String size; | |
| 8 | + | |
| 9 | + @JsonProperty("name") | |
| 10 | + public String getName() { return name; } | |
| 11 | + @JsonProperty("name") | |
| 12 | + public void setName(String value) { this.name = value; } | |
| 13 | + | |
| 14 | + @JsonProperty("size") | |
| 15 | + public String getSize() { return size; } | |
| 16 | + @JsonProperty("size") | |
| 17 | + public void setSize(String value) { this.size = value; } | |
| 18 | +} |
Aschema-java-lombokdefault / 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-lombokdefault / src / main / java / io / quicktype / TopLevel.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class TopLevel { | |
| 6 | + private Anyof anyof; | |
| 7 | + | |
| 8 | + @JsonProperty("anyof") | |
| 9 | + public Anyof getAnyof() { return anyof; } | |
| 10 | + @JsonProperty("anyof") | |
| 11 | + public void setAnyof(Anyof value) { this.anyof = value; } | |
| 12 | +} |
Aschema-javadefault / src / main / java / io / quicktype / Anyof.java+18 −0
| @@ -0,0 +1,18 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class Anyof { | |
| 6 | + private String name; | |
| 7 | + private String size; | |
| 8 | + | |
| 9 | + @JsonProperty("name") | |
| 10 | + public String getName() { return name; } | |
| 11 | + @JsonProperty("name") | |
| 12 | + public void setName(String value) { this.name = value; } | |
| 13 | + | |
| 14 | + @JsonProperty("size") | |
| 15 | + public String getSize() { return size; } | |
| 16 | + @JsonProperty("size") | |
| 17 | + public void setSize(String value) { this.size = value; } | |
| 18 | +} |
Aschema-javadefault / 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-javadefault / src / main / java / io / quicktype / TopLevel.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class TopLevel { | |
| 6 | + private Anyof anyof; | |
| 7 | + | |
| 8 | + @JsonProperty("anyof") | |
| 9 | + public Anyof getAnyof() { return anyof; } | |
| 10 | + @JsonProperty("anyof") | |
| 11 | + public void setAnyof(Anyof value) { this.anyof = value; } | |
| 12 | +} |
Aschema-javascriptdefault / TopLevel.js+186 −0
| @@ -0,0 +1,186 @@ | ||
| 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: "anyof", js: "anyof", typ: r("Anyof") }, | |
| 176 | + ], false), | |
| 177 | + "Anyof": o([ | |
| 178 | + { json: "name", js: "name", typ: "" }, | |
| 179 | + { json: "size", js: "size", typ: u(undefined, "") }, | |
| 180 | + ], false), | |
| 181 | +}; | |
| 182 | + | |
| 183 | +module.exports = { | |
| 184 | + "topLevelToJson": topLevelToJson, | |
| 185 | + "toTopLevel": toTopLevel, | |
| 186 | +}; |
Aschema-kotlin-jacksondefault / 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 anyof: Anyof | |
| 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 Anyof ( | |
| 33 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 34 | + val name: String, | |
| 35 | + | |
| 36 | + val size: String? = null | |
| 37 | +) |
Aschema-kotlindefault / TopLevel.kt+24 −0
| @@ -0,0 +1,24 @@ | ||
| 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 anyof: Anyof | |
| 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 Anyof ( | |
| 22 | + val name: String, | |
| 23 | + val size: String? = null | |
| 24 | +) |
Aschema-kotlinxdefault / TopLevel.kt+22 −0
| @@ -0,0 +1,22 @@ | ||
| 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 anyof: Anyof | |
| 16 | +) | |
| 17 | + | |
| 18 | +@Serializable | |
| 19 | +data class Anyof ( | |
| 20 | + val name: String, | |
| 21 | + val size: String? = null | |
| 22 | +) |
Aschema-phpdefault / TopLevel.php+263 −0
| @@ -0,0 +1,263 @@ | ||
| 1 | +<?php | |
| 2 | +declare(strict_types=1); | |
| 3 | + | |
| 4 | +// This is an autogenerated file:TopLevel | |
| 5 | + | |
| 6 | +class TopLevel { | |
| 7 | + private Anyof $anyof; // json:anyof Required | |
| 8 | + | |
| 9 | + /** | |
| 10 | + * @param Anyof $anyof | |
| 11 | + */ | |
| 12 | + public function __construct(Anyof $anyof) { | |
| 13 | + $this->anyof = $anyof; | |
| 14 | + } | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * @param stdClass $value | |
| 18 | + * @throws Exception | |
| 19 | + * @return Anyof | |
| 20 | + */ | |
| 21 | + public static function fromAnyof(stdClass $value): Anyof { | |
| 22 | + return Anyof::from($value); /*class*/ | |
| 23 | + } | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * @throws Exception | |
| 27 | + * @return stdClass | |
| 28 | + */ | |
| 29 | + public function toAnyof(): stdClass { | |
| 30 | + if (TopLevel::validateAnyof($this->anyof)) { | |
| 31 | + return $this->anyof->to(); /*class*/ | |
| 32 | + } | |
| 33 | + throw new Exception('never get to this TopLevel::anyof'); | |
| 34 | + } | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * @param Anyof | |
| 38 | + * @return bool | |
| 39 | + * @throws Exception | |
| 40 | + */ | |
| 41 | + public static function validateAnyof(Anyof $value): bool { | |
| 42 | + $value->validate(); | |
| 43 | + return true; | |
| 44 | + } | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * @throws Exception | |
| 48 | + * @return Anyof | |
| 49 | + */ | |
| 50 | + public function getAnyof(): Anyof { | |
| 51 | + if (TopLevel::validateAnyof($this->anyof)) { | |
| 52 | + return $this->anyof; | |
| 53 | + } | |
| 54 | + throw new Exception('never get to getAnyof TopLevel::anyof'); | |
| 55 | + } | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * @return Anyof | |
| 59 | + */ | |
| 60 | + public static function sampleAnyof(): Anyof { | |
| 61 | + return Anyof::sample(); /*31:anyof*/ | |
| 62 | + } | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * @throws Exception | |
| 66 | + * @return bool | |
| 67 | + */ | |
| 68 | + public function validate(): bool { | |
| 69 | + return TopLevel::validateAnyof($this->anyof); | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * @return stdClass | |
| 74 | + * @throws Exception | |
| 75 | + */ | |
| 76 | + public function to(): stdClass { | |
| 77 | + $out = new stdClass(); | |
| 78 | + $out->{'anyof'} = $this->toAnyof(); | |
| 79 | + return $out; | |
| 80 | + } | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * @param stdClass $obj | |
| 84 | + * @return TopLevel | |
| 85 | + * @throws Exception | |
| 86 | + */ | |
| 87 | + public static function from(stdClass $obj): TopLevel { | |
| 88 | + return new TopLevel( | |
| 89 | + TopLevel::fromAnyof($obj->{'anyof'}) | |
| 90 | + ); | |
| 91 | + } | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * @return TopLevel | |
| 95 | + */ | |
| 96 | + public static function sample(): TopLevel { | |
| 97 | + return new TopLevel( | |
| 98 | + TopLevel::sampleAnyof() | |
| 99 | + ); | |
| 100 | + } | |
| 101 | +} | |
| 102 | + | |
| 103 | +// This is an autogenerated file:Anyof | |
| 104 | + | |
| 105 | +class Anyof { | |
| 106 | + private string $name; // json:name Required | |
| 107 | + private ?string $size; // json:size Optional | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * @param string $name | |
| 111 | + * @param string|null $size | |
| 112 | + */ | |
| 113 | + public function __construct(string $name, ?string $size) { | |
| 114 | + $this->name = $name; | |
| 115 | + $this->size = $size; | |
| 116 | + } | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * @param string $value | |
| 120 | + * @throws Exception | |
| 121 | + * @return string | |
| 122 | + */ | |
| 123 | + public static function fromName(string $value): string { | |
| 124 | + return $value; /*string*/ | |
| 125 | + } | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * @throws Exception | |
| 129 | + * @return string | |
| 130 | + */ | |
| 131 | + public function toName(): string { | |
| 132 | + if (Anyof::validateName($this->name)) { | |
| 133 | + return $this->name; /*string*/ | |
| 134 | + } | |
| 135 | + throw new Exception('never get to this Anyof::name'); | |
| 136 | + } | |
| 137 | + | |
| 138 | + /** | |
| 139 | + * @param string | |
| 140 | + * @return bool | |
| 141 | + * @throws Exception | |
| 142 | + */ | |
| 143 | + public static function validateName(string $value): bool { | |
| 144 | + return true; | |
| 145 | + } | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * @throws Exception | |
| 149 | + * @return string | |
| 150 | + */ | |
| 151 | + public function getName(): string { | |
| 152 | + if (Anyof::validateName($this->name)) { | |
| 153 | + return $this->name; | |
| 154 | + } | |
| 155 | + throw new Exception('never get to getName Anyof::name'); | |
| 156 | + } | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * @return string | |
| 160 | + */ | |
| 161 | + public static function sampleName(): string { | |
| 162 | + return 'Anyof::name::31'; /*31:name*/ | |
| 163 | + } | |
| 164 | + | |
| 165 | + /** | |
| 166 | + * @param ?string $value | |
| 167 | + * @throws Exception | |
| 168 | + * @return ?string | |
| 169 | + */ | |
| 170 | + public static function fromSize(?string $value): ?string { | |
| 171 | + if (!is_null($value)) { | |
| 172 | + return $value; /*string*/ | |
| 173 | + } else { | |
| 174 | + return null; | |
| 175 | + } | |
| 176 | + } | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * @throws Exception | |
| 180 | + * @return ?string | |
| 181 | + */ | |
| 182 | + public function toSize(): ?string { | |
| 183 | + if (Anyof::validateSize($this->size)) { | |
| 184 | + if (!is_null($this->size)) { | |
| 185 | + return $this->size; /*string*/ | |
| 186 | + } else { | |
| 187 | + return null; | |
| 188 | + } | |
| 189 | + } | |
| 190 | + throw new Exception('never get to this Anyof::size'); | |
| 191 | + } | |
| 192 | + | |
| 193 | + /** | |
| 194 | + * @param string|null | |
| 195 | + * @return bool | |
| 196 | + * @throws Exception | |
| 197 | + */ | |
| 198 | + public static function validateSize(?string $value): bool { | |
| 199 | + if (!is_null($value)) { | |
| 200 | + } | |
| 201 | + return true; | |
| 202 | + } | |
| 203 | + | |
| 204 | + /** | |
| 205 | + * @throws Exception | |
| 206 | + * @return ?string | |
| 207 | + */ | |
| 208 | + public function getSize(): ?string { | |
| 209 | + if (Anyof::validateSize($this->size)) { | |
| 210 | + return $this->size; | |
| 211 | + } | |
| 212 | + throw new Exception('never get to getSize Anyof::size'); | |
| 213 | + } | |
| 214 | + | |
| 215 | + /** | |
| 216 | + * @return ?string | |
| 217 | + */ | |
| 218 | + public static function sampleSize(): ?string { | |
| 219 | + return 'Anyof::size::32'; /*32:size*/ | |
| 220 | + } | |
| 221 | + | |
| 222 | + /** | |
| 223 | + * @throws Exception | |
| 224 | + * @return bool | |
| 225 | + */ | |
| 226 | + public function validate(): bool { | |
| 227 | + return Anyof::validateName($this->name) | |
| 228 | + || Anyof::validateSize($this->size); | |
| 229 | + } | |
| 230 | + | |
| 231 | + /** | |
| 232 | + * @return stdClass | |
| 233 | + * @throws Exception | |
| 234 | + */ | |
| 235 | + public function to(): stdClass { | |
| 236 | + $out = new stdClass(); | |
| 237 | + $out->{'name'} = $this->toName(); | |
| 238 | + $out->{'size'} = $this->toSize(); | |
| 239 | + return $out; | |
| 240 | + } | |
| 241 | + | |
| 242 | + /** | |
| 243 | + * @param stdClass $obj | |
| 244 | + * @return Anyof | |
| 245 | + * @throws Exception | |
| 246 | + */ | |
| 247 | + public static function from(stdClass $obj): Anyof { | |
| 248 | + return new Anyof( | |
| 249 | + Anyof::fromName($obj->{'name'}) | |
| 250 | + ,Anyof::fromSize($obj->{'size'}) | |
| 251 | + ); | |
| 252 | + } | |
| 253 | + | |
| 254 | + /** | |
| 255 | + * @return Anyof | |
| 256 | + */ | |
| 257 | + public static function sample(): Anyof { | |
| 258 | + return new Anyof( | |
| 259 | + Anyof::sampleName() | |
| 260 | + ,Anyof::sampleSize() | |
| 261 | + ); | |
| 262 | + } | |
| 263 | +} |
Aschema-pikedefault / TopLevel.pmod+56 −0
| @@ -0,0 +1,56 @@ | ||
| 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 | + Anyof anyof; // json: "anyof" | |
| 17 | + | |
| 18 | + string encode_json() { | |
| 19 | + mapping(string:mixed) json = ([ | |
| 20 | + "anyof" : anyof, | |
| 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.anyof = json["anyof"]; | |
| 31 | + | |
| 32 | + return retval; | |
| 33 | +} | |
| 34 | + | |
| 35 | +class Anyof { | |
| 36 | + string name; // json: "name" | |
| 37 | + mixed|string size; // json: "size" | |
| 38 | + | |
| 39 | + string encode_json() { | |
| 40 | + mapping(string:mixed) json = ([ | |
| 41 | + "name" : name, | |
| 42 | + "size" : size, | |
| 43 | + ]); | |
| 44 | + | |
| 45 | + return Standards.JSON.encode(json); | |
| 46 | + } | |
| 47 | +} | |
| 48 | + | |
| 49 | +Anyof Anyof_from_JSON(mixed json) { | |
| 50 | + Anyof retval = Anyof(); | |
| 51 | + | |
| 52 | + retval.name = json["name"]; | |
| 53 | + retval.size = json["size"]; | |
| 54 | + | |
| 55 | + return retval; | |
| 56 | +} |
Aschema-pythondefault / quicktype.py+73 −0
| @@ -0,0 +1,73 @@ | ||
| 1 | +from dataclasses import dataclass | |
| 2 | +from typing import Any, TypeVar, 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 to_class(c: Type[T], x: Any) -> dict: | |
| 28 | + assert isinstance(x, c) | |
| 29 | + return cast(Any, x).to_dict() | |
| 30 | + | |
| 31 | + | |
| 32 | +@dataclass | |
| 33 | +class Anyof: | |
| 34 | + name: str | |
| 35 | + size: str | None = None | |
| 36 | + | |
| 37 | + @staticmethod | |
| 38 | + def from_dict(obj: Any) -> 'Anyof': | |
| 39 | + assert isinstance(obj, dict) | |
| 40 | + name = from_str(obj.get("name")) | |
| 41 | + size = from_union([from_str, from_none], obj.get("size")) | |
| 42 | + return Anyof(name, size) | |
| 43 | + | |
| 44 | + def to_dict(self) -> dict: | |
| 45 | + result: dict = {} | |
| 46 | + result["name"] = from_str(self.name) | |
| 47 | + if self.size is not None: | |
| 48 | + result["size"] = from_union([from_str, from_none], self.size) | |
| 49 | + return result | |
| 50 | + | |
| 51 | + | |
| 52 | +@dataclass | |
| 53 | +class TopLevel: | |
| 54 | + anyof: Anyof | |
| 55 | + | |
| 56 | + @staticmethod | |
| 57 | + def from_dict(obj: Any) -> 'TopLevel': | |
| 58 | + assert isinstance(obj, dict) | |
| 59 | + anyof = Anyof.from_dict(obj.get("anyof")) | |
| 60 | + return TopLevel(anyof) | |
| 61 | + | |
| 62 | + def to_dict(self) -> dict: | |
| 63 | + result: dict = {} | |
| 64 | + result["anyof"] = to_class(Anyof, self.anyof) | |
| 65 | + return result | |
| 66 | + | |
| 67 | + | |
| 68 | +def top_level_from_dict(s: Any) -> TopLevel: | |
| 69 | + return TopLevel.from_dict(s) | |
| 70 | + | |
| 71 | + | |
| 72 | +def top_level_to_dict(x: TopLevel) -> Any: | |
| 73 | + return to_class(TopLevel, x) |
Aschema-rubydefault / TopLevel.rb+73 −0
| @@ -0,0 +1,73 @@ | ||
| 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.anyof.anyof_name | |
| 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 Anyof < Dry::Struct | |
| 23 | + attribute :anyof_name, Types::String | |
| 24 | + attribute :size, Types::String.optional | |
| 25 | + | |
| 26 | + def self.from_dynamic!(d) | |
| 27 | + d = Types::Hash[d] | |
| 28 | + new( | |
| 29 | + anyof_name: d.fetch("name"), | |
| 30 | + size: d["size"], | |
| 31 | + ) | |
| 32 | + end | |
| 33 | + | |
| 34 | + def self.from_json!(json) | |
| 35 | + from_dynamic!(JSON.parse(json)) | |
| 36 | + end | |
| 37 | + | |
| 38 | + def to_dynamic | |
| 39 | + { | |
| 40 | + "name" => anyof_name, | |
| 41 | + "size" => size, | |
| 42 | + } | |
| 43 | + end | |
| 44 | + | |
| 45 | + def to_json(options = nil) | |
| 46 | + JSON.generate(to_dynamic, options) | |
| 47 | + end | |
| 48 | +end | |
| 49 | + | |
| 50 | +class TopLevel < Dry::Struct | |
| 51 | + attribute :anyof, Anyof | |
| 52 | + | |
| 53 | + def self.from_dynamic!(d) | |
| 54 | + d = Types::Hash[d] | |
| 55 | + new( | |
| 56 | + anyof: Anyof.from_dynamic!(d.fetch("anyof")), | |
| 57 | + ) | |
| 58 | + end | |
| 59 | + | |
| 60 | + def self.from_json!(json) | |
| 61 | + from_dynamic!(JSON.parse(json)) | |
| 62 | + end | |
| 63 | + | |
| 64 | + def to_dynamic | |
| 65 | + { | |
| 66 | + "anyof" => anyof.to_dynamic, | |
| 67 | + } | |
| 68 | + end | |
| 69 | + | |
| 70 | + def to_json(options = nil) | |
| 71 | + JSON.generate(to_dynamic, options) | |
| 72 | + end | |
| 73 | +end |
Aschema-rustdefault / module_under_test.rs+26 −0
| @@ -0,0 +1,26 @@ | ||
| 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 anyof: Anyof, | |
| 19 | +} | |
| 20 | + | |
| 21 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 22 | +pub struct Anyof { | |
| 23 | + pub name: String, | |
| 24 | + | |
| 25 | + pub size: Option<String>, | |
| 26 | +} |
Aschema-scala3-upickledefault / TopLevel.scala+75 −0
| @@ -0,0 +1,75 @@ | ||
| 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 anyof : Anyof | |
| 70 | +) derives OptionPickler.ReadWriter | |
| 71 | + | |
| 72 | +case class Anyof ( | |
| 73 | + val name : String, | |
| 74 | + val size : Option[String] = None | |
| 75 | +) derives OptionPickler.ReadWriter |
Aschema-scala3default / TopLevel.scala+17 −0
| @@ -0,0 +1,17 @@ | ||
| 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 anyof : Anyof | |
| 12 | +) derives Encoder.AsObject, Decoder | |
| 13 | + | |
| 14 | +case class Anyof ( | |
| 15 | + val name : String, | |
| 16 | + val size : Option[String] = None | |
| 17 | +) derives Encoder.AsObject, Decoder |
Aschema-schemadefault / TopLevel.schema+35 −0
| @@ -0,0 +1,35 @@ | ||
| 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 | + "anyof": { | |
| 10 | + "$ref": "#/definitions/Anyof" | |
| 11 | + } | |
| 12 | + }, | |
| 13 | + "required": [ | |
| 14 | + "anyof" | |
| 15 | + ], | |
| 16 | + "title": "TopLevel" | |
| 17 | + }, | |
| 18 | + "Anyof": { | |
| 19 | + "type": "object", | |
| 20 | + "additionalProperties": false, | |
| 21 | + "properties": { | |
| 22 | + "name": { | |
| 23 | + "type": "string" | |
| 24 | + }, | |
| 25 | + "size": { | |
| 26 | + "type": "string" | |
| 27 | + } | |
| 28 | + }, | |
| 29 | + "required": [ | |
| 30 | + "name" | |
| 31 | + ], | |
| 32 | + "title": "Anyof" | |
| 33 | + } | |
| 34 | + } | |
| 35 | +} |
Aschema-swiftdefault / quicktype.swift+134 −0
| @@ -0,0 +1,134 @@ | ||
| 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 anyof: Anyof | |
| 11 | + | |
| 12 | + enum CodingKeys: String, CodingKey { | |
| 13 | + case anyof = "anyof" | |
| 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 | + anyof: Anyof? = nil | |
| 37 | + ) -> TopLevel { | |
| 38 | + return TopLevel( | |
| 39 | + anyof: anyof ?? self.anyof | |
| 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: - Anyof | |
| 53 | +struct Anyof: Codable { | |
| 54 | + let name: String | |
| 55 | + let size: String? | |
| 56 | + | |
| 57 | + enum CodingKeys: String, CodingKey { | |
| 58 | + case name = "name" | |
| 59 | + case size = "size" | |
| 60 | + } | |
| 61 | +} | |
| 62 | + | |
| 63 | +// MARK: Anyof convenience initializers and mutators | |
| 64 | + | |
| 65 | +extension Anyof { | |
| 66 | + init(data: Data) throws { | |
| 67 | + self = try newJSONDecoder().decode(Anyof.self, from: data) | |
| 68 | + } | |
| 69 | + | |
| 70 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 71 | + guard let data = json.data(using: encoding) else { | |
| 72 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 73 | + } | |
| 74 | + try self.init(data: data) | |
| 75 | + } | |
| 76 | + | |
| 77 | + init(fromURL url: URL) throws { | |
| 78 | + try self.init(data: try Data(contentsOf: url)) | |
| 79 | + } | |
| 80 | + | |
| 81 | + func with( | |
| 82 | + name: String? = nil, | |
| 83 | + size: String?? = nil | |
| 84 | + ) -> Anyof { | |
| 85 | + return Anyof( | |
| 86 | + name: name ?? self.name, | |
| 87 | + size: size ?? self.size | |
| 88 | + ) | |
| 89 | + } | |
| 90 | + | |
| 91 | + func jsonData() throws -> Data { | |
| 92 | + return try newJSONEncoder().encode(self) | |
| 93 | + } | |
| 94 | + | |
| 95 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 96 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 97 | + } | |
| 98 | +} | |
| 99 | + | |
| 100 | +// MARK: - Helper functions for creating encoders and decoders | |
| 101 | + | |
| 102 | +func newJSONDecoder() -> JSONDecoder { | |
| 103 | + let decoder = JSONDecoder() | |
| 104 | + decoder.dateDecodingStrategy = .custom({ (decoder) -> Date in | |
| 105 | + let container = try decoder.singleValueContainer() | |
| 106 | + let dateStr = try container.decode(String.self) | |
| 107 | + | |
| 108 | + let formatter = DateFormatter() | |
| 109 | + formatter.calendar = Calendar(identifier: .iso8601) | |
| 110 | + formatter.locale = Locale(identifier: "en_US_POSIX") | |
| 111 | + formatter.timeZone = TimeZone(secondsFromGMT: 0) | |
| 112 | + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" | |
| 113 | + if let date = formatter.date(from: dateStr) { | |
| 114 | + return date | |
| 115 | + } | |
| 116 | + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX" | |
| 117 | + if let date = formatter.date(from: dateStr) { | |
| 118 | + return date | |
| 119 | + } | |
| 120 | + throw DecodingError.typeMismatch(Date.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Could not decode date")) | |
| 121 | + }) | |
| 122 | + return decoder | |
| 123 | +} | |
| 124 | + | |
| 125 | +func newJSONEncoder() -> JSONEncoder { | |
| 126 | + let encoder = JSONEncoder() | |
| 127 | + let formatter = DateFormatter() | |
| 128 | + formatter.calendar = Calendar(identifier: .iso8601) | |
| 129 | + formatter.locale = Locale(identifier: "en_US_POSIX") | |
| 130 | + formatter.timeZone = TimeZone(secondsFromGMT: 0) | |
| 131 | + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX" | |
| 132 | + encoder.dateEncodingStrategy = .formatted(formatter) | |
| 133 | + return encoder | |
| 134 | +} |
Aschema-typescript-zoddefault / TopLevel.ts+13 −0
| @@ -0,0 +1,13 @@ | ||
| 1 | +import * as z from "zod"; | |
| 2 | + | |
| 3 | + | |
| 4 | +export const AnyofSchema = z.object({ | |
| 5 | + "name": z.string(), | |
| 6 | + "size": z.string().optional(), | |
| 7 | +}); | |
| 8 | +export type Anyof = z.infer<typeof AnyofSchema>; | |
| 9 | + | |
| 10 | +export const TopLevelSchema = z.object({ | |
| 11 | + "anyof": AnyofSchema, | |
| 12 | +}); | |
| 13 | +export type TopLevel = z.infer<typeof TopLevelSchema>; |
Aschema-typescriptdefault / TopLevel.ts+192 −0
| @@ -0,0 +1,192 @@ | ||
| 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 | + anyof: Anyof; | |
| 12 | +} | |
| 13 | + | |
| 14 | +export interface Anyof { | |
| 15 | + name: string; | |
| 16 | + size?: string; | |
| 17 | +} | |
| 18 | + | |
| 19 | +// Converts JSON strings to/from your types | |
| 20 | +// and asserts the results of JSON.parse at runtime | |
| 21 | +export class Convert { | |
| 22 | + public static toTopLevel(json: string): TopLevel { | |
| 23 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 24 | + } | |
| 25 | + | |
| 26 | + public static topLevelToJson(value: TopLevel): string { | |
| 27 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 28 | + } | |
| 29 | +} | |
| 30 | + | |
| 31 | +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { | |
| 32 | + const prettyTyp = prettyTypeName(typ); | |
| 33 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 34 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 35 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 36 | +} | |
| 37 | + | |
| 38 | +function prettyTypeName(typ: any): string { | |
| 39 | + if (Array.isArray(typ)) { | |
| 40 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 41 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 42 | + } else { | |
| 43 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 44 | + } | |
| 45 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 46 | + return typ.literal; | |
| 47 | + } else { | |
| 48 | + return typeof typ; | |
| 49 | + } | |
| 50 | +} | |
| 51 | + | |
| 52 | +function jsonToJSProps(typ: any): any { | |
| 53 | + if (typ.jsonToJS === undefined) { | |
| 54 | + const map: any = {}; | |
| 55 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 56 | + typ.jsonToJS = map; | |
| 57 | + } | |
| 58 | + return typ.jsonToJS; | |
| 59 | +} | |
| 60 | + | |
| 61 | +function jsToJSONProps(typ: any): any { | |
| 62 | + if (typ.jsToJSON === undefined) { | |
| 63 | + const map: any = {}; | |
| 64 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 65 | + typ.jsToJSON = map; | |
| 66 | + } | |
| 67 | + return typ.jsToJSON; | |
| 68 | +} | |
| 69 | + | |
| 70 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 71 | + function transformPrimitive(typ: string, val: any): any { | |
| 72 | + if (typeof typ === typeof val) return val; | |
| 73 | + return invalidValue(typ, val, key, parent); | |
| 74 | + } | |
| 75 | + | |
| 76 | + function transformUnion(typs: any[], val: any): any { | |
| 77 | + // val must validate against one typ in typs | |
| 78 | + const l = typs.length; | |
| 79 | + for (let i = 0; i < l; i++) { | |
| 80 | + const typ = typs[i]; | |
| 81 | + try { | |
| 82 | + return transform(val, typ, getProps); | |
| 83 | + } catch (_) {} | |
| 84 | + } | |
| 85 | + return invalidValue(typs, val, key, parent); | |
| 86 | + } | |
| 87 | + | |
| 88 | + function transformEnum(cases: string[], val: any): any { | |
| 89 | + if (cases.indexOf(val) !== -1) return val; | |
| 90 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 91 | + } | |
| 92 | + | |
| 93 | + function transformArray(typ: any, val: any): any { | |
| 94 | + // val must be an array with no invalid elements | |
| 95 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 96 | + return val.map(el => transform(el, typ, getProps)); | |
| 97 | + } | |
| 98 | + | |
| 99 | + function transformDate(val: any): any { | |
| 100 | + if (val === null) { | |
| 101 | + return null; | |
| 102 | + } | |
| 103 | + const d = new Date(val); | |
| 104 | + if (isNaN(d.valueOf())) { | |
| 105 | + return invalidValue(l("Date"), val, key, parent); | |
| 106 | + } | |
| 107 | + return d; | |
| 108 | + } | |
| 109 | + | |
| 110 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 111 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 112 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 113 | + } | |
| 114 | + const result: any = {}; | |
| 115 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 116 | + const prop = props[key]; | |
| 117 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 118 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 119 | + }); | |
| 120 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 121 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 122 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 123 | + } | |
| 124 | + }); | |
| 125 | + return result; | |
| 126 | + } | |
| 127 | + | |
| 128 | + if (typ === "any") return val; | |
| 129 | + if (typ === null) { | |
| 130 | + if (val === null) return val; | |
| 131 | + return invalidValue(typ, val, key, parent); | |
| 132 | + } | |
| 133 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 134 | + let ref: any = undefined; | |
| 135 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 136 | + ref = typ.ref; | |
| 137 | + typ = typeMap[typ.ref]; | |
| 138 | + } | |
| 139 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 140 | + if (typeof typ === "object") { | |
| 141 | + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 142 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 143 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 144 | + : invalidValue(typ, val, key, parent); | |
| 145 | + } | |
| 146 | + // Numbers can be parsed by Date but shouldn't be. | |
| 147 | + if (typ === Date && typeof val !== "number") return transformDate(val); | |
| 148 | + return transformPrimitive(typ, val); | |
| 149 | +} | |
| 150 | + | |
| 151 | +function cast<T>(val: any, typ: any): T { | |
| 152 | + return transform(val, typ, jsonToJSProps); | |
| 153 | +} | |
| 154 | + | |
| 155 | +function uncast<T>(val: T, typ: any): any { | |
| 156 | + return transform(val, typ, jsToJSONProps); | |
| 157 | +} | |
| 158 | + | |
| 159 | +function l(typ: any) { | |
| 160 | + return { literal: typ }; | |
| 161 | +} | |
| 162 | + | |
| 163 | +function a(typ: any) { | |
| 164 | + return { arrayItems: typ }; | |
| 165 | +} | |
| 166 | + | |
| 167 | +function u(...typs: any[]) { | |
| 168 | + return { unionMembers: typs }; | |
| 169 | +} | |
| 170 | + | |
| 171 | +function o(props: any[], additional: any) { | |
| 172 | + return { props, additional }; | |
| 173 | +} | |
| 174 | + | |
| 175 | +function m(additional: any) { | |
| 176 | + const props: any[] = []; | |
| 177 | + return { props, additional }; | |
| 178 | +} | |
| 179 | + | |
| 180 | +function r(name: string) { | |
| 181 | + return { ref: name }; | |
| 182 | +} | |
| 183 | + | |
| 184 | +const typeMap: any = { | |
| 185 | + "TopLevel": o([ | |
| 186 | + { json: "anyof", js: "anyof", typ: r("Anyof") }, | |
| 187 | + ], false), | |
| 188 | + "Anyof": o([ | |
| 189 | + { json: "name", js: "name", typ: "" }, | |
| 190 | + { json: "size", js: "size", typ: u(undefined, "") }, | |
| 191 | + ], false), | |
| 192 | +}; |
Test case
118 generated files · +5,390 −6,400test/inputs/schema/vega-lite.schema
Mschema-cplusplusdefault / quicktype.hpp+312 −312
| @@ -2399,7 +2399,7 @@ namespace quicktype { | ||
| 2399 | 2399 | private: |
| 2400 | 2400 | std::optional<double> count; |
| 2401 | 2401 | std::optional<std::vector<double>> extent; |
| 2402 | - std::optional<std::string> scheme; | |
| 2402 | + std::string scheme; | |
| 2403 | 2403 | std::optional<double> step; |
| 2404 | 2404 | |
| 2405 | 2405 | public: |
| @@ -2411,9 +2411,9 @@ namespace quicktype { | ||
| 2411 | 2411 | std::optional<std::vector<double>> & get_mutable_extent() { return extent; } |
| 2412 | 2412 | void set_extent(const std::optional<std::vector<double>> & value) { this->extent = value; } |
| 2413 | 2413 | |
| 2414 | - const std::optional<std::string> & get_scheme() const { return scheme; } | |
| 2415 | - std::optional<std::string> & get_mutable_scheme() { return scheme; } | |
| 2416 | - void set_scheme(const std::optional<std::string> & value) { this->scheme = value; } | |
| 2414 | + const std::string & get_scheme() const { return scheme; } | |
| 2415 | + std::string & get_mutable_scheme() { return scheme; } | |
| 2416 | + void set_scheme(const std::string & value) { this->scheme = value; } | |
| 2417 | 2417 | |
| 2418 | 2418 | const std::optional<double> & get_step() const { return step; } |
| 2419 | 2419 | std::optional<double> & get_mutable_step() { return step; } |
| @@ -2979,7 +2979,7 @@ namespace quicktype { | ||
| 2979 | 2979 | private: |
| 2980 | 2980 | std::optional<std::string> element; |
| 2981 | 2981 | std::string input; |
| 2982 | - std::optional<std::vector<std::string>> options; | |
| 2982 | + std::vector<std::string> options; | |
| 2983 | 2983 | std::optional<double> max; |
| 2984 | 2984 | std::optional<double> min; |
| 2985 | 2985 | std::optional<double> step; |
| @@ -2993,9 +2993,9 @@ namespace quicktype { | ||
| 2993 | 2993 | std::string & get_mutable_input() { return input; } |
| 2994 | 2994 | void set_input(const std::string & value) { this->input = value; } |
| 2995 | 2995 | |
| 2996 | - const std::optional<std::vector<std::string>> & get_options() const { return options; } | |
| 2997 | - std::optional<std::vector<std::string>> & get_mutable_options() { return options; } | |
| 2998 | - void set_options(const std::optional<std::vector<std::string>> & value) { this->options = value; } | |
| 2996 | + const std::vector<std::string> & get_options() const { return options; } | |
| 2997 | + std::vector<std::string> & get_mutable_options() { return options; } | |
| 2998 | + void set_options(const std::vector<std::string> & value) { this->options = value; } | |
| 2999 | 2999 | |
| 3000 | 3000 | const std::optional<double> & get_max() const { return max; } |
| 3001 | 3001 | std::optional<double> & get_mutable_max() { return max; } |
| @@ -4879,9 +4879,9 @@ namespace quicktype { | ||
| 4879 | 4879 | |
| 4880 | 4880 | private: |
| 4881 | 4881 | std::optional<DataFormat> format; |
| 4882 | - std::optional<std::string> url; | |
| 4883 | - std::optional<Values> values; | |
| 4884 | - std::optional<std::string> name; | |
| 4882 | + std::string url; | |
| 4883 | + Values values; | |
| 4884 | + std::string name; | |
| 4885 | 4885 | |
| 4886 | 4886 | public: |
| 4887 | 4887 | /** |
| @@ -4899,9 +4899,9 @@ namespace quicktype { | ||
| 4899 | 4899 | * An URL from which to load the data set. Use the `format.type` property |
| 4900 | 4900 | * to ensure the loaded data is correctly parsed. |
| 4901 | 4901 | */ |
| 4902 | - const std::optional<std::string> & get_url() const { return url; } | |
| 4903 | - std::optional<std::string> & get_mutable_url() { return url; } | |
| 4904 | - void set_url(const std::optional<std::string> & value) { this->url = value; } | |
| 4902 | + const std::string & get_url() const { return url; } | |
| 4903 | + std::string & get_mutable_url() { return url; } | |
| 4904 | + void set_url(const std::string & value) { this->url = value; } | |
| 4905 | 4905 | |
| 4906 | 4906 | /** |
| 4907 | 4907 | * The full data set, included inline. This can be an array of objects or primitive values |
| @@ -4909,16 +4909,16 @@ namespace quicktype { | ||
| 4909 | 4909 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 4910 | 4910 | * parsed according to the specified format type. |
| 4911 | 4911 | */ |
| 4912 | - const std::optional<Values> & get_values() const { return values; } | |
| 4913 | - std::optional<Values> & get_mutable_values() { return values; } | |
| 4914 | - void set_values(const std::optional<Values> & value) { this->values = value; } | |
| 4912 | + const Values & get_values() const { return values; } | |
| 4913 | + Values & get_mutable_values() { return values; } | |
| 4914 | + void set_values(const Values & value) { this->values = value; } | |
| 4915 | 4915 | |
| 4916 | 4916 | /** |
| 4917 | 4917 | * Provide a placeholder name and bind data at runtime. |
| 4918 | 4918 | */ |
| 4919 | - const std::optional<std::string> & get_name() const { return name; } | |
| 4920 | - std::optional<std::string> & get_mutable_name() { return name; } | |
| 4921 | - void set_name(const std::optional<std::string> & value) { this->name = value; } | |
| 4919 | + const std::string & get_name() const { return name; } | |
| 4920 | + std::string & get_mutable_name() { return name; } | |
| 4921 | + void set_name(const std::string & value) { this->name = value; } | |
| 4922 | 4922 | }; |
| 4923 | 4923 | |
| 4924 | 4924 | /** |
| @@ -5047,22 +5047,22 @@ namespace quicktype { | ||
| 5047 | 5047 | virtual ~Selection() = default; |
| 5048 | 5048 | |
| 5049 | 5049 | private: |
| 5050 | - std::shared_ptr<SelectionOperand> selection_not; | |
| 5051 | - std::optional<std::vector<SelectionOperand>> selection_and; | |
| 5052 | - std::optional<std::vector<SelectionOperand>> selection_or; | |
| 5050 | + SelectionOperand selection_not; | |
| 5051 | + std::vector<SelectionOperand> selection_and; | |
| 5052 | + std::vector<SelectionOperand> selection_or; | |
| 5053 | 5053 | |
| 5054 | 5054 | public: |
| 5055 | - const std::shared_ptr<SelectionOperand> & get_selection_not() const { return selection_not; } | |
| 5056 | - std::shared_ptr<SelectionOperand> & get_mutable_selection_not() { return selection_not; } | |
| 5057 | - void set_selection_not(const std::shared_ptr<SelectionOperand> & value) { this->selection_not = value; } | |
| 5055 | + const SelectionOperand & get_selection_not() const { return selection_not; } | |
| 5056 | + SelectionOperand & get_mutable_selection_not() { return selection_not; } | |
| 5057 | + void set_selection_not(const SelectionOperand & value) { this->selection_not = value; } | |
| 5058 | 5058 | |
| 5059 | - const std::optional<std::vector<SelectionOperand>> & get_selection_and() const { return selection_and; } | |
| 5060 | - std::optional<std::vector<SelectionOperand>> & get_mutable_selection_and() { return selection_and; } | |
| 5061 | - void set_selection_and(const std::optional<std::vector<SelectionOperand>> & value) { this->selection_and = value; } | |
| 5059 | + const std::vector<SelectionOperand> & get_selection_and() const { return selection_and; } | |
| 5060 | + std::vector<SelectionOperand> & get_mutable_selection_and() { return selection_and; } | |
| 5061 | + void set_selection_and(const std::vector<SelectionOperand> & value) { this->selection_and = value; } | |
| 5062 | 5062 | |
| 5063 | - const std::optional<std::vector<SelectionOperand>> & get_selection_or() const { return selection_or; } | |
| 5064 | - std::optional<std::vector<SelectionOperand>> & get_mutable_selection_or() { return selection_or; } | |
| 5065 | - void set_selection_or(const std::optional<std::vector<SelectionOperand>> & value) { this->selection_or = value; } | |
| 5063 | + const std::vector<SelectionOperand> & get_selection_or() const { return selection_or; } | |
| 5064 | + std::vector<SelectionOperand> & get_mutable_selection_or() { return selection_or; } | |
| 5065 | + void set_selection_or(const std::vector<SelectionOperand> & value) { this->selection_or = value; } | |
| 5066 | 5066 | }; |
| 5067 | 5067 | |
| 5068 | 5068 | using Day = std::variant<double, std::string>; |
| @@ -5212,44 +5212,44 @@ namespace quicktype { | ||
| 5212 | 5212 | virtual ~Predicate() = default; |
| 5213 | 5213 | |
| 5214 | 5214 | private: |
| 5215 | - std::shared_ptr<LogicalOperandPredicate> predicate_not; | |
| 5216 | - std::optional<std::vector<LogicalOperandPredicate>> predicate_and; | |
| 5217 | - std::optional<std::vector<LogicalOperandPredicate>> predicate_or; | |
| 5218 | - std::optional<Equal> equal; | |
| 5219 | - std::optional<std::string> field; | |
| 5215 | + LogicalOperandPredicate predicate_not; | |
| 5216 | + std::vector<LogicalOperandPredicate> predicate_and; | |
| 5217 | + std::vector<LogicalOperandPredicate> predicate_or; | |
| 5218 | + Equal equal; | |
| 5219 | + std::string field; | |
| 5220 | 5220 | std::optional<TimeUnit> time_unit; |
| 5221 | - std::optional<std::vector<RangeElement>> range; | |
| 5222 | - std::optional<std::vector<Equal>> one_of; | |
| 5223 | - std::shared_ptr<SelectionOperand> selection; | |
| 5221 | + std::vector<RangeElement> range; | |
| 5222 | + std::vector<Equal> one_of; | |
| 5223 | + SelectionOperand selection; | |
| 5224 | 5224 | |
| 5225 | 5225 | public: |
| 5226 | - const std::shared_ptr<LogicalOperandPredicate> & get_predicate_not() const { return predicate_not; } | |
| 5227 | - std::shared_ptr<LogicalOperandPredicate> & get_mutable_predicate_not() { return predicate_not; } | |
| 5228 | - void set_predicate_not(const std::shared_ptr<LogicalOperandPredicate> & value) { this->predicate_not = value; } | |
| 5226 | + const LogicalOperandPredicate & get_predicate_not() const { return predicate_not; } | |
| 5227 | + LogicalOperandPredicate & get_mutable_predicate_not() { return predicate_not; } | |
| 5228 | + void set_predicate_not(const LogicalOperandPredicate & value) { this->predicate_not = value; } | |
| 5229 | 5229 | |
| 5230 | - const std::optional<std::vector<LogicalOperandPredicate>> & get_predicate_and() const { return predicate_and; } | |
| 5231 | - std::optional<std::vector<LogicalOperandPredicate>> & get_mutable_predicate_and() { return predicate_and; } | |
| 5232 | - void set_predicate_and(const std::optional<std::vector<LogicalOperandPredicate>> & value) { this->predicate_and = value; } | |
| 5230 | + const std::vector<LogicalOperandPredicate> & get_predicate_and() const { return predicate_and; } | |
| 5231 | + std::vector<LogicalOperandPredicate> & get_mutable_predicate_and() { return predicate_and; } | |
| 5232 | + void set_predicate_and(const std::vector<LogicalOperandPredicate> & value) { this->predicate_and = value; } | |
| 5233 | 5233 | |
| 5234 | - const std::optional<std::vector<LogicalOperandPredicate>> & get_predicate_or() const { return predicate_or; } | |
| 5235 | - std::optional<std::vector<LogicalOperandPredicate>> & get_mutable_predicate_or() { return predicate_or; } | |
| 5236 | - void set_predicate_or(const std::optional<std::vector<LogicalOperandPredicate>> & value) { this->predicate_or = value; } | |
| 5234 | + const std::vector<LogicalOperandPredicate> & get_predicate_or() const { return predicate_or; } | |
| 5235 | + std::vector<LogicalOperandPredicate> & get_mutable_predicate_or() { return predicate_or; } | |
| 5236 | + void set_predicate_or(const std::vector<LogicalOperandPredicate> & value) { this->predicate_or = value; } | |
| 5237 | 5237 | |
| 5238 | 5238 | /** |
| 5239 | 5239 | * The value that the field should be equal to. |
| 5240 | 5240 | */ |
| 5241 | - const std::optional<Equal> & get_equal() const { return equal; } | |
| 5242 | - std::optional<Equal> & get_mutable_equal() { return equal; } | |
| 5243 | - void set_equal(const std::optional<Equal> & value) { this->equal = value; } | |
| 5241 | + const Equal & get_equal() const { return equal; } | |
| 5242 | + Equal & get_mutable_equal() { return equal; } | |
| 5243 | + void set_equal(const Equal & value) { this->equal = value; } | |
| 5244 | 5244 | |
| 5245 | 5245 | /** |
| 5246 | 5246 | * Field to be filtered. |
| 5247 | 5247 | * |
| 5248 | 5248 | * Field to be filtered |
| 5249 | 5249 | */ |
| 5250 | - const std::optional<std::string> & get_field() const { return field; } | |
| 5251 | - std::optional<std::string> & get_mutable_field() { return field; } | |
| 5252 | - void set_field(const std::optional<std::string> & value) { this->field = value; } | |
| 5250 | + const std::string & get_field() const { return field; } | |
| 5251 | + std::string & get_mutable_field() { return field; } | |
| 5252 | + void set_field(const std::string & value) { this->field = value; } | |
| 5253 | 5253 | |
| 5254 | 5254 | /** |
| 5255 | 5255 | * Time unit for the field to be filtered. |
| @@ -5264,24 +5264,24 @@ namespace quicktype { | ||
| 5264 | 5264 | * An array of inclusive minimum and maximum values |
| 5265 | 5265 | * for a field value of a data item to be included in the filtered data. |
| 5266 | 5266 | */ |
| 5267 | - const std::optional<std::vector<RangeElement>> & get_range() const { return range; } | |
| 5268 | - std::optional<std::vector<RangeElement>> & get_mutable_range() { return range; } | |
| 5269 | - void set_range(const std::optional<std::vector<RangeElement>> & value) { this->range = value; } | |
| 5267 | + const std::vector<RangeElement> & get_range() const { return range; } | |
| 5268 | + std::vector<RangeElement> & get_mutable_range() { return range; } | |
| 5269 | + void set_range(const std::vector<RangeElement> & value) { this->range = value; } | |
| 5270 | 5270 | |
| 5271 | 5271 | /** |
| 5272 | 5272 | * A set of values that the `field`'s value should be a member of, |
| 5273 | 5273 | * for a data item included in the filtered data. |
| 5274 | 5274 | */ |
| 5275 | - const std::optional<std::vector<Equal>> & get_one_of() const { return one_of; } | |
| 5276 | - std::optional<std::vector<Equal>> & get_mutable_one_of() { return one_of; } | |
| 5277 | - void set_one_of(const std::optional<std::vector<Equal>> & value) { this->one_of = value; } | |
| 5275 | + const std::vector<Equal> & get_one_of() const { return one_of; } | |
| 5276 | + std::vector<Equal> & get_mutable_one_of() { return one_of; } | |
| 5277 | + void set_one_of(const std::vector<Equal> & value) { this->one_of = value; } | |
| 5278 | 5278 | |
| 5279 | 5279 | /** |
| 5280 | 5280 | * Filter using a selection name. |
| 5281 | 5281 | */ |
| 5282 | - const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; } | |
| 5283 | - std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; } | |
| 5284 | - void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; } | |
| 5282 | + const SelectionOperand & get_selection() const { return selection; } | |
| 5283 | + SelectionOperand & get_mutable_selection() { return selection; } | |
| 5284 | + void set_selection(const SelectionOperand & value) { this->selection = value; } | |
| 5285 | 5285 | }; |
| 5286 | 5286 | |
| 5287 | 5287 | using ConditionalValueDefValue = std::variant<bool, double, std::string>; |
| @@ -5292,14 +5292,14 @@ namespace quicktype { | ||
| 5292 | 5292 | virtual ~ConditionalValueDef() = default; |
| 5293 | 5293 | |
| 5294 | 5294 | private: |
| 5295 | - std::shared_ptr<LogicalOperandPredicate> test; | |
| 5295 | + LogicalOperandPredicate test; | |
| 5296 | 5296 | ConditionalValueDefValue value; |
| 5297 | - std::shared_ptr<SelectionOperand> selection; | |
| 5297 | + SelectionOperand selection; | |
| 5298 | 5298 | |
| 5299 | 5299 | public: |
| 5300 | - const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; } | |
| 5301 | - std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; } | |
| 5302 | - void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; } | |
| 5300 | + const LogicalOperandPredicate & get_test() const { return test; } | |
| 5301 | + LogicalOperandPredicate & get_mutable_test() { return test; } | |
| 5302 | + void set_test(const LogicalOperandPredicate & value) { this->test = value; } | |
| 5303 | 5303 | |
| 5304 | 5304 | /** |
| 5305 | 5305 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -5313,9 +5313,9 @@ namespace quicktype { | ||
| 5313 | 5313 | * A [selection name](selection.html), or a series of [composed |
| 5314 | 5314 | * selections](selection.html#compose). |
| 5315 | 5315 | */ |
| 5316 | - const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; } | |
| 5317 | - std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; } | |
| 5318 | - void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; } | |
| 5316 | + const SelectionOperand & get_selection() const { return selection; } | |
| 5317 | + SelectionOperand & get_mutable_selection() { return selection; } | |
| 5318 | + void set_selection(const SelectionOperand & value) { this->selection = value; } | |
| 5319 | 5319 | }; |
| 5320 | 5320 | |
| 5321 | 5321 | enum class RepeatEnum : int { ROW, COLUMN }; |
| @@ -5960,9 +5960,9 @@ namespace quicktype { | ||
| 5960 | 5960 | virtual ~ConditionalPredicateMarkPropFieldDefClass() = default; |
| 5961 | 5961 | |
| 5962 | 5962 | private: |
| 5963 | - std::shared_ptr<LogicalOperandPredicate> test; | |
| 5964 | - std::optional<ConditionalValueDefValue> value; | |
| 5965 | - std::shared_ptr<SelectionOperand> selection; | |
| 5963 | + LogicalOperandPredicate test; | |
| 5964 | + ConditionalValueDefValue value; | |
| 5965 | + SelectionOperand selection; | |
| 5966 | 5966 | std::optional<AggregateOp> aggregate; |
| 5967 | 5967 | std::optional<Bin> bin; |
| 5968 | 5968 | std::optional<Field> field; |
| @@ -5970,28 +5970,28 @@ namespace quicktype { | ||
| 5970 | 5970 | std::optional<Scale> scale; |
| 5971 | 5971 | SortUnion sort; |
| 5972 | 5972 | std::optional<TimeUnit> time_unit; |
| 5973 | - std::optional<Type> type; | |
| 5973 | + Type type; | |
| 5974 | 5974 | |
| 5975 | 5975 | public: |
| 5976 | - const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; } | |
| 5977 | - std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; } | |
| 5978 | - void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; } | |
| 5976 | + const LogicalOperandPredicate & get_test() const { return test; } | |
| 5977 | + LogicalOperandPredicate & get_mutable_test() { return test; } | |
| 5978 | + void set_test(const LogicalOperandPredicate & value) { this->test = value; } | |
| 5979 | 5979 | |
| 5980 | 5980 | /** |
| 5981 | 5981 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5982 | 5982 | * `0` to `1` for opacity). |
| 5983 | 5983 | */ |
| 5984 | - const std::optional<ConditionalValueDefValue> & get_value() const { return value; } | |
| 5985 | - std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; } | |
| 5986 | - void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; } | |
| 5984 | + const ConditionalValueDefValue & get_value() const { return value; } | |
| 5985 | + ConditionalValueDefValue & get_mutable_value() { return value; } | |
| 5986 | + void set_value(const ConditionalValueDefValue & value) { this->value = value; } | |
| 5987 | 5987 | |
| 5988 | 5988 | /** |
| 5989 | 5989 | * A [selection name](selection.html), or a series of [composed |
| 5990 | 5990 | * selections](selection.html#compose). |
| 5991 | 5991 | */ |
| 5992 | - const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; } | |
| 5993 | - std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; } | |
| 5994 | - void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; } | |
| 5992 | + const SelectionOperand & get_selection() const { return selection; } | |
| 5993 | + SelectionOperand & get_mutable_selection() { return selection; } | |
| 5994 | + void set_selection(const SelectionOperand & value) { this->selection = value; } | |
| 5995 | 5995 | |
| 5996 | 5996 | /** |
| 5997 | 5997 | * Aggregation function for the field |
| @@ -6077,9 +6077,9 @@ namespace quicktype { | ||
| 6077 | 6077 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6078 | 6078 | * [geographic projection](projection.html) is applied. |
| 6079 | 6079 | */ |
| 6080 | - const std::optional<Type> & get_type() const { return type; } | |
| 6081 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 6082 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 6080 | + const Type & get_type() const { return type; } | |
| 6081 | + Type & get_mutable_type() { return type; } | |
| 6082 | + void set_type(const Type & value) { this->type = value; } | |
| 6083 | 6083 | }; |
| 6084 | 6084 | |
| 6085 | 6085 | using ColorCondition = std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateMarkPropFieldDefClass>; |
| @@ -6141,7 +6141,7 @@ namespace quicktype { | ||
| 6141 | 6141 | std::optional<Scale> scale; |
| 6142 | 6142 | SortUnion sort; |
| 6143 | 6143 | std::optional<TimeUnit> time_unit; |
| 6144 | - std::optional<Type> type; | |
| 6144 | + Type type; | |
| 6145 | 6145 | std::optional<ConditionalValueDefValue> value; |
| 6146 | 6146 | |
| 6147 | 6147 | public: |
| @@ -6242,9 +6242,9 @@ namespace quicktype { | ||
| 6242 | 6242 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6243 | 6243 | * [geographic projection](projection.html) is applied. |
| 6244 | 6244 | */ |
| 6245 | - const std::optional<Type> & get_type() const { return type; } | |
| 6246 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 6247 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 6245 | + const Type & get_type() const { return type; } | |
| 6246 | + Type & get_mutable_type() { return type; } | |
| 6247 | + void set_type(const Type & value) { this->type = value; } | |
| 6248 | 6248 | |
| 6249 | 6249 | /** |
| 6250 | 6250 | * A constant value in visual domain. |
| @@ -6489,35 +6489,35 @@ namespace quicktype { | ||
| 6489 | 6489 | virtual ~ConditionalPredicateFieldDefClass() = default; |
| 6490 | 6490 | |
| 6491 | 6491 | private: |
| 6492 | - std::shared_ptr<LogicalOperandPredicate> test; | |
| 6493 | - std::optional<ConditionalValueDefValue> value; | |
| 6494 | - std::shared_ptr<SelectionOperand> selection; | |
| 6492 | + LogicalOperandPredicate test; | |
| 6493 | + ConditionalValueDefValue value; | |
| 6494 | + SelectionOperand selection; | |
| 6495 | 6495 | std::optional<AggregateOp> aggregate; |
| 6496 | 6496 | std::optional<Bin> bin; |
| 6497 | 6497 | std::optional<Field> field; |
| 6498 | 6498 | std::optional<TimeUnit> time_unit; |
| 6499 | - std::optional<Type> type; | |
| 6499 | + Type type; | |
| 6500 | 6500 | |
| 6501 | 6501 | public: |
| 6502 | - const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; } | |
| 6503 | - std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; } | |
| 6504 | - void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; } | |
| 6502 | + const LogicalOperandPredicate & get_test() const { return test; } | |
| 6503 | + LogicalOperandPredicate & get_mutable_test() { return test; } | |
| 6504 | + void set_test(const LogicalOperandPredicate & value) { this->test = value; } | |
| 6505 | 6505 | |
| 6506 | 6506 | /** |
| 6507 | 6507 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6508 | 6508 | * `0` to `1` for opacity). |
| 6509 | 6509 | */ |
| 6510 | - const std::optional<ConditionalValueDefValue> & get_value() const { return value; } | |
| 6511 | - std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; } | |
| 6512 | - void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; } | |
| 6510 | + const ConditionalValueDefValue & get_value() const { return value; } | |
| 6511 | + ConditionalValueDefValue & get_mutable_value() { return value; } | |
| 6512 | + void set_value(const ConditionalValueDefValue & value) { this->value = value; } | |
| 6513 | 6513 | |
| 6514 | 6514 | /** |
| 6515 | 6515 | * A [selection name](selection.html), or a series of [composed |
| 6516 | 6516 | * selections](selection.html#compose). |
| 6517 | 6517 | */ |
| 6518 | - const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; } | |
| 6519 | - std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; } | |
| 6520 | - void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; } | |
| 6518 | + const SelectionOperand & get_selection() const { return selection; } | |
| 6519 | + SelectionOperand & get_mutable_selection() { return selection; } | |
| 6520 | + void set_selection(const SelectionOperand & value) { this->selection = value; } | |
| 6521 | 6521 | |
| 6522 | 6522 | /** |
| 6523 | 6523 | * Aggregation function for the field |
| @@ -6572,9 +6572,9 @@ namespace quicktype { | ||
| 6572 | 6572 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6573 | 6573 | * [geographic projection](projection.html) is applied. |
| 6574 | 6574 | */ |
| 6575 | - const std::optional<Type> & get_type() const { return type; } | |
| 6576 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 6577 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 6575 | + const Type & get_type() const { return type; } | |
| 6576 | + Type & get_mutable_type() { return type; } | |
| 6577 | + void set_type(const Type & value) { this->type = value; } | |
| 6578 | 6578 | }; |
| 6579 | 6579 | |
| 6580 | 6580 | using HrefCondition = std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateFieldDefClass>; |
| @@ -6606,7 +6606,7 @@ namespace quicktype { | ||
| 6606 | 6606 | std::optional<HrefCondition> condition; |
| 6607 | 6607 | std::optional<Field> field; |
| 6608 | 6608 | std::optional<TimeUnit> time_unit; |
| 6609 | - std::optional<Type> type; | |
| 6609 | + Type type; | |
| 6610 | 6610 | std::optional<ConditionalValueDefValue> value; |
| 6611 | 6611 | |
| 6612 | 6612 | public: |
| @@ -6676,9 +6676,9 @@ namespace quicktype { | ||
| 6676 | 6676 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6677 | 6677 | * [geographic projection](projection.html) is applied. |
| 6678 | 6678 | */ |
| 6679 | - const std::optional<Type> & get_type() const { return type; } | |
| 6680 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 6681 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 6679 | + const Type & get_type() const { return type; } | |
| 6680 | + Type & get_mutable_type() { return type; } | |
| 6681 | + void set_type(const Type & value) { this->type = value; } | |
| 6682 | 6682 | |
| 6683 | 6683 | /** |
| 6684 | 6684 | * A constant value in visual domain. |
| @@ -6774,36 +6774,36 @@ namespace quicktype { | ||
| 6774 | 6774 | virtual ~ConditionalPredicateTextFieldDefClass() = default; |
| 6775 | 6775 | |
| 6776 | 6776 | private: |
| 6777 | - std::shared_ptr<LogicalOperandPredicate> test; | |
| 6778 | - std::optional<ConditionalValueDefValue> value; | |
| 6779 | - std::shared_ptr<SelectionOperand> selection; | |
| 6777 | + LogicalOperandPredicate test; | |
| 6778 | + ConditionalValueDefValue value; | |
| 6779 | + SelectionOperand selection; | |
| 6780 | 6780 | std::optional<AggregateOp> aggregate; |
| 6781 | 6781 | std::optional<Bin> bin; |
| 6782 | 6782 | std::optional<Field> field; |
| 6783 | 6783 | std::optional<std::string> format; |
| 6784 | 6784 | std::optional<TimeUnit> time_unit; |
| 6785 | - std::optional<Type> type; | |
| 6785 | + Type type; | |
| 6786 | 6786 | |
| 6787 | 6787 | public: |
| 6788 | - const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; } | |
| 6789 | - std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; } | |
| 6790 | - void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; } | |
| 6788 | + const LogicalOperandPredicate & get_test() const { return test; } | |
| 6789 | + LogicalOperandPredicate & get_mutable_test() { return test; } | |
| 6790 | + void set_test(const LogicalOperandPredicate & value) { this->test = value; } | |
| 6791 | 6791 | |
| 6792 | 6792 | /** |
| 6793 | 6793 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6794 | 6794 | * `0` to `1` for opacity). |
| 6795 | 6795 | */ |
| 6796 | - const std::optional<ConditionalValueDefValue> & get_value() const { return value; } | |
| 6797 | - std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; } | |
| 6798 | - void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; } | |
| 6796 | + const ConditionalValueDefValue & get_value() const { return value; } | |
| 6797 | + ConditionalValueDefValue & get_mutable_value() { return value; } | |
| 6798 | + void set_value(const ConditionalValueDefValue & value) { this->value = value; } | |
| 6799 | 6799 | |
| 6800 | 6800 | /** |
| 6801 | 6801 | * A [selection name](selection.html), or a series of [composed |
| 6802 | 6802 | * selections](selection.html#compose). |
| 6803 | 6803 | */ |
| 6804 | - const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; } | |
| 6805 | - std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; } | |
| 6806 | - void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; } | |
| 6804 | + const SelectionOperand & get_selection() const { return selection; } | |
| 6805 | + SelectionOperand & get_mutable_selection() { return selection; } | |
| 6806 | + void set_selection(const SelectionOperand & value) { this->selection = value; } | |
| 6807 | 6807 | |
| 6808 | 6808 | /** |
| 6809 | 6809 | * Aggregation function for the field |
| @@ -6866,9 +6866,9 @@ namespace quicktype { | ||
| 6866 | 6866 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6867 | 6867 | * [geographic projection](projection.html) is applied. |
| 6868 | 6868 | */ |
| 6869 | - const std::optional<Type> & get_type() const { return type; } | |
| 6870 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 6871 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 6869 | + const Type & get_type() const { return type; } | |
| 6870 | + Type & get_mutable_type() { return type; } | |
| 6871 | + void set_type(const Type & value) { this->type = value; } | |
| 6872 | 6872 | }; |
| 6873 | 6873 | |
| 6874 | 6874 | using TextCondition = std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateTextFieldDefClass>; |
| @@ -6903,7 +6903,7 @@ namespace quicktype { | ||
| 6903 | 6903 | std::optional<Field> field; |
| 6904 | 6904 | std::optional<std::string> format; |
| 6905 | 6905 | std::optional<TimeUnit> time_unit; |
| 6906 | - std::optional<Type> type; | |
| 6906 | + Type type; | |
| 6907 | 6907 | std::optional<ConditionalValueDefValue> value; |
| 6908 | 6908 | |
| 6909 | 6909 | public: |
| @@ -6981,9 +6981,9 @@ namespace quicktype { | ||
| 6981 | 6981 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6982 | 6982 | * [geographic projection](projection.html) is applied. |
| 6983 | 6983 | */ |
| 6984 | - const std::optional<Type> & get_type() const { return type; } | |
| 6985 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 6986 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 6984 | + const Type & get_type() const { return type; } | |
| 6985 | + Type & get_mutable_type() { return type; } | |
| 6986 | + void set_type(const Type & value) { this->type = value; } | |
| 6987 | 6987 | |
| 6988 | 6988 | /** |
| 6989 | 6989 | * A constant value in visual domain. |
| @@ -7283,8 +7283,8 @@ namespace quicktype { | ||
| 7283 | 7283 | SortUnion sort; |
| 7284 | 7284 | std::optional<StackOffset> stack; |
| 7285 | 7285 | std::optional<TimeUnit> time_unit; |
| 7286 | - std::optional<Type> type; | |
| 7287 | - std::optional<ConditionalValueDefValue> value; | |
| 7286 | + Type type; | |
| 7287 | + ConditionalValueDefValue value; | |
| 7288 | 7288 | |
| 7289 | 7289 | public: |
| 7290 | 7290 | /** |
| @@ -7396,17 +7396,17 @@ namespace quicktype { | ||
| 7396 | 7396 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 7397 | 7397 | * [geographic projection](projection.html) is applied. |
| 7398 | 7398 | */ |
| 7399 | - const std::optional<Type> & get_type() const { return type; } | |
| 7400 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 7401 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 7399 | + const Type & get_type() const { return type; } | |
| 7400 | + Type & get_mutable_type() { return type; } | |
| 7401 | + void set_type(const Type & value) { this->type = value; } | |
| 7402 | 7402 | |
| 7403 | 7403 | /** |
| 7404 | 7404 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 7405 | 7405 | * `0` to `1` for opacity). |
| 7406 | 7406 | */ |
| 7407 | - const std::optional<ConditionalValueDefValue> & get_value() const { return value; } | |
| 7408 | - std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; } | |
| 7409 | - void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; } | |
| 7407 | + const ConditionalValueDefValue & get_value() const { return value; } | |
| 7408 | + ConditionalValueDefValue & get_mutable_value() { return value; } | |
| 7409 | + void set_value(const ConditionalValueDefValue & value) { this->value = value; } | |
| 7410 | 7410 | }; |
| 7411 | 7411 | |
| 7412 | 7412 | /** |
| @@ -7428,8 +7428,8 @@ namespace quicktype { | ||
| 7428 | 7428 | std::optional<Bin> bin; |
| 7429 | 7429 | std::optional<Field> field; |
| 7430 | 7430 | std::optional<TimeUnit> time_unit; |
| 7431 | - std::optional<Type> type; | |
| 7432 | - std::optional<ConditionalValueDefValue> value; | |
| 7431 | + Type type; | |
| 7432 | + ConditionalValueDefValue value; | |
| 7433 | 7433 | |
| 7434 | 7434 | public: |
| 7435 | 7435 | /** |
| @@ -7485,17 +7485,17 @@ namespace quicktype { | ||
| 7485 | 7485 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 7486 | 7486 | * [geographic projection](projection.html) is applied. |
| 7487 | 7487 | */ |
| 7488 | - const std::optional<Type> & get_type() const { return type; } | |
| 7489 | - std::optional<Type> & get_mutable_type() { return type; } | |
| 7490 | - void set_type(const std::optional<Type> & value) { this->type = value; } | |
| 7488 | + const Type & get_type() const { return type; } | |
| 7489 | + Type & get_mutable_type() { return type; } | |
| 7490 | + void set_type(const Type & value) { this->type = value; } | |
| 7491 | 7491 | |
| 7492 | 7492 | /** |
| 7493 | 7493 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 7494 | 7494 | * `0` to `1` for opacity). |
| 7495 | 7495 | */ |
| 7496 | - const std::optional<ConditionalValueDefValue> & get_value() const { return value; } | |
| 7497 | - std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; } | |
| 7498 | - void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; } | |
| 7496 | + const ConditionalValueDefValue & get_value() const { return value; } | |
| 7497 | + ConditionalValueDefValue & get_mutable_value() { return value; } | |
| 7498 | + void set_value(const ConditionalValueDefValue & value) { this->value = value; } | |
| 7499 | 7499 | }; |
| 7500 | 7500 | |
| 7501 | 7501 | /** |
| @@ -8756,16 +8756,16 @@ namespace quicktype { | ||
| 8756 | 8756 | virtual ~Transform() = default; |
| 8757 | 8757 | |
| 8758 | 8758 | private: |
| 8759 | - std::shared_ptr<LogicalOperandPredicate> filter; | |
| 8759 | + LogicalOperandPredicate filter; | |
| 8760 | 8760 | std::optional<Style> as; |
| 8761 | - std::optional<std::string> calculate; | |
| 8761 | + std::string calculate; | |
| 8762 | 8762 | std::optional<std::string> transform_default; |
| 8763 | - std::optional<LookupData> from; | |
| 8764 | - std::optional<std::string> lookup; | |
| 8765 | - std::optional<Bin> bin; | |
| 8766 | - std::optional<std::string> field; | |
| 8767 | - std::optional<TimeUnit> time_unit; | |
| 8768 | - std::optional<std::vector<AggregatedFieldDef>> aggregate; | |
| 8763 | + LookupData from; | |
| 8764 | + std::string lookup; | |
| 8765 | + Bin bin; | |
| 8766 | + std::string field; | |
| 8767 | + TimeUnit time_unit; | |
| 8768 | + std::vector<AggregatedFieldDef> aggregate; | |
| 8769 | 8769 | std::optional<std::vector<std::string>> groupby; |
| 8770 | 8770 | |
| 8771 | 8771 | public: |
| @@ -8779,9 +8779,9 @@ namespace quicktype { | ||
| 8779 | 8779 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 8780 | 8780 | * or (4) a logical operand that combines (1), (2), or (3). |
| 8781 | 8781 | */ |
| 8782 | - const std::shared_ptr<LogicalOperandPredicate> & get_filter() const { return filter; } | |
| 8783 | - std::shared_ptr<LogicalOperandPredicate> & get_mutable_filter() { return filter; } | |
| 8784 | - void set_filter(const std::shared_ptr<LogicalOperandPredicate> & value) { this->filter = value; } | |
| 8782 | + const LogicalOperandPredicate & get_filter() const { return filter; } | |
| 8783 | + LogicalOperandPredicate & get_mutable_filter() { return filter; } | |
| 8784 | + void set_filter(const LogicalOperandPredicate & value) { this->filter = value; } | |
| 8785 | 8785 | |
| 8786 | 8786 | /** |
| 8787 | 8787 | * The field for storing the computed formula value. |
| @@ -8803,9 +8803,9 @@ namespace quicktype { | ||
| 8803 | 8803 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 8804 | 8804 | * current data object. |
| 8805 | 8805 | */ |
| 8806 | - const std::optional<std::string> & get_calculate() const { return calculate; } | |
| 8807 | - std::optional<std::string> & get_mutable_calculate() { return calculate; } | |
| 8808 | - void set_calculate(const std::optional<std::string> & value) { this->calculate = value; } | |
| 8806 | + const std::string & get_calculate() const { return calculate; } | |
| 8807 | + std::string & get_mutable_calculate() { return calculate; } | |
| 8808 | + void set_calculate(const std::string & value) { this->calculate = value; } | |
| 8809 | 8809 | |
| 8810 | 8810 | /** |
| 8811 | 8811 | * The default value to use if lookup fails. |
| @@ -8819,46 +8819,46 @@ namespace quicktype { | ||
| 8819 | 8819 | /** |
| 8820 | 8820 | * Secondary data reference. |
| 8821 | 8821 | */ |
| 8822 | - const std::optional<LookupData> & get_from() const { return from; } | |
| 8823 | - std::optional<LookupData> & get_mutable_from() { return from; } | |
| 8824 | - void set_from(const std::optional<LookupData> & value) { this->from = value; } | |
| 8822 | + const LookupData & get_from() const { return from; } | |
| 8823 | + LookupData & get_mutable_from() { return from; } | |
| 8824 | + void set_from(const LookupData & value) { this->from = value; } | |
| 8825 | 8825 | |
| 8826 | 8826 | /** |
| 8827 | 8827 | * Key in primary data source. |
| 8828 | 8828 | */ |
| 8829 | - const std::optional<std::string> & get_lookup() const { return lookup; } | |
| 8830 | - std::optional<std::string> & get_mutable_lookup() { return lookup; } | |
| 8831 | - void set_lookup(const std::optional<std::string> & value) { this->lookup = value; } | |
| 8829 | + const std::string & get_lookup() const { return lookup; } | |
| 8830 | + std::string & get_mutable_lookup() { return lookup; } | |
| 8831 | + void set_lookup(const std::string & value) { this->lookup = value; } | |
| 8832 | 8832 | |
| 8833 | 8833 | /** |
| 8834 | 8834 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 8835 | 8835 | */ |
| 8836 | - const std::optional<Bin> & get_bin() const { return bin; } | |
| 8837 | - std::optional<Bin> & get_mutable_bin() { return bin; } | |
| 8838 | - void set_bin(const std::optional<Bin> & value) { this->bin = value; } | |
| 8836 | + const Bin & get_bin() const { return bin; } | |
| 8837 | + Bin & get_mutable_bin() { return bin; } | |
| 8838 | + void set_bin(const Bin & value) { this->bin = value; } | |
| 8839 | 8839 | |
| 8840 | 8840 | /** |
| 8841 | 8841 | * The data field to bin. |
| 8842 | 8842 | * |
| 8843 | 8843 | * The data field to apply time unit. |
| 8844 | 8844 | */ |
| 8845 | - const std::optional<std::string> & get_field() const { return field; } | |
| 8846 | - std::optional<std::string> & get_mutable_field() { return field; } | |
| 8847 | - void set_field(const std::optional<std::string> & value) { this->field = value; } | |
| 8845 | + const std::string & get_field() const { return field; } | |
| 8846 | + std::string & get_mutable_field() { return field; } | |
| 8847 | + void set_field(const std::string & value) { this->field = value; } | |
| 8848 | 8848 | |
| 8849 | 8849 | /** |
| 8850 | 8850 | * The timeUnit. |
| 8851 | 8851 | */ |
| 8852 | - const std::optional<TimeUnit> & get_time_unit() const { return time_unit; } | |
| 8853 | - std::optional<TimeUnit> & get_mutable_time_unit() { return time_unit; } | |
| 8854 | - void set_time_unit(const std::optional<TimeUnit> & value) { this->time_unit = value; } | |
| 8852 | + const TimeUnit & get_time_unit() const { return time_unit; } | |
| 8853 | + TimeUnit & get_mutable_time_unit() { return time_unit; } | |
| 8854 | + void set_time_unit(const TimeUnit & value) { this->time_unit = value; } | |
| 8855 | 8855 | |
| 8856 | 8856 | /** |
| 8857 | 8857 | * Array of objects that define fields to aggregate. |
| 8858 | 8858 | */ |
| 8859 | - const std::optional<std::vector<AggregatedFieldDef>> & get_aggregate() const { return aggregate; } | |
| 8860 | - std::optional<std::vector<AggregatedFieldDef>> & get_mutable_aggregate() { return aggregate; } | |
| 8861 | - void set_aggregate(const std::optional<std::vector<AggregatedFieldDef>> & value) { this->aggregate = value; } | |
| 8859 | + const std::vector<AggregatedFieldDef> & get_aggregate() const { return aggregate; } | |
| 8860 | + std::vector<AggregatedFieldDef> & get_mutable_aggregate() { return aggregate; } | |
| 8861 | + void set_aggregate(const std::vector<AggregatedFieldDef> & value) { this->aggregate = value; } | |
| 8862 | 8862 | |
| 8863 | 8863 | /** |
| 8864 | 8864 | * The data fields to group by. If not specified, a single group containing all data objects |
| @@ -8881,14 +8881,14 @@ namespace quicktype { | ||
| 8881 | 8881 | std::optional<Data> data; |
| 8882 | 8882 | std::optional<std::string> description; |
| 8883 | 8883 | std::optional<double> height; |
| 8884 | - std::optional<std::vector<LayerSpec>> layer; | |
| 8884 | + std::vector<LayerSpec> layer; | |
| 8885 | 8885 | std::optional<std::string> name; |
| 8886 | 8886 | std::optional<Resolve> resolve; |
| 8887 | 8887 | std::optional<Title> title; |
| 8888 | 8888 | std::optional<std::vector<Transform>> transform; |
| 8889 | 8889 | std::optional<double> width; |
| 8890 | - std::optional<Encoding> encoding; | |
| 8891 | - std::optional<AnyMark> mark; | |
| 8890 | + Encoding encoding; | |
| 8891 | + AnyMark mark; | |
| 8892 | 8892 | std::optional<Projection> projection; |
| 8893 | 8893 | std::optional<std::map<std::string, SelectionDef>> selection; |
| 8894 | 8894 | |
| @@ -8936,9 +8936,9 @@ namespace quicktype { | ||
| 8936 | 8936 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 8937 | 8937 | * layering facet specifications is not allowed. |
| 8938 | 8938 | */ |
| 8939 | - const std::optional<std::vector<LayerSpec>> & get_layer() const { return layer; } | |
| 8940 | - std::optional<std::vector<LayerSpec>> & get_mutable_layer() { return layer; } | |
| 8941 | - void set_layer(const std::optional<std::vector<LayerSpec>> & value) { this->layer = value; } | |
| 8939 | + const std::vector<LayerSpec> & get_layer() const { return layer; } | |
| 8940 | + std::vector<LayerSpec> & get_mutable_layer() { return layer; } | |
| 8941 | + void set_layer(const std::vector<LayerSpec> & value) { this->layer = value; } | |
| 8942 | 8942 | |
| 8943 | 8943 | /** |
| 8944 | 8944 | * Name of the visualization for later reference. |
| @@ -8997,9 +8997,9 @@ namespace quicktype { | ||
| 8997 | 8997 | /** |
| 8998 | 8998 | * A key-value mapping between encoding channels and definition of fields. |
| 8999 | 8999 | */ |
| 9000 | - const std::optional<Encoding> & get_encoding() const { return encoding; } | |
| 9001 | - std::optional<Encoding> & get_mutable_encoding() { return encoding; } | |
| 9002 | - void set_encoding(const std::optional<Encoding> & value) { this->encoding = value; } | |
| 9000 | + const Encoding & get_encoding() const { return encoding; } | |
| 9001 | + Encoding & get_mutable_encoding() { return encoding; } | |
| 9002 | + void set_encoding(const Encoding & value) { this->encoding = value; } | |
| 9003 | 9003 | |
| 9004 | 9004 | /** |
| 9005 | 9005 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -9007,9 +9007,9 @@ namespace quicktype { | ||
| 9007 | 9007 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 9008 | 9008 | * object](mark.html#mark-def). |
| 9009 | 9009 | */ |
| 9010 | - const std::optional<AnyMark> & get_mark() const { return mark; } | |
| 9011 | - std::optional<AnyMark> & get_mutable_mark() { return mark; } | |
| 9012 | - void set_mark(const std::optional<AnyMark> & value) { this->mark = value; } | |
| 9010 | + const AnyMark & get_mark() const { return mark; } | |
| 9011 | + AnyMark & get_mutable_mark() { return mark; } | |
| 9012 | + void set_mark(const AnyMark & value) { this->mark = value; } | |
| 9013 | 9013 | |
| 9014 | 9014 | /** |
| 9015 | 9015 | * An object defining properties of geographic projection. |
| @@ -9070,21 +9070,21 @@ namespace quicktype { | ||
| 9070 | 9070 | std::optional<Data> data; |
| 9071 | 9071 | std::optional<std::string> description; |
| 9072 | 9072 | std::optional<double> height; |
| 9073 | - std::optional<std::vector<LayerSpec>> layer; | |
| 9073 | + std::vector<LayerSpec> layer; | |
| 9074 | 9074 | std::optional<std::string> name; |
| 9075 | 9075 | std::optional<Resolve> resolve; |
| 9076 | 9076 | std::optional<Title> title; |
| 9077 | 9077 | std::optional<std::vector<Transform>> transform; |
| 9078 | 9078 | std::optional<double> width; |
| 9079 | - std::optional<Encoding> encoding; | |
| 9080 | - std::optional<AnyMark> mark; | |
| 9079 | + Encoding encoding; | |
| 9080 | + AnyMark mark; | |
| 9081 | 9081 | std::optional<Projection> projection; |
| 9082 | 9082 | std::optional<std::map<std::string, SelectionDef>> selection; |
| 9083 | - std::optional<FacetMapping> facet; | |
| 9083 | + FacetMapping facet; | |
| 9084 | 9084 | std::shared_ptr<Spec> spec; |
| 9085 | - std::optional<Repeat> repeat; | |
| 9086 | - std::optional<std::vector<Spec>> vconcat; | |
| 9087 | - std::optional<std::vector<Spec>> hconcat; | |
| 9085 | + Repeat repeat; | |
| 9086 | + std::vector<Spec> vconcat; | |
| 9087 | + std::vector<Spec> hconcat; | |
| 9088 | 9088 | |
| 9089 | 9089 | public: |
| 9090 | 9090 | /** |
| @@ -9130,9 +9130,9 @@ namespace quicktype { | ||
| 9130 | 9130 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 9131 | 9131 | * layering facet specifications is not allowed. |
| 9132 | 9132 | */ |
| 9133 | - const std::optional<std::vector<LayerSpec>> & get_layer() const { return layer; } | |
| 9134 | - std::optional<std::vector<LayerSpec>> & get_mutable_layer() { return layer; } | |
| 9135 | - void set_layer(const std::optional<std::vector<LayerSpec>> & value) { this->layer = value; } | |
| 9133 | + const std::vector<LayerSpec> & get_layer() const { return layer; } | |
| 9134 | + std::vector<LayerSpec> & get_mutable_layer() { return layer; } | |
| 9135 | + void set_layer(const std::vector<LayerSpec> & value) { this->layer = value; } | |
| 9136 | 9136 | |
| 9137 | 9137 | /** |
| 9138 | 9138 | * Name of the visualization for later reference. |
| @@ -9199,9 +9199,9 @@ namespace quicktype { | ||
| 9199 | 9199 | /** |
| 9200 | 9200 | * A key-value mapping between encoding channels and definition of fields. |
| 9201 | 9201 | */ |
| 9202 | - const std::optional<Encoding> & get_encoding() const { return encoding; } | |
| 9203 | - std::optional<Encoding> & get_mutable_encoding() { return encoding; } | |
| 9204 | - void set_encoding(const std::optional<Encoding> & value) { this->encoding = value; } | |
| 9202 | + const Encoding & get_encoding() const { return encoding; } | |
| 9203 | + Encoding & get_mutable_encoding() { return encoding; } | |
| 9204 | + void set_encoding(const Encoding & value) { this->encoding = value; } | |
| 9205 | 9205 | |
| 9206 | 9206 | /** |
| 9207 | 9207 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -9209,9 +9209,9 @@ namespace quicktype { | ||
| 9209 | 9209 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 9210 | 9210 | * object](mark.html#mark-def). |
| 9211 | 9211 | */ |
| 9212 | - const std::optional<AnyMark> & get_mark() const { return mark; } | |
| 9213 | - std::optional<AnyMark> & get_mutable_mark() { return mark; } | |
| 9214 | - void set_mark(const std::optional<AnyMark> & value) { this->mark = value; } | |
| 9212 | + const AnyMark & get_mark() const { return mark; } | |
| 9213 | + AnyMark & get_mutable_mark() { return mark; } | |
| 9214 | + void set_mark(const AnyMark & value) { this->mark = value; } | |
| 9215 | 9215 | |
| 9216 | 9216 | /** |
| 9217 | 9217 | * An object defining properties of geographic projection. |
| @@ -9234,9 +9234,9 @@ namespace quicktype { | ||
| 9234 | 9234 | * An object that describes mappings between `row` and `column` channels and their field |
| 9235 | 9235 | * definitions. |
| 9236 | 9236 | */ |
| 9237 | - const std::optional<FacetMapping> & get_facet() const { return facet; } | |
| 9238 | - std::optional<FacetMapping> & get_mutable_facet() { return facet; } | |
| 9239 | - void set_facet(const std::optional<FacetMapping> & value) { this->facet = value; } | |
| 9237 | + const FacetMapping & get_facet() const { return facet; } | |
| 9238 | + FacetMapping & get_mutable_facet() { return facet; } | |
| 9239 | + void set_facet(const FacetMapping & value) { this->facet = value; } | |
| 9240 | 9240 | |
| 9241 | 9241 | /** |
| 9242 | 9242 | * A specification of the view that gets faceted. |
| @@ -9249,23 +9249,23 @@ namespace quicktype { | ||
| 9249 | 9249 | * An object that describes what fields should be repeated into views that are laid out as a |
| 9250 | 9250 | * `row` or `column`. |
| 9251 | 9251 | */ |
| 9252 | - const std::optional<Repeat> & get_repeat() const { return repeat; } | |
| 9253 | - std::optional<Repeat> & get_mutable_repeat() { return repeat; } | |
| 9254 | - void set_repeat(const std::optional<Repeat> & value) { this->repeat = value; } | |
| 9252 | + const Repeat & get_repeat() const { return repeat; } | |
| 9253 | + Repeat & get_mutable_repeat() { return repeat; } | |
| 9254 | + void set_repeat(const Repeat & value) { this->repeat = value; } | |
| 9255 | 9255 | |
| 9256 | 9256 | /** |
| 9257 | 9257 | * A list of views that should be concatenated and put into a column. |
| 9258 | 9258 | */ |
| 9259 | - const std::optional<std::vector<Spec>> & get_vconcat() const { return vconcat; } | |
| 9260 | - std::optional<std::vector<Spec>> & get_mutable_vconcat() { return vconcat; } | |
| 9261 | - void set_vconcat(const std::optional<std::vector<Spec>> & value) { this->vconcat = value; } | |
| 9259 | + const std::vector<Spec> & get_vconcat() const { return vconcat; } | |
| 9260 | + std::vector<Spec> & get_mutable_vconcat() { return vconcat; } | |
| 9261 | + void set_vconcat(const std::vector<Spec> & value) { this->vconcat = value; } | |
| 9262 | 9262 | |
| 9263 | 9263 | /** |
| 9264 | 9264 | * A list of views that should be concatenated and put into a row. |
| 9265 | 9265 | */ |
| 9266 | - const std::optional<std::vector<Spec>> & get_hconcat() const { return hconcat; } | |
| 9267 | - std::optional<std::vector<Spec>> & get_mutable_hconcat() { return hconcat; } | |
| 9268 | - void set_hconcat(const std::optional<std::vector<Spec>> & value) { this->hconcat = value; } | |
| 9266 | + const std::vector<Spec> & get_hconcat() const { return hconcat; } | |
| 9267 | + std::vector<Spec> & get_mutable_hconcat() { return hconcat; } | |
| 9268 | + void set_hconcat(const std::vector<Spec> & value) { this->hconcat = value; } | |
| 9269 | 9269 | }; |
| 9270 | 9270 | |
| 9271 | 9271 | class TopLevel { |
| @@ -9280,9 +9280,9 @@ namespace quicktype { | ||
| 9280 | 9280 | std::optional<Config> config; |
| 9281 | 9281 | std::optional<Data> data; |
| 9282 | 9282 | std::optional<std::string> description; |
| 9283 | - std::optional<EncodingWithFacet> encoding; | |
| 9283 | + EncodingWithFacet encoding; | |
| 9284 | 9284 | std::optional<double> height; |
| 9285 | - std::optional<AnyMark> mark; | |
| 9285 | + AnyMark mark; | |
| 9286 | 9286 | std::optional<std::string> name; |
| 9287 | 9287 | std::optional<Padding> padding; |
| 9288 | 9288 | std::optional<Projection> projection; |
| @@ -9290,13 +9290,13 @@ namespace quicktype { | ||
| 9290 | 9290 | std::optional<Title> title; |
| 9291 | 9291 | std::optional<std::vector<Transform>> transform; |
| 9292 | 9292 | std::optional<double> width; |
| 9293 | - std::optional<std::vector<LayerSpec>> layer; | |
| 9293 | + std::vector<LayerSpec> layer; | |
| 9294 | 9294 | std::optional<Resolve> resolve; |
| 9295 | - std::optional<FacetMapping> facet; | |
| 9295 | + FacetMapping facet; | |
| 9296 | 9296 | std::shared_ptr<Spec> spec; |
| 9297 | - std::optional<Repeat> repeat; | |
| 9298 | - std::optional<std::vector<Spec>> vconcat; | |
| 9299 | - std::optional<std::vector<Spec>> hconcat; | |
| 9297 | + Repeat repeat; | |
| 9298 | + std::vector<Spec> vconcat; | |
| 9299 | + std::vector<Spec> hconcat; | |
| 9300 | 9300 | |
| 9301 | 9301 | public: |
| 9302 | 9302 | /** |
| @@ -9356,9 +9356,9 @@ namespace quicktype { | ||
| 9356 | 9356 | /** |
| 9357 | 9357 | * A key-value mapping between encoding channels and definition of fields. |
| 9358 | 9358 | */ |
| 9359 | - const std::optional<EncodingWithFacet> & get_encoding() const { return encoding; } | |
| 9360 | - std::optional<EncodingWithFacet> & get_mutable_encoding() { return encoding; } | |
| 9361 | - void set_encoding(const std::optional<EncodingWithFacet> & value) { this->encoding = value; } | |
| 9359 | + const EncodingWithFacet & get_encoding() const { return encoding; } | |
| 9360 | + EncodingWithFacet & get_mutable_encoding() { return encoding; } | |
| 9361 | + void set_encoding(const EncodingWithFacet & value) { this->encoding = value; } | |
| 9362 | 9362 | |
| 9363 | 9363 | /** |
| 9364 | 9364 | * The height of a visualization. |
| @@ -9389,9 +9389,9 @@ namespace quicktype { | ||
| 9389 | 9389 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 9390 | 9390 | * object](mark.html#mark-def). |
| 9391 | 9391 | */ |
| 9392 | - const std::optional<AnyMark> & get_mark() const { return mark; } | |
| 9393 | - std::optional<AnyMark> & get_mutable_mark() { return mark; } | |
| 9394 | - void set_mark(const std::optional<AnyMark> & value) { this->mark = value; } | |
| 9392 | + const AnyMark & get_mark() const { return mark; } | |
| 9393 | + AnyMark & get_mutable_mark() { return mark; } | |
| 9394 | + void set_mark(const AnyMark & value) { this->mark = value; } | |
| 9395 | 9395 | |
| 9396 | 9396 | /** |
| 9397 | 9397 | * Name of the visualization for later reference. |
| @@ -9475,9 +9475,9 @@ namespace quicktype { | ||
| 9475 | 9475 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 9476 | 9476 | * layering facet specifications is not allowed. |
| 9477 | 9477 | */ |
| 9478 | - const std::optional<std::vector<LayerSpec>> & get_layer() const { return layer; } | |
| 9479 | - std::optional<std::vector<LayerSpec>> & get_mutable_layer() { return layer; } | |
| 9480 | - void set_layer(const std::optional<std::vector<LayerSpec>> & value) { this->layer = value; } | |
| 9478 | + const std::vector<LayerSpec> & get_layer() const { return layer; } | |
| 9479 | + std::vector<LayerSpec> & get_mutable_layer() { return layer; } | |
| 9480 | + void set_layer(const std::vector<LayerSpec> & value) { this->layer = value; } | |
| 9481 | 9481 | |
| 9482 | 9482 | /** |
| 9483 | 9483 | * Scale, axis, and legend resolutions for layers. |
| @@ -9498,9 +9498,9 @@ namespace quicktype { | ||
| 9498 | 9498 | * An object that describes mappings between `row` and `column` channels and their field |
| 9499 | 9499 | * definitions. |
| 9500 | 9500 | */ |
| 9501 | - const std::optional<FacetMapping> & get_facet() const { return facet; } | |
| 9502 | - std::optional<FacetMapping> & get_mutable_facet() { return facet; } | |
| 9503 | - void set_facet(const std::optional<FacetMapping> & value) { this->facet = value; } | |
| 9501 | + const FacetMapping & get_facet() const { return facet; } | |
| 9502 | + FacetMapping & get_mutable_facet() { return facet; } | |
| 9503 | + void set_facet(const FacetMapping & value) { this->facet = value; } | |
| 9504 | 9504 | |
| 9505 | 9505 | /** |
| 9506 | 9506 | * A specification of the view that gets faceted. |
| @@ -9513,23 +9513,23 @@ namespace quicktype { | ||
| 9513 | 9513 | * An object that describes what fields should be repeated into views that are laid out as a |
| 9514 | 9514 | * `row` or `column`. |
| 9515 | 9515 | */ |
| 9516 | - const std::optional<Repeat> & get_repeat() const { return repeat; } | |
| 9517 | - std::optional<Repeat> & get_mutable_repeat() { return repeat; } | |
| 9518 | - void set_repeat(const std::optional<Repeat> & value) { this->repeat = value; } | |
| 9516 | + const Repeat & get_repeat() const { return repeat; } | |
| 9517 | + Repeat & get_mutable_repeat() { return repeat; } | |
| 9518 | + void set_repeat(const Repeat & value) { this->repeat = value; } | |
| 9519 | 9519 | |
| 9520 | 9520 | /** |
| 9521 | 9521 | * A list of views that should be concatenated and put into a column. |
| 9522 | 9522 | */ |
| 9523 | - const std::optional<std::vector<Spec>> & get_vconcat() const { return vconcat; } | |
| 9524 | - std::optional<std::vector<Spec>> & get_mutable_vconcat() { return vconcat; } | |
| 9525 | - void set_vconcat(const std::optional<std::vector<Spec>> & value) { this->vconcat = value; } | |
| 9523 | + const std::vector<Spec> & get_vconcat() const { return vconcat; } | |
| 9524 | + std::vector<Spec> & get_mutable_vconcat() { return vconcat; } | |
| 9525 | + void set_vconcat(const std::vector<Spec> & value) { this->vconcat = value; } | |
| 9526 | 9526 | |
| 9527 | 9527 | /** |
| 9528 | 9528 | * A list of views that should be concatenated and put into a row. |
| 9529 | 9529 | */ |
| 9530 | - const std::optional<std::vector<Spec>> & get_hconcat() const { return hconcat; } | |
| 9531 | - std::optional<std::vector<Spec>> & get_mutable_hconcat() { return hconcat; } | |
| 9532 | - void set_hconcat(const std::optional<std::vector<Spec>> & value) { this->hconcat = value; } | |
| 9530 | + const std::vector<Spec> & get_hconcat() const { return hconcat; } | |
| 9531 | + std::vector<Spec> & get_mutable_hconcat() { return hconcat; } | |
| 9532 | + void set_hconcat(const std::vector<Spec> & value) { this->hconcat = value; } | |
| 9533 | 9533 | }; |
| 9534 | 9534 | } |
| 9535 | 9535 | |
| @@ -10507,7 +10507,7 @@ namespace quicktype { | ||
| 10507 | 10507 | inline void from_json(const json & j, VgScheme& x) { |
| 10508 | 10508 | x.set_count(get_stack_optional<double>(j, "count")); |
| 10509 | 10509 | x.set_extent(get_stack_optional<std::vector<double>>(j, "extent")); |
| 10510 | - x.set_scheme(get_stack_optional<std::string>(j, "scheme")); | |
| 10510 | + x.set_scheme(j.at("scheme").get<std::string>()); | |
| 10511 | 10511 | x.set_step(get_stack_optional<double>(j, "step")); |
| 10512 | 10512 | } |
| 10513 | 10513 | |
| @@ -10634,7 +10634,7 @@ namespace quicktype { | ||
| 10634 | 10634 | inline void from_json(const json & j, VgBinding& x) { |
| 10635 | 10635 | x.set_element(get_stack_optional<std::string>(j, "element")); |
| 10636 | 10636 | x.set_input(j.at("input").get<std::string>()); |
| 10637 | - x.set_options(get_stack_optional<std::vector<std::string>>(j, "options")); | |
| 10637 | + x.set_options(j.at("options").get<std::vector<std::string>>()); | |
| 10638 | 10638 | x.set_max(get_stack_optional<double>(j, "max")); |
| 10639 | 10639 | x.set_min(get_stack_optional<double>(j, "min")); |
| 10640 | 10640 | x.set_step(get_stack_optional<double>(j, "step")); |
| @@ -11041,9 +11041,9 @@ namespace quicktype { | ||
| 11041 | 11041 | |
| 11042 | 11042 | inline void from_json(const json & j, Data& x) { |
| 11043 | 11043 | x.set_format(get_stack_optional<DataFormat>(j, "format")); |
| 11044 | - x.set_url(get_stack_optional<std::string>(j, "url")); | |
| 11045 | - x.set_values(get_stack_optional<std::variant<std::vector<ValuesValue>, std::map<std::string, nlohmann::json>, std::string>>(j, "values")); | |
| 11046 | - x.set_name(get_stack_optional<std::string>(j, "name")); | |
| 11044 | + x.set_url(j.at("url").get<std::string>()); | |
| 11045 | + x.set_values(j.at("values").get<Values>()); | |
| 11046 | + x.set_name(j.at("name").get<std::string>()); | |
| 11047 | 11047 | } |
| 11048 | 11048 | |
| 11049 | 11049 | inline void to_json(json & j, const Data & x) { |
| @@ -11078,9 +11078,9 @@ namespace quicktype { | ||
| 11078 | 11078 | } |
| 11079 | 11079 | |
| 11080 | 11080 | inline void from_json(const json & j, Selection& x) { |
| 11081 | - x.set_selection_not(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "not")); | |
| 11082 | - x.set_selection_and(get_stack_optional<std::vector<SelectionOperand>>(j, "and")); | |
| 11083 | - x.set_selection_or(get_stack_optional<std::vector<SelectionOperand>>(j, "or")); | |
| 11081 | + x.set_selection_not(j.at("not").get<SelectionOperand>()); | |
| 11082 | + x.set_selection_and(j.at("and").get<std::vector<SelectionOperand>>()); | |
| 11083 | + x.set_selection_or(j.at("or").get<std::vector<SelectionOperand>>()); | |
| 11084 | 11084 | } |
| 11085 | 11085 | |
| 11086 | 11086 | inline void to_json(json & j, const Selection & x) { |
| @@ -11118,15 +11118,15 @@ namespace quicktype { | ||
| 11118 | 11118 | } |
| 11119 | 11119 | |
| 11120 | 11120 | inline void from_json(const json & j, Predicate& x) { |
| 11121 | - x.set_predicate_not(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "not")); | |
| 11122 | - x.set_predicate_and(get_stack_optional<std::vector<LogicalOperandPredicate>>(j, "and")); | |
| 11123 | - x.set_predicate_or(get_stack_optional<std::vector<LogicalOperandPredicate>>(j, "or")); | |
| 11124 | - x.set_equal(get_stack_optional<std::variant<bool, DateTime, double, std::string>>(j, "equal")); | |
| 11125 | - x.set_field(get_stack_optional<std::string>(j, "field")); | |
| 11121 | + x.set_predicate_not(j.at("not").get<LogicalOperandPredicate>()); | |
| 11122 | + x.set_predicate_and(j.at("and").get<std::vector<LogicalOperandPredicate>>()); | |
| 11123 | + x.set_predicate_or(j.at("or").get<std::vector<LogicalOperandPredicate>>()); | |
| 11124 | + x.set_equal(j.at("equal").get<Equal>()); | |
| 11125 | + x.set_field(j.at("field").get<std::string>()); | |
| 11126 | 11126 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11127 | - x.set_range(get_stack_optional<std::vector<RangeElement>>(j, "range")); | |
| 11128 | - x.set_one_of(get_stack_optional<std::vector<Equal>>(j, "oneOf")); | |
| 11129 | - x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection")); | |
| 11127 | + x.set_range(j.at("range").get<std::vector<RangeElement>>()); | |
| 11128 | + x.set_one_of(j.at("oneOf").get<std::vector<Equal>>()); | |
| 11129 | + x.set_selection(j.at("selection").get<SelectionOperand>()); | |
| 11130 | 11130 | } |
| 11131 | 11131 | |
| 11132 | 11132 | inline void to_json(json & j, const Predicate & x) { |
| @@ -11143,9 +11143,9 @@ namespace quicktype { | ||
| 11143 | 11143 | } |
| 11144 | 11144 | |
| 11145 | 11145 | inline void from_json(const json & j, ConditionalValueDef& x) { |
| 11146 | - x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test")); | |
| 11146 | + x.set_test(j.at("test").get<LogicalOperandPredicate>()); | |
| 11147 | 11147 | x.set_value(j.at("value").get<ConditionalValueDefValue>()); |
| 11148 | - x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection")); | |
| 11148 | + x.set_selection(j.at("selection").get<SelectionOperand>()); | |
| 11149 | 11149 | } |
| 11150 | 11150 | |
| 11151 | 11151 | inline void to_json(json & j, const ConditionalValueDef & x) { |
| @@ -11288,9 +11288,9 @@ namespace quicktype { | ||
| 11288 | 11288 | } |
| 11289 | 11289 | |
| 11290 | 11290 | inline void from_json(const json & j, ConditionalPredicateMarkPropFieldDefClass& x) { |
| 11291 | - x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test")); | |
| 11292 | - x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); | |
| 11293 | - x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection")); | |
| 11291 | + x.set_test(j.at("test").get<LogicalOperandPredicate>()); | |
| 11292 | + x.set_value(j.at("value").get<ConditionalValueDefValue>()); | |
| 11293 | + x.set_selection(j.at("selection").get<SelectionOperand>()); | |
| 11294 | 11294 | x.set_aggregate(get_stack_optional<AggregateOp>(j, "aggregate")); |
| 11295 | 11295 | x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin")); |
| 11296 | 11296 | x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field")); |
| @@ -11298,7 +11298,7 @@ namespace quicktype { | ||
| 11298 | 11298 | x.set_scale(get_stack_optional<Scale>(j, "scale")); |
| 11299 | 11299 | x.set_sort(get_stack_optional<std::variant<SortField, SortEnum>>(j, "sort")); |
| 11300 | 11300 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11301 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11301 | + x.set_type(j.at("type").get<Type>()); | |
| 11302 | 11302 | } |
| 11303 | 11303 | |
| 11304 | 11304 | inline void to_json(json & j, const ConditionalPredicateMarkPropFieldDefClass & x) { |
| @@ -11325,7 +11325,7 @@ namespace quicktype { | ||
| 11325 | 11325 | x.set_scale(get_stack_optional<Scale>(j, "scale")); |
| 11326 | 11326 | x.set_sort(get_stack_optional<std::variant<SortField, SortEnum>>(j, "sort")); |
| 11327 | 11327 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11328 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11328 | + x.set_type(j.at("type").get<Type>()); | |
| 11329 | 11329 | x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); |
| 11330 | 11330 | } |
| 11331 | 11331 | |
| @@ -11395,14 +11395,14 @@ namespace quicktype { | ||
| 11395 | 11395 | } |
| 11396 | 11396 | |
| 11397 | 11397 | inline void from_json(const json & j, ConditionalPredicateFieldDefClass& x) { |
| 11398 | - x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test")); | |
| 11399 | - x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); | |
| 11400 | - x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection")); | |
| 11398 | + x.set_test(j.at("test").get<LogicalOperandPredicate>()); | |
| 11399 | + x.set_value(j.at("value").get<ConditionalValueDefValue>()); | |
| 11400 | + x.set_selection(j.at("selection").get<SelectionOperand>()); | |
| 11401 | 11401 | x.set_aggregate(get_stack_optional<AggregateOp>(j, "aggregate")); |
| 11402 | 11402 | x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin")); |
| 11403 | 11403 | x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field")); |
| 11404 | 11404 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11405 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11405 | + x.set_type(j.at("type").get<Type>()); | |
| 11406 | 11406 | } |
| 11407 | 11407 | |
| 11408 | 11408 | inline void to_json(json & j, const ConditionalPredicateFieldDefClass & x) { |
| @@ -11423,7 +11423,7 @@ namespace quicktype { | ||
| 11423 | 11423 | x.set_condition(get_stack_optional<std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateFieldDefClass>>(j, "condition")); |
| 11424 | 11424 | x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field")); |
| 11425 | 11425 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11426 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11426 | + x.set_type(j.at("type").get<Type>()); | |
| 11427 | 11427 | x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); |
| 11428 | 11428 | } |
| 11429 | 11429 | |
| @@ -11458,15 +11458,15 @@ namespace quicktype { | ||
| 11458 | 11458 | } |
| 11459 | 11459 | |
| 11460 | 11460 | inline void from_json(const json & j, ConditionalPredicateTextFieldDefClass& x) { |
| 11461 | - x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test")); | |
| 11462 | - x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); | |
| 11463 | - x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection")); | |
| 11461 | + x.set_test(j.at("test").get<LogicalOperandPredicate>()); | |
| 11462 | + x.set_value(j.at("value").get<ConditionalValueDefValue>()); | |
| 11463 | + x.set_selection(j.at("selection").get<SelectionOperand>()); | |
| 11464 | 11464 | x.set_aggregate(get_stack_optional<AggregateOp>(j, "aggregate")); |
| 11465 | 11465 | x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin")); |
| 11466 | 11466 | x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field")); |
| 11467 | 11467 | x.set_format(get_stack_optional<std::string>(j, "format")); |
| 11468 | 11468 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11469 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11469 | + x.set_type(j.at("type").get<Type>()); | |
| 11470 | 11470 | } |
| 11471 | 11471 | |
| 11472 | 11472 | inline void to_json(json & j, const ConditionalPredicateTextFieldDefClass & x) { |
| @@ -11489,7 +11489,7 @@ namespace quicktype { | ||
| 11489 | 11489 | x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field")); |
| 11490 | 11490 | x.set_format(get_stack_optional<std::string>(j, "format")); |
| 11491 | 11491 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11492 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11492 | + x.set_type(j.at("type").get<Type>()); | |
| 11493 | 11493 | x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); |
| 11494 | 11494 | } |
| 11495 | 11495 | |
| @@ -11565,8 +11565,8 @@ namespace quicktype { | ||
| 11565 | 11565 | x.set_sort(get_stack_optional<std::variant<SortField, SortEnum>>(j, "sort")); |
| 11566 | 11566 | x.set_stack(get_stack_optional<StackOffset>(j, "stack")); |
| 11567 | 11567 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11568 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11569 | - x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); | |
| 11568 | + x.set_type(j.at("type").get<Type>()); | |
| 11569 | + x.set_value(j.at("value").get<ConditionalValueDefValue>()); | |
| 11570 | 11570 | } |
| 11571 | 11571 | |
| 11572 | 11572 | inline void to_json(json & j, const XClass & x) { |
| @@ -11588,8 +11588,8 @@ namespace quicktype { | ||
| 11588 | 11588 | x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin")); |
| 11589 | 11589 | x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field")); |
| 11590 | 11590 | x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); |
| 11591 | - x.set_type(get_stack_optional<Type>(j, "type")); | |
| 11592 | - x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value")); | |
| 11591 | + x.set_type(j.at("type").get<Type>()); | |
| 11592 | + x.set_value(j.at("value").get<ConditionalValueDefValue>()); | |
| 11593 | 11593 | } |
| 11594 | 11594 | |
| 11595 | 11595 | inline void to_json(json & j, const X2Class & x) { |
| @@ -11926,16 +11926,16 @@ namespace quicktype { | ||
| 11926 | 11926 | } |
| 11927 | 11927 | |
| 11928 | 11928 | inline void from_json(const json & j, Transform& x) { |
| 11929 | - x.set_filter(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "filter")); | |
| 11929 | + x.set_filter(j.at("filter").get<LogicalOperandPredicate>()); | |
| 11930 | 11930 | x.set_as(get_stack_optional<std::variant<std::vector<std::string>, std::string>>(j, "as")); |
| 11931 | - x.set_calculate(get_stack_optional<std::string>(j, "calculate")); | |
| 11931 | + x.set_calculate(j.at("calculate").get<std::string>()); | |
| 11932 | 11932 | x.set_transform_default(get_stack_optional<std::string>(j, "default")); |
| 11933 | - x.set_from(get_stack_optional<LookupData>(j, "from")); | |
| 11934 | - x.set_lookup(get_stack_optional<std::string>(j, "lookup")); | |
| 11935 | - x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin")); | |
| 11936 | - x.set_field(get_stack_optional<std::string>(j, "field")); | |
| 11937 | - x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit")); | |
| 11938 | - x.set_aggregate(get_stack_optional<std::vector<AggregatedFieldDef>>(j, "aggregate")); | |
| 11933 | + x.set_from(j.at("from").get<LookupData>()); | |
| 11934 | + x.set_lookup(j.at("lookup").get<std::string>()); | |
| 11935 | + x.set_bin(j.at("bin").get<Bin>()); | |
| 11936 | + x.set_field(j.at("field").get<std::string>()); | |
| 11937 | + x.set_time_unit(j.at("timeUnit").get<TimeUnit>()); | |
| 11938 | + x.set_aggregate(j.at("aggregate").get<std::vector<AggregatedFieldDef>>()); | |
| 11939 | 11939 | x.set_groupby(get_stack_optional<std::vector<std::string>>(j, "groupby")); |
| 11940 | 11940 | } |
| 11941 | 11941 | |
| @@ -11958,14 +11958,14 @@ namespace quicktype { | ||
| 11958 | 11958 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 11959 | 11959 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 11960 | 11960 | x.set_height(get_stack_optional<double>(j, "height")); |
| 11961 | - x.set_layer(get_stack_optional<std::vector<LayerSpec>>(j, "layer")); | |
| 11961 | + x.set_layer(j.at("layer").get<std::vector<LayerSpec>>()); | |
| 11962 | 11962 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 11963 | 11963 | x.set_resolve(get_stack_optional<Resolve>(j, "resolve")); |
| 11964 | 11964 | x.set_title(get_stack_optional<std::variant<TitleParams, std::string>>(j, "title")); |
| 11965 | 11965 | x.set_transform(get_stack_optional<std::vector<Transform>>(j, "transform")); |
| 11966 | 11966 | x.set_width(get_stack_optional<double>(j, "width")); |
| 11967 | - x.set_encoding(get_stack_optional<Encoding>(j, "encoding")); | |
| 11968 | - x.set_mark(get_stack_optional<std::variant<MarkDef, Mark>>(j, "mark")); | |
| 11967 | + x.set_encoding(j.at("encoding").get<Encoding>()); | |
| 11968 | + x.set_mark(j.at("mark").get<AnyMark>()); | |
| 11969 | 11969 | x.set_projection(get_stack_optional<Projection>(j, "projection")); |
| 11970 | 11970 | x.set_selection(get_stack_optional<std::map<std::string, SelectionDef>>(j, "selection")); |
| 11971 | 11971 | } |
| @@ -12002,21 +12002,21 @@ namespace quicktype { | ||
| 12002 | 12002 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 12003 | 12003 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 12004 | 12004 | x.set_height(get_stack_optional<double>(j, "height")); |
| 12005 | - x.set_layer(get_stack_optional<std::vector<LayerSpec>>(j, "layer")); | |
| 12005 | + x.set_layer(j.at("layer").get<std::vector<LayerSpec>>()); | |
| 12006 | 12006 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 12007 | 12007 | x.set_resolve(get_stack_optional<Resolve>(j, "resolve")); |
| 12008 | 12008 | x.set_title(get_stack_optional<std::variant<TitleParams, std::string>>(j, "title")); |
| 12009 | 12009 | x.set_transform(get_stack_optional<std::vector<Transform>>(j, "transform")); |
| 12010 | 12010 | x.set_width(get_stack_optional<double>(j, "width")); |
| 12011 | - x.set_encoding(get_stack_optional<Encoding>(j, "encoding")); | |
| 12012 | - x.set_mark(get_stack_optional<std::variant<MarkDef, Mark>>(j, "mark")); | |
| 12011 | + x.set_encoding(j.at("encoding").get<Encoding>()); | |
| 12012 | + x.set_mark(j.at("mark").get<AnyMark>()); | |
| 12013 | 12013 | x.set_projection(get_stack_optional<Projection>(j, "projection")); |
| 12014 | 12014 | x.set_selection(get_stack_optional<std::map<std::string, SelectionDef>>(j, "selection")); |
| 12015 | - x.set_facet(get_stack_optional<FacetMapping>(j, "facet")); | |
| 12016 | - x.set_spec(get_heap_optional<Spec>(j, "spec")); | |
| 12017 | - x.set_repeat(get_stack_optional<Repeat>(j, "repeat")); | |
| 12018 | - x.set_vconcat(get_stack_optional<std::vector<Spec>>(j, "vconcat")); | |
| 12019 | - x.set_hconcat(get_stack_optional<std::vector<Spec>>(j, "hconcat")); | |
| 12015 | + x.set_facet(j.at("facet").get<FacetMapping>()); | |
| 12016 | + x.set_spec(j.at("spec").get<std::shared_ptr<Spec>>()); | |
| 12017 | + x.set_repeat(j.at("repeat").get<Repeat>()); | |
| 12018 | + x.set_vconcat(j.at("vconcat").get<std::vector<Spec>>()); | |
| 12019 | + x.set_hconcat(j.at("hconcat").get<std::vector<Spec>>()); | |
| 12020 | 12020 | } |
| 12021 | 12021 | |
| 12022 | 12022 | inline void to_json(json & j, const Spec & x) { |
| @@ -12048,9 +12048,9 @@ namespace quicktype { | ||
| 12048 | 12048 | x.set_config(get_stack_optional<Config>(j, "config")); |
| 12049 | 12049 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 12050 | 12050 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 12051 | - x.set_encoding(get_stack_optional<EncodingWithFacet>(j, "encoding")); | |
| 12051 | + x.set_encoding(j.at("encoding").get<EncodingWithFacet>()); | |
| 12052 | 12052 | x.set_height(get_stack_optional<double>(j, "height")); |
| 12053 | - x.set_mark(get_stack_optional<std::variant<MarkDef, Mark>>(j, "mark")); | |
| 12053 | + x.set_mark(j.at("mark").get<AnyMark>()); | |
| 12054 | 12054 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 12055 | 12055 | x.set_padding(get_stack_optional<std::variant<PaddingClass, double>>(j, "padding")); |
| 12056 | 12056 | x.set_projection(get_stack_optional<Projection>(j, "projection")); |
| @@ -12058,13 +12058,13 @@ namespace quicktype { | ||
| 12058 | 12058 | x.set_title(get_stack_optional<std::variant<TitleParams, std::string>>(j, "title")); |
| 12059 | 12059 | x.set_transform(get_stack_optional<std::vector<Transform>>(j, "transform")); |
| 12060 | 12060 | x.set_width(get_stack_optional<double>(j, "width")); |
| 12061 | - x.set_layer(get_stack_optional<std::vector<LayerSpec>>(j, "layer")); | |
| 12061 | + x.set_layer(j.at("layer").get<std::vector<LayerSpec>>()); | |
| 12062 | 12062 | x.set_resolve(get_stack_optional<Resolve>(j, "resolve")); |
| 12063 | - x.set_facet(get_stack_optional<FacetMapping>(j, "facet")); | |
| 12064 | - x.set_spec(get_heap_optional<Spec>(j, "spec")); | |
| 12065 | - x.set_repeat(get_stack_optional<Repeat>(j, "repeat")); | |
| 12066 | - x.set_vconcat(get_stack_optional<std::vector<Spec>>(j, "vconcat")); | |
| 12067 | - x.set_hconcat(get_stack_optional<std::vector<Spec>>(j, "hconcat")); | |
| 12063 | + x.set_facet(j.at("facet").get<FacetMapping>()); | |
| 12064 | + x.set_spec(j.at("spec").get<std::shared_ptr<Spec>>()); | |
| 12065 | + x.set_repeat(j.at("repeat").get<Repeat>()); | |
| 12066 | + x.set_vconcat(j.at("vconcat").get<std::vector<Spec>>()); | |
| 12067 | + x.set_hconcat(j.at("hconcat").get<std::vector<Spec>>()); | |
| 12068 | 12068 | } |
| 12069 | 12069 | |
| 12070 | 12070 | inline void to_json(json & j, const TopLevel & x) { |
Mschema-csharp-recordsdefault / QuickType.cs+128 −128
| @@ -76,8 +76,8 @@ namespace QuickType | ||
| 76 | 76 | /// <summary> |
| 77 | 77 | /// A key-value mapping between encoding channels and definition of fields. |
| 78 | 78 | /// </summary> |
| 79 | - [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 80 | - public EncodingWithFacet? Encoding { get; set; } | |
| 79 | + [JsonProperty("encoding", Required = Required.Always)] | |
| 80 | + public EncodingWithFacet Encoding { get; set; } | |
| 81 | 81 | |
| 82 | 82 | /// <summary> |
| 83 | 83 | /// The height of a visualization. |
| @@ -107,8 +107,8 @@ namespace QuickType | ||
| 107 | 107 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 108 | 108 | /// object](mark.html#mark-def). |
| 109 | 109 | /// </summary> |
| 110 | - [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 111 | - public AnyMark? Mark { get; set; } | |
| 110 | + [JsonProperty("mark", Required = Required.Always)] | |
| 111 | + public AnyMark Mark { get; set; } | |
| 112 | 112 | |
| 113 | 113 | /// <summary> |
| 114 | 114 | /// Name of the visualization for later reference. |
| @@ -185,8 +185,8 @@ namespace QuickType | ||
| 185 | 185 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 186 | 186 | /// layering facet specifications is not allowed. |
| 187 | 187 | /// </summary> |
| 188 | - [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 189 | - public LayerSpec[]? Layer { get; set; } | |
| 188 | + [JsonProperty("layer", Required = Required.Always)] | |
| 189 | + public LayerSpec[] Layer { get; set; } | |
| 190 | 190 | |
| 191 | 191 | /// <summary> |
| 192 | 192 | /// Scale, axis, and legend resolutions for layers. |
| @@ -206,33 +206,33 @@ namespace QuickType | ||
| 206 | 206 | /// An object that describes mappings between `row` and `column` channels and their field |
| 207 | 207 | /// definitions. |
| 208 | 208 | /// </summary> |
| 209 | - [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 210 | - public FacetMapping? Facet { get; set; } | |
| 209 | + [JsonProperty("facet", Required = Required.Always)] | |
| 210 | + public FacetMapping Facet { get; set; } | |
| 211 | 211 | |
| 212 | 212 | /// <summary> |
| 213 | 213 | /// A specification of the view that gets faceted. |
| 214 | 214 | /// </summary> |
| 215 | - [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 216 | - public Spec? Spec { get; set; } | |
| 215 | + [JsonProperty("spec", Required = Required.Always)] | |
| 216 | + public Spec Spec { get; set; } | |
| 217 | 217 | |
| 218 | 218 | /// <summary> |
| 219 | 219 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 220 | 220 | /// `row` or `column`. |
| 221 | 221 | /// </summary> |
| 222 | - [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 223 | - public Repeat? Repeat { get; set; } | |
| 222 | + [JsonProperty("repeat", Required = Required.Always)] | |
| 223 | + public Repeat Repeat { get; set; } | |
| 224 | 224 | |
| 225 | 225 | /// <summary> |
| 226 | 226 | /// A list of views that should be concatenated and put into a column. |
| 227 | 227 | /// </summary> |
| 228 | - [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 229 | - public Spec[]? Vconcat { get; set; } | |
| 228 | + [JsonProperty("vconcat", Required = Required.Always)] | |
| 229 | + public Spec[] Vconcat { get; set; } | |
| 230 | 230 | |
| 231 | 231 | /// <summary> |
| 232 | 232 | /// A list of views that should be concatenated and put into a row. |
| 233 | 233 | /// </summary> |
| 234 | - [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 235 | - public Spec[]? Hconcat { get; set; } | |
| 234 | + [JsonProperty("hconcat", Required = Required.Always)] | |
| 235 | + public Spec[] Hconcat { get; set; } | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | public partial record AutoSizeParams |
| @@ -2061,8 +2061,8 @@ namespace QuickType | ||
| 2061 | 2061 | [JsonProperty("extent", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 2062 | 2062 | public double[]? Extent { get; set; } |
| 2063 | 2063 | |
| 2064 | - [JsonProperty("scheme", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 2065 | - public string? Scheme { get; set; } | |
| 2064 | + [JsonProperty("scheme", Required = Required.Always)] | |
| 2065 | + public string Scheme { get; set; } | |
| 2066 | 2066 | |
| 2067 | 2067 | [JsonProperty("step", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 2068 | 2068 | public double? Step { get; set; } |
| @@ -2587,8 +2587,8 @@ namespace QuickType | ||
| 2587 | 2587 | [JsonProperty("input", Required = Required.Always)] |
| 2588 | 2588 | public string Input { get; set; } |
| 2589 | 2589 | |
| 2590 | - [JsonProperty("options", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 2591 | - public string[]? Options { get; set; } | |
| 2590 | + [JsonProperty("options", Required = Required.Always)] | |
| 2591 | + public string[] Options { get; set; } | |
| 2592 | 2592 | |
| 2593 | 2593 | [JsonProperty("max", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 2594 | 2594 | public double? Max { get; set; } |
| @@ -3564,8 +3564,8 @@ namespace QuickType | ||
| 3564 | 3564 | /// An URL from which to load the data set. Use the `format.type` property |
| 3565 | 3565 | /// to ensure the loaded data is correctly parsed. |
| 3566 | 3566 | /// </summary> |
| 3567 | - [JsonProperty("url", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3568 | - public string? Url { get; set; } | |
| 3567 | + [JsonProperty("url", Required = Required.Always)] | |
| 3568 | + public string Url { get; set; } | |
| 3569 | 3569 | |
| 3570 | 3570 | /// <summary> |
| 3571 | 3571 | /// The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3573,14 +3573,14 @@ namespace QuickType | ||
| 3573 | 3573 | /// Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3574 | 3574 | /// parsed according to the specified format type. |
| 3575 | 3575 | /// </summary> |
| 3576 | - [JsonProperty("values", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3577 | - public Values? Values { get; set; } | |
| 3576 | + [JsonProperty("values", Required = Required.Always)] | |
| 3577 | + public Values Values { get; set; } | |
| 3578 | 3578 | |
| 3579 | 3579 | /// <summary> |
| 3580 | 3580 | /// Provide a placeholder name and bind data at runtime. |
| 3581 | 3581 | /// </summary> |
| 3582 | - [JsonProperty("name", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3583 | - public string? Name { get; set; } | |
| 3582 | + [JsonProperty("name", Required = Required.Always)] | |
| 3583 | + public string Name { get; set; } | |
| 3584 | 3584 | } |
| 3585 | 3585 | |
| 3586 | 3586 | /// <summary> |
| @@ -3910,8 +3910,8 @@ namespace QuickType | ||
| 3910 | 3910 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3911 | 3911 | /// [geographic projection](projection.html) is applied. |
| 3912 | 3912 | /// </summary> |
| 3913 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3914 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 3913 | + [JsonProperty("type", Required = Required.Always)] | |
| 3914 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 3915 | 3915 | |
| 3916 | 3916 | /// <summary> |
| 3917 | 3917 | /// A constant value in visual domain. |
| @@ -3990,8 +3990,8 @@ namespace QuickType | ||
| 3990 | 3990 | |
| 3991 | 3991 | public partial record ConditionalValueDef |
| 3992 | 3992 | { |
| 3993 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3994 | - public LogicalOperandPredicate? Test { get; set; } | |
| 3993 | + [JsonProperty("test", Required = Required.Always)] | |
| 3994 | + public LogicalOperandPredicate Test { get; set; } | |
| 3995 | 3995 | |
| 3996 | 3996 | /// <summary> |
| 3997 | 3997 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4004,46 +4004,46 @@ namespace QuickType | ||
| 4004 | 4004 | /// A [selection name](selection.html), or a series of [composed |
| 4005 | 4005 | /// selections](selection.html#compose). |
| 4006 | 4006 | /// </summary> |
| 4007 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4008 | - public SelectionOperand? Selection { get; set; } | |
| 4007 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4008 | + public SelectionOperand Selection { get; set; } | |
| 4009 | 4009 | } |
| 4010 | 4010 | |
| 4011 | 4011 | public partial record Selection |
| 4012 | 4012 | { |
| 4013 | - [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4014 | - public SelectionOperand? Not { get; set; } | |
| 4013 | + [JsonProperty("not", Required = Required.Always)] | |
| 4014 | + public SelectionOperand Not { get; set; } | |
| 4015 | 4015 | |
| 4016 | - [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4017 | - public SelectionOperand[]? And { get; set; } | |
| 4016 | + [JsonProperty("and", Required = Required.Always)] | |
| 4017 | + public SelectionOperand[] And { get; set; } | |
| 4018 | 4018 | |
| 4019 | - [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4020 | - public SelectionOperand[]? Or { get; set; } | |
| 4019 | + [JsonProperty("or", Required = Required.Always)] | |
| 4020 | + public SelectionOperand[] Or { get; set; } | |
| 4021 | 4021 | } |
| 4022 | 4022 | |
| 4023 | 4023 | public partial record Predicate |
| 4024 | 4024 | { |
| 4025 | - [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4026 | - public LogicalOperandPredicate? Not { get; set; } | |
| 4025 | + [JsonProperty("not", Required = Required.Always)] | |
| 4026 | + public LogicalOperandPredicate Not { get; set; } | |
| 4027 | 4027 | |
| 4028 | - [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4029 | - public LogicalOperandPredicate[]? And { get; set; } | |
| 4028 | + [JsonProperty("and", Required = Required.Always)] | |
| 4029 | + public LogicalOperandPredicate[] And { get; set; } | |
| 4030 | 4030 | |
| 4031 | - [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4032 | - public LogicalOperandPredicate[]? Or { get; set; } | |
| 4031 | + [JsonProperty("or", Required = Required.Always)] | |
| 4032 | + public LogicalOperandPredicate[] Or { get; set; } | |
| 4033 | 4033 | |
| 4034 | 4034 | /// <summary> |
| 4035 | 4035 | /// The value that the field should be equal to. |
| 4036 | 4036 | /// </summary> |
| 4037 | - [JsonProperty("equal", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4038 | - public Equal? Equal { get; set; } | |
| 4037 | + [JsonProperty("equal", Required = Required.Always)] | |
| 4038 | + public Equal Equal { get; set; } | |
| 4039 | 4039 | |
| 4040 | 4040 | /// <summary> |
| 4041 | 4041 | /// Field to be filtered. |
| 4042 | 4042 | /// |
| 4043 | 4043 | /// Field to be filtered |
| 4044 | 4044 | /// </summary> |
| 4045 | - [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4046 | - public string? Field { get; set; } | |
| 4045 | + [JsonProperty("field", Required = Required.Always)] | |
| 4046 | + public string Field { get; set; } | |
| 4047 | 4047 | |
| 4048 | 4048 | /// <summary> |
| 4049 | 4049 | /// Time unit for the field to be filtered. |
| @@ -4057,21 +4057,21 @@ namespace QuickType | ||
| 4057 | 4057 | /// An array of inclusive minimum and maximum values |
| 4058 | 4058 | /// for a field value of a data item to be included in the filtered data. |
| 4059 | 4059 | /// </summary> |
| 4060 | - [JsonProperty("range", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4061 | - public RangeElement[]? Range { get; set; } | |
| 4060 | + [JsonProperty("range", Required = Required.Always)] | |
| 4061 | + public RangeElement[] Range { get; set; } | |
| 4062 | 4062 | |
| 4063 | 4063 | /// <summary> |
| 4064 | 4064 | /// A set of values that the `field`'s value should be a member of, |
| 4065 | 4065 | /// for a data item included in the filtered data. |
| 4066 | 4066 | /// </summary> |
| 4067 | - [JsonProperty("oneOf", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4068 | - public Equal[]? OneOf { get; set; } | |
| 4067 | + [JsonProperty("oneOf", Required = Required.Always)] | |
| 4068 | + public Equal[] OneOf { get; set; } | |
| 4069 | 4069 | |
| 4070 | 4070 | /// <summary> |
| 4071 | 4071 | /// Filter using a selection name. |
| 4072 | 4072 | /// </summary> |
| 4073 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4074 | - public SelectionOperand? Selection { get; set; } | |
| 4073 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4074 | + public SelectionOperand Selection { get; set; } | |
| 4075 | 4075 | } |
| 4076 | 4076 | |
| 4077 | 4077 | /// <summary> |
| @@ -4158,22 +4158,22 @@ namespace QuickType | ||
| 4158 | 4158 | |
| 4159 | 4159 | public partial record ConditionalPredicateMarkPropFieldDefClass |
| 4160 | 4160 | { |
| 4161 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4162 | - public LogicalOperandPredicate? Test { get; set; } | |
| 4161 | + [JsonProperty("test", Required = Required.Always)] | |
| 4162 | + public LogicalOperandPredicate Test { get; set; } | |
| 4163 | 4163 | |
| 4164 | 4164 | /// <summary> |
| 4165 | 4165 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4166 | 4166 | /// `0` to `1` for opacity). |
| 4167 | 4167 | /// </summary> |
| 4168 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4169 | - public ConditionalValueDefValue? Value { get; set; } | |
| 4168 | + [JsonProperty("value", Required = Required.Always)] | |
| 4169 | + public ConditionalValueDefValue Value { get; set; } | |
| 4170 | 4170 | |
| 4171 | 4171 | /// <summary> |
| 4172 | 4172 | /// A [selection name](selection.html), or a series of [composed |
| 4173 | 4173 | /// selections](selection.html#compose). |
| 4174 | 4174 | /// </summary> |
| 4175 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4176 | - public SelectionOperand? Selection { get; set; } | |
| 4175 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4176 | + public SelectionOperand Selection { get; set; } | |
| 4177 | 4177 | |
| 4178 | 4178 | /// <summary> |
| 4179 | 4179 | /// Aggregation function for the field |
| @@ -4254,8 +4254,8 @@ namespace QuickType | ||
| 4254 | 4254 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4255 | 4255 | /// [geographic projection](projection.html) is applied. |
| 4256 | 4256 | /// </summary> |
| 4257 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4258 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 4257 | + [JsonProperty("type", Required = Required.Always)] | |
| 4258 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 4259 | 4259 | } |
| 4260 | 4260 | |
| 4261 | 4261 | /// <summary> |
| @@ -4960,8 +4960,8 @@ namespace QuickType | ||
| 4960 | 4960 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4961 | 4961 | /// [geographic projection](projection.html) is applied. |
| 4962 | 4962 | /// </summary> |
| 4963 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4964 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 4963 | + [JsonProperty("type", Required = Required.Always)] | |
| 4964 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 4965 | 4965 | |
| 4966 | 4966 | /// <summary> |
| 4967 | 4967 | /// A constant value in visual domain. |
| @@ -4972,22 +4972,22 @@ namespace QuickType | ||
| 4972 | 4972 | |
| 4973 | 4973 | public partial record ConditionalPredicateFieldDefClass |
| 4974 | 4974 | { |
| 4975 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4976 | - public LogicalOperandPredicate? Test { get; set; } | |
| 4975 | + [JsonProperty("test", Required = Required.Always)] | |
| 4976 | + public LogicalOperandPredicate Test { get; set; } | |
| 4977 | 4977 | |
| 4978 | 4978 | /// <summary> |
| 4979 | 4979 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4980 | 4980 | /// `0` to `1` for opacity). |
| 4981 | 4981 | /// </summary> |
| 4982 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4983 | - public ConditionalValueDefValue? Value { get; set; } | |
| 4982 | + [JsonProperty("value", Required = Required.Always)] | |
| 4983 | + public ConditionalValueDefValue Value { get; set; } | |
| 4984 | 4984 | |
| 4985 | 4985 | /// <summary> |
| 4986 | 4986 | /// A [selection name](selection.html), or a series of [composed |
| 4987 | 4987 | /// selections](selection.html#compose). |
| 4988 | 4988 | /// </summary> |
| 4989 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4990 | - public SelectionOperand? Selection { get; set; } | |
| 4989 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4990 | + public SelectionOperand Selection { get; set; } | |
| 4991 | 4991 | |
| 4992 | 4992 | /// <summary> |
| 4993 | 4993 | /// Aggregation function for the field |
| @@ -5038,8 +5038,8 @@ namespace QuickType | ||
| 5038 | 5038 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5039 | 5039 | /// [geographic projection](projection.html) is applied. |
| 5040 | 5040 | /// </summary> |
| 5041 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5042 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5041 | + [JsonProperty("type", Required = Required.Always)] | |
| 5042 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5043 | 5043 | } |
| 5044 | 5044 | |
| 5045 | 5045 | public partial record OrderFieldDef |
| @@ -5191,8 +5191,8 @@ namespace QuickType | ||
| 5191 | 5191 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5192 | 5192 | /// [geographic projection](projection.html) is applied. |
| 5193 | 5193 | /// </summary> |
| 5194 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5195 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5194 | + [JsonProperty("type", Required = Required.Always)] | |
| 5195 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5196 | 5196 | |
| 5197 | 5197 | /// <summary> |
| 5198 | 5198 | /// A constant value in visual domain. |
| @@ -5203,22 +5203,22 @@ namespace QuickType | ||
| 5203 | 5203 | |
| 5204 | 5204 | public partial record ConditionalPredicateTextFieldDefClass |
| 5205 | 5205 | { |
| 5206 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5207 | - public LogicalOperandPredicate? Test { get; set; } | |
| 5206 | + [JsonProperty("test", Required = Required.Always)] | |
| 5207 | + public LogicalOperandPredicate Test { get; set; } | |
| 5208 | 5208 | |
| 5209 | 5209 | /// <summary> |
| 5210 | 5210 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5211 | 5211 | /// `0` to `1` for opacity). |
| 5212 | 5212 | /// </summary> |
| 5213 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5214 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5213 | + [JsonProperty("value", Required = Required.Always)] | |
| 5214 | + public ConditionalValueDefValue Value { get; set; } | |
| 5215 | 5215 | |
| 5216 | 5216 | /// <summary> |
| 5217 | 5217 | /// A [selection name](selection.html), or a series of [composed |
| 5218 | 5218 | /// selections](selection.html#compose). |
| 5219 | 5219 | /// </summary> |
| 5220 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5221 | - public SelectionOperand? Selection { get; set; } | |
| 5220 | + [JsonProperty("selection", Required = Required.Always)] | |
| 5221 | + public SelectionOperand Selection { get; set; } | |
| 5222 | 5222 | |
| 5223 | 5223 | /// <summary> |
| 5224 | 5224 | /// Aggregation function for the field |
| @@ -5276,8 +5276,8 @@ namespace QuickType | ||
| 5276 | 5276 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5277 | 5277 | /// [geographic projection](projection.html) is applied. |
| 5278 | 5278 | /// </summary> |
| 5279 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5280 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5279 | + [JsonProperty("type", Required = Required.Always)] | |
| 5280 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5281 | 5281 | } |
| 5282 | 5282 | |
| 5283 | 5283 | /// <summary> |
| @@ -5393,15 +5393,15 @@ namespace QuickType | ||
| 5393 | 5393 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5394 | 5394 | /// [geographic projection](projection.html) is applied. |
| 5395 | 5395 | /// </summary> |
| 5396 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5397 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5396 | + [JsonProperty("type", Required = Required.Always)] | |
| 5397 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5398 | 5398 | |
| 5399 | 5399 | /// <summary> |
| 5400 | 5400 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5401 | 5401 | /// `0` to `1` for opacity). |
| 5402 | 5402 | /// </summary> |
| 5403 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5404 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5403 | + [JsonProperty("value", Required = Required.Always)] | |
| 5404 | + public ConditionalValueDefValue Value { get; set; } | |
| 5405 | 5405 | } |
| 5406 | 5406 | |
| 5407 | 5407 | public partial record Axis |
| @@ -5678,15 +5678,15 @@ namespace QuickType | ||
| 5678 | 5678 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5679 | 5679 | /// [geographic projection](projection.html) is applied. |
| 5680 | 5680 | /// </summary> |
| 5681 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5682 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5681 | + [JsonProperty("type", Required = Required.Always)] | |
| 5682 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5683 | 5683 | |
| 5684 | 5684 | /// <summary> |
| 5685 | 5685 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5686 | 5686 | /// `0` to `1` for opacity). |
| 5687 | 5687 | /// </summary> |
| 5688 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5689 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5688 | + [JsonProperty("value", Required = Required.Always)] | |
| 5689 | + public ConditionalValueDefValue Value { get; set; } | |
| 5690 | 5690 | } |
| 5691 | 5691 | |
| 5692 | 5692 | /// <summary> |
| @@ -5753,8 +5753,8 @@ namespace QuickType | ||
| 5753 | 5753 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5754 | 5754 | /// layering facet specifications is not allowed. |
| 5755 | 5755 | /// </summary> |
| 5756 | - [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5757 | - public LayerSpec[]? Layer { get; set; } | |
| 5756 | + [JsonProperty("layer", Required = Required.Always)] | |
| 5757 | + public LayerSpec[] Layer { get; set; } | |
| 5758 | 5758 | |
| 5759 | 5759 | /// <summary> |
| 5760 | 5760 | /// Name of the visualization for later reference. |
| @@ -5816,8 +5816,8 @@ namespace QuickType | ||
| 5816 | 5816 | /// <summary> |
| 5817 | 5817 | /// A key-value mapping between encoding channels and definition of fields. |
| 5818 | 5818 | /// </summary> |
| 5819 | - [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5820 | - public Encoding? Encoding { get; set; } | |
| 5819 | + [JsonProperty("encoding", Required = Required.Always)] | |
| 5820 | + public Encoding Encoding { get; set; } | |
| 5821 | 5821 | |
| 5822 | 5822 | /// <summary> |
| 5823 | 5823 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -5825,8 +5825,8 @@ namespace QuickType | ||
| 5825 | 5825 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 5826 | 5826 | /// object](mark.html#mark-def). |
| 5827 | 5827 | /// </summary> |
| 5828 | - [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5829 | - public AnyMark? Mark { get; set; } | |
| 5828 | + [JsonProperty("mark", Required = Required.Always)] | |
| 5829 | + public AnyMark Mark { get; set; } | |
| 5830 | 5830 | |
| 5831 | 5831 | /// <summary> |
| 5832 | 5832 | /// An object defining properties of geographic projection. |
| @@ -5847,33 +5847,33 @@ namespace QuickType | ||
| 5847 | 5847 | /// An object that describes mappings between `row` and `column` channels and their field |
| 5848 | 5848 | /// definitions. |
| 5849 | 5849 | /// </summary> |
| 5850 | - [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5851 | - public FacetMapping? Facet { get; set; } | |
| 5850 | + [JsonProperty("facet", Required = Required.Always)] | |
| 5851 | + public FacetMapping Facet { get; set; } | |
| 5852 | 5852 | |
| 5853 | 5853 | /// <summary> |
| 5854 | 5854 | /// A specification of the view that gets faceted. |
| 5855 | 5855 | /// </summary> |
| 5856 | - [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5857 | - public Spec? SpecSpec { get; set; } | |
| 5856 | + [JsonProperty("spec", Required = Required.Always)] | |
| 5857 | + public Spec SpecSpec { get; set; } | |
| 5858 | 5858 | |
| 5859 | 5859 | /// <summary> |
| 5860 | 5860 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 5861 | 5861 | /// `row` or `column`. |
| 5862 | 5862 | /// </summary> |
| 5863 | - [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5864 | - public Repeat? Repeat { get; set; } | |
| 5863 | + [JsonProperty("repeat", Required = Required.Always)] | |
| 5864 | + public Repeat Repeat { get; set; } | |
| 5865 | 5865 | |
| 5866 | 5866 | /// <summary> |
| 5867 | 5867 | /// A list of views that should be concatenated and put into a column. |
| 5868 | 5868 | /// </summary> |
| 5869 | - [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5870 | - public Spec[]? Vconcat { get; set; } | |
| 5869 | + [JsonProperty("vconcat", Required = Required.Always)] | |
| 5870 | + public Spec[] Vconcat { get; set; } | |
| 5871 | 5871 | |
| 5872 | 5872 | /// <summary> |
| 5873 | 5873 | /// A list of views that should be concatenated and put into a row. |
| 5874 | 5874 | /// </summary> |
| 5875 | - [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5876 | - public Spec[]? Hconcat { get; set; } | |
| 5875 | + [JsonProperty("hconcat", Required = Required.Always)] | |
| 5876 | + public Spec[] Hconcat { get; set; } | |
| 5877 | 5877 | } |
| 5878 | 5878 | |
| 5879 | 5879 | /// <summary> |
| @@ -6031,8 +6031,8 @@ namespace QuickType | ||
| 6031 | 6031 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6032 | 6032 | /// layering facet specifications is not allowed. |
| 6033 | 6033 | /// </summary> |
| 6034 | - [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6035 | - public LayerSpec[]? Layer { get; set; } | |
| 6034 | + [JsonProperty("layer", Required = Required.Always)] | |
| 6035 | + public LayerSpec[] Layer { get; set; } | |
| 6036 | 6036 | |
| 6037 | 6037 | /// <summary> |
| 6038 | 6038 | /// Name of the visualization for later reference. |
| @@ -6086,8 +6086,8 @@ namespace QuickType | ||
| 6086 | 6086 | /// <summary> |
| 6087 | 6087 | /// A key-value mapping between encoding channels and definition of fields. |
| 6088 | 6088 | /// </summary> |
| 6089 | - [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6090 | - public Encoding? Encoding { get; set; } | |
| 6089 | + [JsonProperty("encoding", Required = Required.Always)] | |
| 6090 | + public Encoding Encoding { get; set; } | |
| 6091 | 6091 | |
| 6092 | 6092 | /// <summary> |
| 6093 | 6093 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6095,8 +6095,8 @@ namespace QuickType | ||
| 6095 | 6095 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6096 | 6096 | /// object](mark.html#mark-def). |
| 6097 | 6097 | /// </summary> |
| 6098 | - [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6099 | - public AnyMark? Mark { get; set; } | |
| 6098 | + [JsonProperty("mark", Required = Required.Always)] | |
| 6099 | + public AnyMark Mark { get; set; } | |
| 6100 | 6100 | |
| 6101 | 6101 | /// <summary> |
| 6102 | 6102 | /// An object defining properties of geographic projection. |
| @@ -6737,8 +6737,8 @@ namespace QuickType | ||
| 6737 | 6737 | /// (3) a [selection predicate](filter.html#selection-predicate); |
| 6738 | 6738 | /// or (4) a logical operand that combines (1), (2), or (3). |
| 6739 | 6739 | /// </summary> |
| 6740 | - [JsonProperty("filter", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6741 | - public LogicalOperandPredicate? Filter { get; set; } | |
| 6740 | + [JsonProperty("filter", Required = Required.Always)] | |
| 6741 | + public LogicalOperandPredicate Filter { get; set; } | |
| 6742 | 6742 | |
| 6743 | 6743 | /// <summary> |
| 6744 | 6744 | /// The field for storing the computed formula value. |
| @@ -6759,8 +6759,8 @@ namespace QuickType | ||
| 6759 | 6759 | /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 6760 | 6760 | /// current data object. |
| 6761 | 6761 | /// </summary> |
| 6762 | - [JsonProperty("calculate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6763 | - public string? Calculate { get; set; } | |
| 6762 | + [JsonProperty("calculate", Required = Required.Always)] | |
| 6763 | + public string Calculate { get; set; } | |
| 6764 | 6764 | |
| 6765 | 6765 | /// <summary> |
| 6766 | 6766 | /// The default value to use if lookup fails. |
| @@ -6773,40 +6773,40 @@ namespace QuickType | ||
| 6773 | 6773 | /// <summary> |
| 6774 | 6774 | /// Secondary data reference. |
| 6775 | 6775 | /// </summary> |
| 6776 | - [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6777 | - public LookupData? From { get; set; } | |
| 6776 | + [JsonProperty("from", Required = Required.Always)] | |
| 6777 | + public LookupData From { get; set; } | |
| 6778 | 6778 | |
| 6779 | 6779 | /// <summary> |
| 6780 | 6780 | /// Key in primary data source. |
| 6781 | 6781 | /// </summary> |
| 6782 | - [JsonProperty("lookup", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6783 | - public string? Lookup { get; set; } | |
| 6782 | + [JsonProperty("lookup", Required = Required.Always)] | |
| 6783 | + public string Lookup { get; set; } | |
| 6784 | 6784 | |
| 6785 | 6785 | /// <summary> |
| 6786 | 6786 | /// An object indicating bin properties, or simply `true` for using default bin parameters. |
| 6787 | 6787 | /// </summary> |
| 6788 | - [JsonProperty("bin", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6789 | - public Bin? Bin { get; set; } | |
| 6788 | + [JsonProperty("bin", Required = Required.Always)] | |
| 6789 | + public Bin Bin { get; set; } | |
| 6790 | 6790 | |
| 6791 | 6791 | /// <summary> |
| 6792 | 6792 | /// The data field to bin. |
| 6793 | 6793 | /// |
| 6794 | 6794 | /// The data field to apply time unit. |
| 6795 | 6795 | /// </summary> |
| 6796 | - [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6797 | - public string? Field { get; set; } | |
| 6796 | + [JsonProperty("field", Required = Required.Always)] | |
| 6797 | + public string Field { get; set; } | |
| 6798 | 6798 | |
| 6799 | 6799 | /// <summary> |
| 6800 | 6800 | /// The timeUnit. |
| 6801 | 6801 | /// </summary> |
| 6802 | - [JsonProperty("timeUnit", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6803 | - public TimeUnit? TimeUnit { get; set; } | |
| 6802 | + [JsonProperty("timeUnit", Required = Required.Always)] | |
| 6803 | + public TimeUnit TimeUnit { get; set; } | |
| 6804 | 6804 | |
| 6805 | 6805 | /// <summary> |
| 6806 | 6806 | /// Array of objects that define fields to aggregate. |
| 6807 | 6807 | /// </summary> |
| 6808 | - [JsonProperty("aggregate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6809 | - public AggregatedFieldDef[]? Aggregate { get; set; } | |
| 6808 | + [JsonProperty("aggregate", Required = Required.Always)] | |
| 6809 | + public AggregatedFieldDef[] Aggregate { get; set; } | |
| 6810 | 6810 | |
| 6811 | 6811 | /// <summary> |
| 6812 | 6812 | /// The data fields to group by. If not specified, a single group containing all data objects |
Mschema-csharp-SystemTextJsondefault / QuickType.cs+128 −128
| @@ -79,9 +79,9 @@ namespace QuickType | ||
| 79 | 79 | /// <summary> |
| 80 | 80 | /// A key-value mapping between encoding channels and definition of fields. |
| 81 | 81 | /// </summary> |
| 82 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 82 | + [JsonRequired] | |
| 83 | 83 | [JsonPropertyName("encoding")] |
| 84 | - public EncodingWithFacet? Encoding { get; set; } | |
| 84 | + public EncodingWithFacet Encoding { get; set; } | |
| 85 | 85 | |
| 86 | 86 | /// <summary> |
| 87 | 87 | /// The height of a visualization. |
| @@ -112,9 +112,9 @@ namespace QuickType | ||
| 112 | 112 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 113 | 113 | /// object](mark.html#mark-def). |
| 114 | 114 | /// </summary> |
| 115 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 115 | + [JsonRequired] | |
| 116 | 116 | [JsonPropertyName("mark")] |
| 117 | - public AnyMark? Mark { get; set; } | |
| 117 | + public AnyMark Mark { get; set; } | |
| 118 | 118 | |
| 119 | 119 | /// <summary> |
| 120 | 120 | /// Name of the visualization for later reference. |
| @@ -198,9 +198,9 @@ namespace QuickType | ||
| 198 | 198 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 199 | 199 | /// layering facet specifications is not allowed. |
| 200 | 200 | /// </summary> |
| 201 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 201 | + [JsonRequired] | |
| 202 | 202 | [JsonPropertyName("layer")] |
| 203 | - public LayerSpec[]? Layer { get; set; } | |
| 203 | + public LayerSpec[] Layer { get; set; } | |
| 204 | 204 | |
| 205 | 205 | /// <summary> |
| 206 | 206 | /// Scale, axis, and legend resolutions for layers. |
| @@ -221,38 +221,38 @@ namespace QuickType | ||
| 221 | 221 | /// An object that describes mappings between `row` and `column` channels and their field |
| 222 | 222 | /// definitions. |
| 223 | 223 | /// </summary> |
| 224 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 224 | + [JsonRequired] | |
| 225 | 225 | [JsonPropertyName("facet")] |
| 226 | - public FacetMapping? Facet { get; set; } | |
| 226 | + public FacetMapping Facet { get; set; } | |
| 227 | 227 | |
| 228 | 228 | /// <summary> |
| 229 | 229 | /// A specification of the view that gets faceted. |
| 230 | 230 | /// </summary> |
| 231 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 231 | + [JsonRequired] | |
| 232 | 232 | [JsonPropertyName("spec")] |
| 233 | - public Spec? Spec { get; set; } | |
| 233 | + public Spec Spec { get; set; } | |
| 234 | 234 | |
| 235 | 235 | /// <summary> |
| 236 | 236 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 237 | 237 | /// `row` or `column`. |
| 238 | 238 | /// </summary> |
| 239 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 239 | + [JsonRequired] | |
| 240 | 240 | [JsonPropertyName("repeat")] |
| 241 | - public Repeat? Repeat { get; set; } | |
| 241 | + public Repeat Repeat { get; set; } | |
| 242 | 242 | |
| 243 | 243 | /// <summary> |
| 244 | 244 | /// A list of views that should be concatenated and put into a column. |
| 245 | 245 | /// </summary> |
| 246 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 246 | + [JsonRequired] | |
| 247 | 247 | [JsonPropertyName("vconcat")] |
| 248 | - public Spec[]? Vconcat { get; set; } | |
| 248 | + public Spec[] Vconcat { get; set; } | |
| 249 | 249 | |
| 250 | 250 | /// <summary> |
| 251 | 251 | /// A list of views that should be concatenated and put into a row. |
| 252 | 252 | /// </summary> |
| 253 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 253 | + [JsonRequired] | |
| 254 | 254 | [JsonPropertyName("hconcat")] |
| 255 | - public Spec[]? Hconcat { get; set; } | |
| 255 | + public Spec[] Hconcat { get; set; } | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | public partial class AutoSizeParams |
| @@ -2318,9 +2318,9 @@ namespace QuickType | ||
| 2318 | 2318 | [JsonPropertyName("extent")] |
| 2319 | 2319 | public double[]? Extent { get; set; } |
| 2320 | 2320 | |
| 2321 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 2321 | + [JsonRequired] | |
| 2322 | 2322 | [JsonPropertyName("scheme")] |
| 2323 | - public string? Scheme { get; set; } | |
| 2323 | + public string Scheme { get; set; } | |
| 2324 | 2324 | |
| 2325 | 2325 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| 2326 | 2326 | [JsonPropertyName("step")] |
| @@ -2896,9 +2896,9 @@ namespace QuickType | ||
| 2896 | 2896 | [JsonPropertyName("input")] |
| 2897 | 2897 | public string Input { get; set; } |
| 2898 | 2898 | |
| 2899 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 2899 | + [JsonRequired] | |
| 2900 | 2900 | [JsonPropertyName("options")] |
| 2901 | - public string[]? Options { get; set; } | |
| 2901 | + public string[] Options { get; set; } | |
| 2902 | 2902 | |
| 2903 | 2903 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| 2904 | 2904 | [JsonPropertyName("max")] |
| @@ -3989,9 +3989,9 @@ namespace QuickType | ||
| 3989 | 3989 | /// An URL from which to load the data set. Use the `format.type` property |
| 3990 | 3990 | /// to ensure the loaded data is correctly parsed. |
| 3991 | 3991 | /// </summary> |
| 3992 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 3992 | + [JsonRequired] | |
| 3993 | 3993 | [JsonPropertyName("url")] |
| 3994 | - public string? Url { get; set; } | |
| 3994 | + public string Url { get; set; } | |
| 3995 | 3995 | |
| 3996 | 3996 | /// <summary> |
| 3997 | 3997 | /// The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3999,16 +3999,16 @@ namespace QuickType | ||
| 3999 | 3999 | /// Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 4000 | 4000 | /// parsed according to the specified format type. |
| 4001 | 4001 | /// </summary> |
| 4002 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4002 | + [JsonRequired] | |
| 4003 | 4003 | [JsonPropertyName("values")] |
| 4004 | - public Values? Values { get; set; } | |
| 4004 | + public Values Values { get; set; } | |
| 4005 | 4005 | |
| 4006 | 4006 | /// <summary> |
| 4007 | 4007 | /// Provide a placeholder name and bind data at runtime. |
| 4008 | 4008 | /// </summary> |
| 4009 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4009 | + [JsonRequired] | |
| 4010 | 4010 | [JsonPropertyName("name")] |
| 4011 | - public string? Name { get; set; } | |
| 4011 | + public string Name { get; set; } | |
| 4012 | 4012 | } |
| 4013 | 4013 | |
| 4014 | 4014 | /// <summary> |
| @@ -4364,9 +4364,9 @@ namespace QuickType | ||
| 4364 | 4364 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4365 | 4365 | /// [geographic projection](projection.html) is applied. |
| 4366 | 4366 | /// </summary> |
| 4367 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4367 | + [JsonRequired] | |
| 4368 | 4368 | [JsonPropertyName("type")] |
| 4369 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 4369 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 4370 | 4370 | |
| 4371 | 4371 | /// <summary> |
| 4372 | 4372 | /// A constant value in visual domain. |
| @@ -4454,9 +4454,9 @@ namespace QuickType | ||
| 4454 | 4454 | |
| 4455 | 4455 | public partial class ConditionalValueDef |
| 4456 | 4456 | { |
| 4457 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4457 | + [JsonRequired] | |
| 4458 | 4458 | [JsonPropertyName("test")] |
| 4459 | - public LogicalOperandPredicate? Test { get; set; } | |
| 4459 | + public LogicalOperandPredicate Test { get; set; } | |
| 4460 | 4460 | |
| 4461 | 4461 | /// <summary> |
| 4462 | 4462 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4470,55 +4470,55 @@ namespace QuickType | ||
| 4470 | 4470 | /// A [selection name](selection.html), or a series of [composed |
| 4471 | 4471 | /// selections](selection.html#compose). |
| 4472 | 4472 | /// </summary> |
| 4473 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4473 | + [JsonRequired] | |
| 4474 | 4474 | [JsonPropertyName("selection")] |
| 4475 | - public SelectionOperand? Selection { get; set; } | |
| 4475 | + public SelectionOperand Selection { get; set; } | |
| 4476 | 4476 | } |
| 4477 | 4477 | |
| 4478 | 4478 | public partial class Selection |
| 4479 | 4479 | { |
| 4480 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4480 | + [JsonRequired] | |
| 4481 | 4481 | [JsonPropertyName("not")] |
| 4482 | - public SelectionOperand? Not { get; set; } | |
| 4482 | + public SelectionOperand Not { get; set; } | |
| 4483 | 4483 | |
| 4484 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4484 | + [JsonRequired] | |
| 4485 | 4485 | [JsonPropertyName("and")] |
| 4486 | - public SelectionOperand[]? And { get; set; } | |
| 4486 | + public SelectionOperand[] And { get; set; } | |
| 4487 | 4487 | |
| 4488 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4488 | + [JsonRequired] | |
| 4489 | 4489 | [JsonPropertyName("or")] |
| 4490 | - public SelectionOperand[]? Or { get; set; } | |
| 4490 | + public SelectionOperand[] Or { get; set; } | |
| 4491 | 4491 | } |
| 4492 | 4492 | |
| 4493 | 4493 | public partial class Predicate |
| 4494 | 4494 | { |
| 4495 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4495 | + [JsonRequired] | |
| 4496 | 4496 | [JsonPropertyName("not")] |
| 4497 | - public LogicalOperandPredicate? Not { get; set; } | |
| 4497 | + public LogicalOperandPredicate Not { get; set; } | |
| 4498 | 4498 | |
| 4499 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4499 | + [JsonRequired] | |
| 4500 | 4500 | [JsonPropertyName("and")] |
| 4501 | - public LogicalOperandPredicate[]? And { get; set; } | |
| 4501 | + public LogicalOperandPredicate[] And { get; set; } | |
| 4502 | 4502 | |
| 4503 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4503 | + [JsonRequired] | |
| 4504 | 4504 | [JsonPropertyName("or")] |
| 4505 | - public LogicalOperandPredicate[]? Or { get; set; } | |
| 4505 | + public LogicalOperandPredicate[] Or { get; set; } | |
| 4506 | 4506 | |
| 4507 | 4507 | /// <summary> |
| 4508 | 4508 | /// The value that the field should be equal to. |
| 4509 | 4509 | /// </summary> |
| 4510 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4510 | + [JsonRequired] | |
| 4511 | 4511 | [JsonPropertyName("equal")] |
| 4512 | - public Equal? Equal { get; set; } | |
| 4512 | + public Equal Equal { get; set; } | |
| 4513 | 4513 | |
| 4514 | 4514 | /// <summary> |
| 4515 | 4515 | /// Field to be filtered. |
| 4516 | 4516 | /// |
| 4517 | 4517 | /// Field to be filtered |
| 4518 | 4518 | /// </summary> |
| 4519 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4519 | + [JsonRequired] | |
| 4520 | 4520 | [JsonPropertyName("field")] |
| 4521 | - public string? Field { get; set; } | |
| 4521 | + public string Field { get; set; } | |
| 4522 | 4522 | |
| 4523 | 4523 | /// <summary> |
| 4524 | 4524 | /// Time unit for the field to be filtered. |
| @@ -4533,24 +4533,24 @@ namespace QuickType | ||
| 4533 | 4533 | /// An array of inclusive minimum and maximum values |
| 4534 | 4534 | /// for a field value of a data item to be included in the filtered data. |
| 4535 | 4535 | /// </summary> |
| 4536 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4536 | + [JsonRequired] | |
| 4537 | 4537 | [JsonPropertyName("range")] |
| 4538 | - public RangeElement[]? Range { get; set; } | |
| 4538 | + public RangeElement[] Range { get; set; } | |
| 4539 | 4539 | |
| 4540 | 4540 | /// <summary> |
| 4541 | 4541 | /// A set of values that the `field`'s value should be a member of, |
| 4542 | 4542 | /// for a data item included in the filtered data. |
| 4543 | 4543 | /// </summary> |
| 4544 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4544 | + [JsonRequired] | |
| 4545 | 4545 | [JsonPropertyName("oneOf")] |
| 4546 | - public Equal[]? OneOf { get; set; } | |
| 4546 | + public Equal[] OneOf { get; set; } | |
| 4547 | 4547 | |
| 4548 | 4548 | /// <summary> |
| 4549 | 4549 | /// Filter using a selection name. |
| 4550 | 4550 | /// </summary> |
| 4551 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4551 | + [JsonRequired] | |
| 4552 | 4552 | [JsonPropertyName("selection")] |
| 4553 | - public SelectionOperand? Selection { get; set; } | |
| 4553 | + public SelectionOperand Selection { get; set; } | |
| 4554 | 4554 | } |
| 4555 | 4555 | |
| 4556 | 4556 | /// <summary> |
| @@ -4647,25 +4647,25 @@ namespace QuickType | ||
| 4647 | 4647 | |
| 4648 | 4648 | public partial class ConditionalPredicateMarkPropFieldDefClass |
| 4649 | 4649 | { |
| 4650 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4650 | + [JsonRequired] | |
| 4651 | 4651 | [JsonPropertyName("test")] |
| 4652 | - public LogicalOperandPredicate? Test { get; set; } | |
| 4652 | + public LogicalOperandPredicate Test { get; set; } | |
| 4653 | 4653 | |
| 4654 | 4654 | /// <summary> |
| 4655 | 4655 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4656 | 4656 | /// `0` to `1` for opacity). |
| 4657 | 4657 | /// </summary> |
| 4658 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4658 | + [JsonRequired] | |
| 4659 | 4659 | [JsonPropertyName("value")] |
| 4660 | - public ConditionalValueDefValue? Value { get; set; } | |
| 4660 | + public ConditionalValueDefValue Value { get; set; } | |
| 4661 | 4661 | |
| 4662 | 4662 | /// <summary> |
| 4663 | 4663 | /// A [selection name](selection.html), or a series of [composed |
| 4664 | 4664 | /// selections](selection.html#compose). |
| 4665 | 4665 | /// </summary> |
| 4666 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4666 | + [JsonRequired] | |
| 4667 | 4667 | [JsonPropertyName("selection")] |
| 4668 | - public SelectionOperand? Selection { get; set; } | |
| 4668 | + public SelectionOperand Selection { get; set; } | |
| 4669 | 4669 | |
| 4670 | 4670 | /// <summary> |
| 4671 | 4671 | /// Aggregation function for the field |
| @@ -4751,9 +4751,9 @@ namespace QuickType | ||
| 4751 | 4751 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4752 | 4752 | /// [geographic projection](projection.html) is applied. |
| 4753 | 4753 | /// </summary> |
| 4754 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 4754 | + [JsonRequired] | |
| 4755 | 4755 | [JsonPropertyName("type")] |
| 4756 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 4756 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 4757 | 4757 | } |
| 4758 | 4758 | |
| 4759 | 4759 | /// <summary> |
| @@ -5511,9 +5511,9 @@ namespace QuickType | ||
| 5511 | 5511 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5512 | 5512 | /// [geographic projection](projection.html) is applied. |
| 5513 | 5513 | /// </summary> |
| 5514 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5514 | + [JsonRequired] | |
| 5515 | 5515 | [JsonPropertyName("type")] |
| 5516 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5516 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5517 | 5517 | |
| 5518 | 5518 | /// <summary> |
| 5519 | 5519 | /// A constant value in visual domain. |
| @@ -5525,25 +5525,25 @@ namespace QuickType | ||
| 5525 | 5525 | |
| 5526 | 5526 | public partial class ConditionalPredicateFieldDefClass |
| 5527 | 5527 | { |
| 5528 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5528 | + [JsonRequired] | |
| 5529 | 5529 | [JsonPropertyName("test")] |
| 5530 | - public LogicalOperandPredicate? Test { get; set; } | |
| 5530 | + public LogicalOperandPredicate Test { get; set; } | |
| 5531 | 5531 | |
| 5532 | 5532 | /// <summary> |
| 5533 | 5533 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5534 | 5534 | /// `0` to `1` for opacity). |
| 5535 | 5535 | /// </summary> |
| 5536 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5536 | + [JsonRequired] | |
| 5537 | 5537 | [JsonPropertyName("value")] |
| 5538 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5538 | + public ConditionalValueDefValue Value { get; set; } | |
| 5539 | 5539 | |
| 5540 | 5540 | /// <summary> |
| 5541 | 5541 | /// A [selection name](selection.html), or a series of [composed |
| 5542 | 5542 | /// selections](selection.html#compose). |
| 5543 | 5543 | /// </summary> |
| 5544 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5544 | + [JsonRequired] | |
| 5545 | 5545 | [JsonPropertyName("selection")] |
| 5546 | - public SelectionOperand? Selection { get; set; } | |
| 5546 | + public SelectionOperand Selection { get; set; } | |
| 5547 | 5547 | |
| 5548 | 5548 | /// <summary> |
| 5549 | 5549 | /// Aggregation function for the field |
| @@ -5598,9 +5598,9 @@ namespace QuickType | ||
| 5598 | 5598 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5599 | 5599 | /// [geographic projection](projection.html) is applied. |
| 5600 | 5600 | /// </summary> |
| 5601 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5601 | + [JsonRequired] | |
| 5602 | 5602 | [JsonPropertyName("type")] |
| 5603 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5603 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5604 | 5604 | } |
| 5605 | 5605 | |
| 5606 | 5606 | public partial class OrderFieldDef |
| @@ -5763,9 +5763,9 @@ namespace QuickType | ||
| 5763 | 5763 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5764 | 5764 | /// [geographic projection](projection.html) is applied. |
| 5765 | 5765 | /// </summary> |
| 5766 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5766 | + [JsonRequired] | |
| 5767 | 5767 | [JsonPropertyName("type")] |
| 5768 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5768 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5769 | 5769 | |
| 5770 | 5770 | /// <summary> |
| 5771 | 5771 | /// A constant value in visual domain. |
| @@ -5777,25 +5777,25 @@ namespace QuickType | ||
| 5777 | 5777 | |
| 5778 | 5778 | public partial class ConditionalPredicateTextFieldDefClass |
| 5779 | 5779 | { |
| 5780 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5780 | + [JsonRequired] | |
| 5781 | 5781 | [JsonPropertyName("test")] |
| 5782 | - public LogicalOperandPredicate? Test { get; set; } | |
| 5782 | + public LogicalOperandPredicate Test { get; set; } | |
| 5783 | 5783 | |
| 5784 | 5784 | /// <summary> |
| 5785 | 5785 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5786 | 5786 | /// `0` to `1` for opacity). |
| 5787 | 5787 | /// </summary> |
| 5788 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5788 | + [JsonRequired] | |
| 5789 | 5789 | [JsonPropertyName("value")] |
| 5790 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5790 | + public ConditionalValueDefValue Value { get; set; } | |
| 5791 | 5791 | |
| 5792 | 5792 | /// <summary> |
| 5793 | 5793 | /// A [selection name](selection.html), or a series of [composed |
| 5794 | 5794 | /// selections](selection.html#compose). |
| 5795 | 5795 | /// </summary> |
| 5796 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5796 | + [JsonRequired] | |
| 5797 | 5797 | [JsonPropertyName("selection")] |
| 5798 | - public SelectionOperand? Selection { get; set; } | |
| 5798 | + public SelectionOperand Selection { get; set; } | |
| 5799 | 5799 | |
| 5800 | 5800 | /// <summary> |
| 5801 | 5801 | /// Aggregation function for the field |
| @@ -5858,9 +5858,9 @@ namespace QuickType | ||
| 5858 | 5858 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5859 | 5859 | /// [geographic projection](projection.html) is applied. |
| 5860 | 5860 | /// </summary> |
| 5861 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5861 | + [JsonRequired] | |
| 5862 | 5862 | [JsonPropertyName("type")] |
| 5863 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5863 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5864 | 5864 | } |
| 5865 | 5865 | |
| 5866 | 5866 | /// <summary> |
| @@ -5981,17 +5981,17 @@ namespace QuickType | ||
| 5981 | 5981 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5982 | 5982 | /// [geographic projection](projection.html) is applied. |
| 5983 | 5983 | /// </summary> |
| 5984 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5984 | + [JsonRequired] | |
| 5985 | 5985 | [JsonPropertyName("type")] |
| 5986 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5986 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5987 | 5987 | |
| 5988 | 5988 | /// <summary> |
| 5989 | 5989 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5990 | 5990 | /// `0` to `1` for opacity). |
| 5991 | 5991 | /// </summary> |
| 5992 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 5992 | + [JsonRequired] | |
| 5993 | 5993 | [JsonPropertyName("value")] |
| 5994 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5994 | + public ConditionalValueDefValue Value { get; set; } | |
| 5995 | 5995 | } |
| 5996 | 5996 | |
| 5997 | 5997 | public partial class Axis |
| @@ -6293,17 +6293,17 @@ namespace QuickType | ||
| 6293 | 6293 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6294 | 6294 | /// [geographic projection](projection.html) is applied. |
| 6295 | 6295 | /// </summary> |
| 6296 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6296 | + [JsonRequired] | |
| 6297 | 6297 | [JsonPropertyName("type")] |
| 6298 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 6298 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 6299 | 6299 | |
| 6300 | 6300 | /// <summary> |
| 6301 | 6301 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6302 | 6302 | /// `0` to `1` for opacity). |
| 6303 | 6303 | /// </summary> |
| 6304 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6304 | + [JsonRequired] | |
| 6305 | 6305 | [JsonPropertyName("value")] |
| 6306 | - public ConditionalValueDefValue? Value { get; set; } | |
| 6306 | + public ConditionalValueDefValue Value { get; set; } | |
| 6307 | 6307 | } |
| 6308 | 6308 | |
| 6309 | 6309 | /// <summary> |
| @@ -6375,9 +6375,9 @@ namespace QuickType | ||
| 6375 | 6375 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6376 | 6376 | /// layering facet specifications is not allowed. |
| 6377 | 6377 | /// </summary> |
| 6378 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6378 | + [JsonRequired] | |
| 6379 | 6379 | [JsonPropertyName("layer")] |
| 6380 | - public LayerSpec[]? Layer { get; set; } | |
| 6380 | + public LayerSpec[] Layer { get; set; } | |
| 6381 | 6381 | |
| 6382 | 6382 | /// <summary> |
| 6383 | 6383 | /// Name of the visualization for later reference. |
| @@ -6444,9 +6444,9 @@ namespace QuickType | ||
| 6444 | 6444 | /// <summary> |
| 6445 | 6445 | /// A key-value mapping between encoding channels and definition of fields. |
| 6446 | 6446 | /// </summary> |
| 6447 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6447 | + [JsonRequired] | |
| 6448 | 6448 | [JsonPropertyName("encoding")] |
| 6449 | - public Encoding? Encoding { get; set; } | |
| 6449 | + public Encoding Encoding { get; set; } | |
| 6450 | 6450 | |
| 6451 | 6451 | /// <summary> |
| 6452 | 6452 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6454,9 +6454,9 @@ namespace QuickType | ||
| 6454 | 6454 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6455 | 6455 | /// object](mark.html#mark-def). |
| 6456 | 6456 | /// </summary> |
| 6457 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6457 | + [JsonRequired] | |
| 6458 | 6458 | [JsonPropertyName("mark")] |
| 6459 | - public AnyMark? Mark { get; set; } | |
| 6459 | + public AnyMark Mark { get; set; } | |
| 6460 | 6460 | |
| 6461 | 6461 | /// <summary> |
| 6462 | 6462 | /// An object defining properties of geographic projection. |
| @@ -6479,38 +6479,38 @@ namespace QuickType | ||
| 6479 | 6479 | /// An object that describes mappings between `row` and `column` channels and their field |
| 6480 | 6480 | /// definitions. |
| 6481 | 6481 | /// </summary> |
| 6482 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6482 | + [JsonRequired] | |
| 6483 | 6483 | [JsonPropertyName("facet")] |
| 6484 | - public FacetMapping? Facet { get; set; } | |
| 6484 | + public FacetMapping Facet { get; set; } | |
| 6485 | 6485 | |
| 6486 | 6486 | /// <summary> |
| 6487 | 6487 | /// A specification of the view that gets faceted. |
| 6488 | 6488 | /// </summary> |
| 6489 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6489 | + [JsonRequired] | |
| 6490 | 6490 | [JsonPropertyName("spec")] |
| 6491 | - public Spec? SpecSpec { get; set; } | |
| 6491 | + public Spec SpecSpec { get; set; } | |
| 6492 | 6492 | |
| 6493 | 6493 | /// <summary> |
| 6494 | 6494 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 6495 | 6495 | /// `row` or `column`. |
| 6496 | 6496 | /// </summary> |
| 6497 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6497 | + [JsonRequired] | |
| 6498 | 6498 | [JsonPropertyName("repeat")] |
| 6499 | - public Repeat? Repeat { get; set; } | |
| 6499 | + public Repeat Repeat { get; set; } | |
| 6500 | 6500 | |
| 6501 | 6501 | /// <summary> |
| 6502 | 6502 | /// A list of views that should be concatenated and put into a column. |
| 6503 | 6503 | /// </summary> |
| 6504 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6504 | + [JsonRequired] | |
| 6505 | 6505 | [JsonPropertyName("vconcat")] |
| 6506 | - public Spec[]? Vconcat { get; set; } | |
| 6506 | + public Spec[] Vconcat { get; set; } | |
| 6507 | 6507 | |
| 6508 | 6508 | /// <summary> |
| 6509 | 6509 | /// A list of views that should be concatenated and put into a row. |
| 6510 | 6510 | /// </summary> |
| 6511 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6511 | + [JsonRequired] | |
| 6512 | 6512 | [JsonPropertyName("hconcat")] |
| 6513 | - public Spec[]? Hconcat { get; set; } | |
| 6513 | + public Spec[] Hconcat { get; set; } | |
| 6514 | 6514 | } |
| 6515 | 6515 | |
| 6516 | 6516 | /// <summary> |
| @@ -6684,9 +6684,9 @@ namespace QuickType | ||
| 6684 | 6684 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6685 | 6685 | /// layering facet specifications is not allowed. |
| 6686 | 6686 | /// </summary> |
| 6687 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6687 | + [JsonRequired] | |
| 6688 | 6688 | [JsonPropertyName("layer")] |
| 6689 | - public LayerSpec[]? Layer { get; set; } | |
| 6689 | + public LayerSpec[] Layer { get; set; } | |
| 6690 | 6690 | |
| 6691 | 6691 | /// <summary> |
| 6692 | 6692 | /// Name of the visualization for later reference. |
| @@ -6745,9 +6745,9 @@ namespace QuickType | ||
| 6745 | 6745 | /// <summary> |
| 6746 | 6746 | /// A key-value mapping between encoding channels and definition of fields. |
| 6747 | 6747 | /// </summary> |
| 6748 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6748 | + [JsonRequired] | |
| 6749 | 6749 | [JsonPropertyName("encoding")] |
| 6750 | - public Encoding? Encoding { get; set; } | |
| 6750 | + public Encoding Encoding { get; set; } | |
| 6751 | 6751 | |
| 6752 | 6752 | /// <summary> |
| 6753 | 6753 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6755,9 +6755,9 @@ namespace QuickType | ||
| 6755 | 6755 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6756 | 6756 | /// object](mark.html#mark-def). |
| 6757 | 6757 | /// </summary> |
| 6758 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 6758 | + [JsonRequired] | |
| 6759 | 6759 | [JsonPropertyName("mark")] |
| 6760 | - public AnyMark? Mark { get; set; } | |
| 6760 | + public AnyMark Mark { get; set; } | |
| 6761 | 6761 | |
| 6762 | 6762 | /// <summary> |
| 6763 | 6763 | /// An object defining properties of geographic projection. |
| @@ -7479,9 +7479,9 @@ namespace QuickType | ||
| 7479 | 7479 | /// (3) a [selection predicate](filter.html#selection-predicate); |
| 7480 | 7480 | /// or (4) a logical operand that combines (1), (2), or (3). |
| 7481 | 7481 | /// </summary> |
| 7482 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7482 | + [JsonRequired] | |
| 7483 | 7483 | [JsonPropertyName("filter")] |
| 7484 | - public LogicalOperandPredicate? Filter { get; set; } | |
| 7484 | + public LogicalOperandPredicate Filter { get; set; } | |
| 7485 | 7485 | |
| 7486 | 7486 | /// <summary> |
| 7487 | 7487 | /// The field for storing the computed formula value. |
| @@ -7503,9 +7503,9 @@ namespace QuickType | ||
| 7503 | 7503 | /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 7504 | 7504 | /// current data object. |
| 7505 | 7505 | /// </summary> |
| 7506 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7506 | + [JsonRequired] | |
| 7507 | 7507 | [JsonPropertyName("calculate")] |
| 7508 | - public string? Calculate { get; set; } | |
| 7508 | + public string Calculate { get; set; } | |
| 7509 | 7509 | |
| 7510 | 7510 | /// <summary> |
| 7511 | 7511 | /// The default value to use if lookup fails. |
| @@ -7519,46 +7519,46 @@ namespace QuickType | ||
| 7519 | 7519 | /// <summary> |
| 7520 | 7520 | /// Secondary data reference. |
| 7521 | 7521 | /// </summary> |
| 7522 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7522 | + [JsonRequired] | |
| 7523 | 7523 | [JsonPropertyName("from")] |
| 7524 | - public LookupData? From { get; set; } | |
| 7524 | + public LookupData From { get; set; } | |
| 7525 | 7525 | |
| 7526 | 7526 | /// <summary> |
| 7527 | 7527 | /// Key in primary data source. |
| 7528 | 7528 | /// </summary> |
| 7529 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7529 | + [JsonRequired] | |
| 7530 | 7530 | [JsonPropertyName("lookup")] |
| 7531 | - public string? Lookup { get; set; } | |
| 7531 | + public string Lookup { get; set; } | |
| 7532 | 7532 | |
| 7533 | 7533 | /// <summary> |
| 7534 | 7534 | /// An object indicating bin properties, or simply `true` for using default bin parameters. |
| 7535 | 7535 | /// </summary> |
| 7536 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7536 | + [JsonRequired] | |
| 7537 | 7537 | [JsonPropertyName("bin")] |
| 7538 | - public Bin? Bin { get; set; } | |
| 7538 | + public Bin Bin { get; set; } | |
| 7539 | 7539 | |
| 7540 | 7540 | /// <summary> |
| 7541 | 7541 | /// The data field to bin. |
| 7542 | 7542 | /// |
| 7543 | 7543 | /// The data field to apply time unit. |
| 7544 | 7544 | /// </summary> |
| 7545 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7545 | + [JsonRequired] | |
| 7546 | 7546 | [JsonPropertyName("field")] |
| 7547 | - public string? Field { get; set; } | |
| 7547 | + public string Field { get; set; } | |
| 7548 | 7548 | |
| 7549 | 7549 | /// <summary> |
| 7550 | 7550 | /// The timeUnit. |
| 7551 | 7551 | /// </summary> |
| 7552 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7552 | + [JsonRequired] | |
| 7553 | 7553 | [JsonPropertyName("timeUnit")] |
| 7554 | - public TimeUnit? TimeUnit { get; set; } | |
| 7554 | + public TimeUnit TimeUnit { get; set; } | |
| 7555 | 7555 | |
| 7556 | 7556 | /// <summary> |
| 7557 | 7557 | /// Array of objects that define fields to aggregate. |
| 7558 | 7558 | /// </summary> |
| 7559 | - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 7559 | + [JsonRequired] | |
| 7560 | 7560 | [JsonPropertyName("aggregate")] |
| 7561 | - public AggregatedFieldDef[]? Aggregate { get; set; } | |
| 7561 | + public AggregatedFieldDef[] Aggregate { get; set; } | |
| 7562 | 7562 | |
| 7563 | 7563 | /// <summary> |
| 7564 | 7564 | /// The data fields to group by. If not specified, a single group containing all data objects |
Mschema-csharpdefault / QuickType.cs+128 −128
| @@ -76,8 +76,8 @@ namespace QuickType | ||
| 76 | 76 | /// <summary> |
| 77 | 77 | /// A key-value mapping between encoding channels and definition of fields. |
| 78 | 78 | /// </summary> |
| 79 | - [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 80 | - public EncodingWithFacet? Encoding { get; set; } | |
| 79 | + [JsonProperty("encoding", Required = Required.Always)] | |
| 80 | + public EncodingWithFacet Encoding { get; set; } | |
| 81 | 81 | |
| 82 | 82 | /// <summary> |
| 83 | 83 | /// The height of a visualization. |
| @@ -107,8 +107,8 @@ namespace QuickType | ||
| 107 | 107 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 108 | 108 | /// object](mark.html#mark-def). |
| 109 | 109 | /// </summary> |
| 110 | - [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 111 | - public AnyMark? Mark { get; set; } | |
| 110 | + [JsonProperty("mark", Required = Required.Always)] | |
| 111 | + public AnyMark Mark { get; set; } | |
| 112 | 112 | |
| 113 | 113 | /// <summary> |
| 114 | 114 | /// Name of the visualization for later reference. |
| @@ -185,8 +185,8 @@ namespace QuickType | ||
| 185 | 185 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 186 | 186 | /// layering facet specifications is not allowed. |
| 187 | 187 | /// </summary> |
| 188 | - [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 189 | - public LayerSpec[]? Layer { get; set; } | |
| 188 | + [JsonProperty("layer", Required = Required.Always)] | |
| 189 | + public LayerSpec[] Layer { get; set; } | |
| 190 | 190 | |
| 191 | 191 | /// <summary> |
| 192 | 192 | /// Scale, axis, and legend resolutions for layers. |
| @@ -206,33 +206,33 @@ namespace QuickType | ||
| 206 | 206 | /// An object that describes mappings between `row` and `column` channels and their field |
| 207 | 207 | /// definitions. |
| 208 | 208 | /// </summary> |
| 209 | - [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 210 | - public FacetMapping? Facet { get; set; } | |
| 209 | + [JsonProperty("facet", Required = Required.Always)] | |
| 210 | + public FacetMapping Facet { get; set; } | |
| 211 | 211 | |
| 212 | 212 | /// <summary> |
| 213 | 213 | /// A specification of the view that gets faceted. |
| 214 | 214 | /// </summary> |
| 215 | - [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 216 | - public Spec? Spec { get; set; } | |
| 215 | + [JsonProperty("spec", Required = Required.Always)] | |
| 216 | + public Spec Spec { get; set; } | |
| 217 | 217 | |
| 218 | 218 | /// <summary> |
| 219 | 219 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 220 | 220 | /// `row` or `column`. |
| 221 | 221 | /// </summary> |
| 222 | - [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 223 | - public Repeat? Repeat { get; set; } | |
| 222 | + [JsonProperty("repeat", Required = Required.Always)] | |
| 223 | + public Repeat Repeat { get; set; } | |
| 224 | 224 | |
| 225 | 225 | /// <summary> |
| 226 | 226 | /// A list of views that should be concatenated and put into a column. |
| 227 | 227 | /// </summary> |
| 228 | - [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 229 | - public Spec[]? Vconcat { get; set; } | |
| 228 | + [JsonProperty("vconcat", Required = Required.Always)] | |
| 229 | + public Spec[] Vconcat { get; set; } | |
| 230 | 230 | |
| 231 | 231 | /// <summary> |
| 232 | 232 | /// A list of views that should be concatenated and put into a row. |
| 233 | 233 | /// </summary> |
| 234 | - [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 235 | - public Spec[]? Hconcat { get; set; } | |
| 234 | + [JsonProperty("hconcat", Required = Required.Always)] | |
| 235 | + public Spec[] Hconcat { get; set; } | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | public partial class AutoSizeParams |
| @@ -2061,8 +2061,8 @@ namespace QuickType | ||
| 2061 | 2061 | [JsonProperty("extent", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 2062 | 2062 | public double[]? Extent { get; set; } |
| 2063 | 2063 | |
| 2064 | - [JsonProperty("scheme", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 2065 | - public string? Scheme { get; set; } | |
| 2064 | + [JsonProperty("scheme", Required = Required.Always)] | |
| 2065 | + public string Scheme { get; set; } | |
| 2066 | 2066 | |
| 2067 | 2067 | [JsonProperty("step", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 2068 | 2068 | public double? Step { get; set; } |
| @@ -2587,8 +2587,8 @@ namespace QuickType | ||
| 2587 | 2587 | [JsonProperty("input", Required = Required.Always)] |
| 2588 | 2588 | public string Input { get; set; } |
| 2589 | 2589 | |
| 2590 | - [JsonProperty("options", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 2591 | - public string[]? Options { get; set; } | |
| 2590 | + [JsonProperty("options", Required = Required.Always)] | |
| 2591 | + public string[] Options { get; set; } | |
| 2592 | 2592 | |
| 2593 | 2593 | [JsonProperty("max", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 2594 | 2594 | public double? Max { get; set; } |
| @@ -3564,8 +3564,8 @@ namespace QuickType | ||
| 3564 | 3564 | /// An URL from which to load the data set. Use the `format.type` property |
| 3565 | 3565 | /// to ensure the loaded data is correctly parsed. |
| 3566 | 3566 | /// </summary> |
| 3567 | - [JsonProperty("url", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3568 | - public string? Url { get; set; } | |
| 3567 | + [JsonProperty("url", Required = Required.Always)] | |
| 3568 | + public string Url { get; set; } | |
| 3569 | 3569 | |
| 3570 | 3570 | /// <summary> |
| 3571 | 3571 | /// The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3573,14 +3573,14 @@ namespace QuickType | ||
| 3573 | 3573 | /// Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3574 | 3574 | /// parsed according to the specified format type. |
| 3575 | 3575 | /// </summary> |
| 3576 | - [JsonProperty("values", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3577 | - public Values? Values { get; set; } | |
| 3576 | + [JsonProperty("values", Required = Required.Always)] | |
| 3577 | + public Values Values { get; set; } | |
| 3578 | 3578 | |
| 3579 | 3579 | /// <summary> |
| 3580 | 3580 | /// Provide a placeholder name and bind data at runtime. |
| 3581 | 3581 | /// </summary> |
| 3582 | - [JsonProperty("name", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3583 | - public string? Name { get; set; } | |
| 3582 | + [JsonProperty("name", Required = Required.Always)] | |
| 3583 | + public string Name { get; set; } | |
| 3584 | 3584 | } |
| 3585 | 3585 | |
| 3586 | 3586 | /// <summary> |
| @@ -3910,8 +3910,8 @@ namespace QuickType | ||
| 3910 | 3910 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3911 | 3911 | /// [geographic projection](projection.html) is applied. |
| 3912 | 3912 | /// </summary> |
| 3913 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3914 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 3913 | + [JsonProperty("type", Required = Required.Always)] | |
| 3914 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 3915 | 3915 | |
| 3916 | 3916 | /// <summary> |
| 3917 | 3917 | /// A constant value in visual domain. |
| @@ -3990,8 +3990,8 @@ namespace QuickType | ||
| 3990 | 3990 | |
| 3991 | 3991 | public partial class ConditionalValueDef |
| 3992 | 3992 | { |
| 3993 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 3994 | - public LogicalOperandPredicate? Test { get; set; } | |
| 3993 | + [JsonProperty("test", Required = Required.Always)] | |
| 3994 | + public LogicalOperandPredicate Test { get; set; } | |
| 3995 | 3995 | |
| 3996 | 3996 | /// <summary> |
| 3997 | 3997 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4004,46 +4004,46 @@ namespace QuickType | ||
| 4004 | 4004 | /// A [selection name](selection.html), or a series of [composed |
| 4005 | 4005 | /// selections](selection.html#compose). |
| 4006 | 4006 | /// </summary> |
| 4007 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4008 | - public SelectionOperand? Selection { get; set; } | |
| 4007 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4008 | + public SelectionOperand Selection { get; set; } | |
| 4009 | 4009 | } |
| 4010 | 4010 | |
| 4011 | 4011 | public partial class Selection |
| 4012 | 4012 | { |
| 4013 | - [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4014 | - public SelectionOperand? Not { get; set; } | |
| 4013 | + [JsonProperty("not", Required = Required.Always)] | |
| 4014 | + public SelectionOperand Not { get; set; } | |
| 4015 | 4015 | |
| 4016 | - [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4017 | - public SelectionOperand[]? And { get; set; } | |
| 4016 | + [JsonProperty("and", Required = Required.Always)] | |
| 4017 | + public SelectionOperand[] And { get; set; } | |
| 4018 | 4018 | |
| 4019 | - [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4020 | - public SelectionOperand[]? Or { get; set; } | |
| 4019 | + [JsonProperty("or", Required = Required.Always)] | |
| 4020 | + public SelectionOperand[] Or { get; set; } | |
| 4021 | 4021 | } |
| 4022 | 4022 | |
| 4023 | 4023 | public partial class Predicate |
| 4024 | 4024 | { |
| 4025 | - [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4026 | - public LogicalOperandPredicate? Not { get; set; } | |
| 4025 | + [JsonProperty("not", Required = Required.Always)] | |
| 4026 | + public LogicalOperandPredicate Not { get; set; } | |
| 4027 | 4027 | |
| 4028 | - [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4029 | - public LogicalOperandPredicate[]? And { get; set; } | |
| 4028 | + [JsonProperty("and", Required = Required.Always)] | |
| 4029 | + public LogicalOperandPredicate[] And { get; set; } | |
| 4030 | 4030 | |
| 4031 | - [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4032 | - public LogicalOperandPredicate[]? Or { get; set; } | |
| 4031 | + [JsonProperty("or", Required = Required.Always)] | |
| 4032 | + public LogicalOperandPredicate[] Or { get; set; } | |
| 4033 | 4033 | |
| 4034 | 4034 | /// <summary> |
| 4035 | 4035 | /// The value that the field should be equal to. |
| 4036 | 4036 | /// </summary> |
| 4037 | - [JsonProperty("equal", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4038 | - public Equal? Equal { get; set; } | |
| 4037 | + [JsonProperty("equal", Required = Required.Always)] | |
| 4038 | + public Equal Equal { get; set; } | |
| 4039 | 4039 | |
| 4040 | 4040 | /// <summary> |
| 4041 | 4041 | /// Field to be filtered. |
| 4042 | 4042 | /// |
| 4043 | 4043 | /// Field to be filtered |
| 4044 | 4044 | /// </summary> |
| 4045 | - [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4046 | - public string? Field { get; set; } | |
| 4045 | + [JsonProperty("field", Required = Required.Always)] | |
| 4046 | + public string Field { get; set; } | |
| 4047 | 4047 | |
| 4048 | 4048 | /// <summary> |
| 4049 | 4049 | /// Time unit for the field to be filtered. |
| @@ -4057,21 +4057,21 @@ namespace QuickType | ||
| 4057 | 4057 | /// An array of inclusive minimum and maximum values |
| 4058 | 4058 | /// for a field value of a data item to be included in the filtered data. |
| 4059 | 4059 | /// </summary> |
| 4060 | - [JsonProperty("range", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4061 | - public RangeElement[]? Range { get; set; } | |
| 4060 | + [JsonProperty("range", Required = Required.Always)] | |
| 4061 | + public RangeElement[] Range { get; set; } | |
| 4062 | 4062 | |
| 4063 | 4063 | /// <summary> |
| 4064 | 4064 | /// A set of values that the `field`'s value should be a member of, |
| 4065 | 4065 | /// for a data item included in the filtered data. |
| 4066 | 4066 | /// </summary> |
| 4067 | - [JsonProperty("oneOf", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4068 | - public Equal[]? OneOf { get; set; } | |
| 4067 | + [JsonProperty("oneOf", Required = Required.Always)] | |
| 4068 | + public Equal[] OneOf { get; set; } | |
| 4069 | 4069 | |
| 4070 | 4070 | /// <summary> |
| 4071 | 4071 | /// Filter using a selection name. |
| 4072 | 4072 | /// </summary> |
| 4073 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4074 | - public SelectionOperand? Selection { get; set; } | |
| 4073 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4074 | + public SelectionOperand Selection { get; set; } | |
| 4075 | 4075 | } |
| 4076 | 4076 | |
| 4077 | 4077 | /// <summary> |
| @@ -4158,22 +4158,22 @@ namespace QuickType | ||
| 4158 | 4158 | |
| 4159 | 4159 | public partial class ConditionalPredicateMarkPropFieldDefClass |
| 4160 | 4160 | { |
| 4161 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4162 | - public LogicalOperandPredicate? Test { get; set; } | |
| 4161 | + [JsonProperty("test", Required = Required.Always)] | |
| 4162 | + public LogicalOperandPredicate Test { get; set; } | |
| 4163 | 4163 | |
| 4164 | 4164 | /// <summary> |
| 4165 | 4165 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4166 | 4166 | /// `0` to `1` for opacity). |
| 4167 | 4167 | /// </summary> |
| 4168 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4169 | - public ConditionalValueDefValue? Value { get; set; } | |
| 4168 | + [JsonProperty("value", Required = Required.Always)] | |
| 4169 | + public ConditionalValueDefValue Value { get; set; } | |
| 4170 | 4170 | |
| 4171 | 4171 | /// <summary> |
| 4172 | 4172 | /// A [selection name](selection.html), or a series of [composed |
| 4173 | 4173 | /// selections](selection.html#compose). |
| 4174 | 4174 | /// </summary> |
| 4175 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4176 | - public SelectionOperand? Selection { get; set; } | |
| 4175 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4176 | + public SelectionOperand Selection { get; set; } | |
| 4177 | 4177 | |
| 4178 | 4178 | /// <summary> |
| 4179 | 4179 | /// Aggregation function for the field |
| @@ -4254,8 +4254,8 @@ namespace QuickType | ||
| 4254 | 4254 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4255 | 4255 | /// [geographic projection](projection.html) is applied. |
| 4256 | 4256 | /// </summary> |
| 4257 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4258 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 4257 | + [JsonProperty("type", Required = Required.Always)] | |
| 4258 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 4259 | 4259 | } |
| 4260 | 4260 | |
| 4261 | 4261 | /// <summary> |
| @@ -4960,8 +4960,8 @@ namespace QuickType | ||
| 4960 | 4960 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4961 | 4961 | /// [geographic projection](projection.html) is applied. |
| 4962 | 4962 | /// </summary> |
| 4963 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4964 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 4963 | + [JsonProperty("type", Required = Required.Always)] | |
| 4964 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 4965 | 4965 | |
| 4966 | 4966 | /// <summary> |
| 4967 | 4967 | /// A constant value in visual domain. |
| @@ -4972,22 +4972,22 @@ namespace QuickType | ||
| 4972 | 4972 | |
| 4973 | 4973 | public partial class ConditionalPredicateFieldDefClass |
| 4974 | 4974 | { |
| 4975 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4976 | - public LogicalOperandPredicate? Test { get; set; } | |
| 4975 | + [JsonProperty("test", Required = Required.Always)] | |
| 4976 | + public LogicalOperandPredicate Test { get; set; } | |
| 4977 | 4977 | |
| 4978 | 4978 | /// <summary> |
| 4979 | 4979 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4980 | 4980 | /// `0` to `1` for opacity). |
| 4981 | 4981 | /// </summary> |
| 4982 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4983 | - public ConditionalValueDefValue? Value { get; set; } | |
| 4982 | + [JsonProperty("value", Required = Required.Always)] | |
| 4983 | + public ConditionalValueDefValue Value { get; set; } | |
| 4984 | 4984 | |
| 4985 | 4985 | /// <summary> |
| 4986 | 4986 | /// A [selection name](selection.html), or a series of [composed |
| 4987 | 4987 | /// selections](selection.html#compose). |
| 4988 | 4988 | /// </summary> |
| 4989 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 4990 | - public SelectionOperand? Selection { get; set; } | |
| 4989 | + [JsonProperty("selection", Required = Required.Always)] | |
| 4990 | + public SelectionOperand Selection { get; set; } | |
| 4991 | 4991 | |
| 4992 | 4992 | /// <summary> |
| 4993 | 4993 | /// Aggregation function for the field |
| @@ -5038,8 +5038,8 @@ namespace QuickType | ||
| 5038 | 5038 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5039 | 5039 | /// [geographic projection](projection.html) is applied. |
| 5040 | 5040 | /// </summary> |
| 5041 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5042 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5041 | + [JsonProperty("type", Required = Required.Always)] | |
| 5042 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5043 | 5043 | } |
| 5044 | 5044 | |
| 5045 | 5045 | public partial class OrderFieldDef |
| @@ -5191,8 +5191,8 @@ namespace QuickType | ||
| 5191 | 5191 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5192 | 5192 | /// [geographic projection](projection.html) is applied. |
| 5193 | 5193 | /// </summary> |
| 5194 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5195 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5194 | + [JsonProperty("type", Required = Required.Always)] | |
| 5195 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5196 | 5196 | |
| 5197 | 5197 | /// <summary> |
| 5198 | 5198 | /// A constant value in visual domain. |
| @@ -5203,22 +5203,22 @@ namespace QuickType | ||
| 5203 | 5203 | |
| 5204 | 5204 | public partial class ConditionalPredicateTextFieldDefClass |
| 5205 | 5205 | { |
| 5206 | - [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5207 | - public LogicalOperandPredicate? Test { get; set; } | |
| 5206 | + [JsonProperty("test", Required = Required.Always)] | |
| 5207 | + public LogicalOperandPredicate Test { get; set; } | |
| 5208 | 5208 | |
| 5209 | 5209 | /// <summary> |
| 5210 | 5210 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5211 | 5211 | /// `0` to `1` for opacity). |
| 5212 | 5212 | /// </summary> |
| 5213 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5214 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5213 | + [JsonProperty("value", Required = Required.Always)] | |
| 5214 | + public ConditionalValueDefValue Value { get; set; } | |
| 5215 | 5215 | |
| 5216 | 5216 | /// <summary> |
| 5217 | 5217 | /// A [selection name](selection.html), or a series of [composed |
| 5218 | 5218 | /// selections](selection.html#compose). |
| 5219 | 5219 | /// </summary> |
| 5220 | - [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5221 | - public SelectionOperand? Selection { get; set; } | |
| 5220 | + [JsonProperty("selection", Required = Required.Always)] | |
| 5221 | + public SelectionOperand Selection { get; set; } | |
| 5222 | 5222 | |
| 5223 | 5223 | /// <summary> |
| 5224 | 5224 | /// Aggregation function for the field |
| @@ -5276,8 +5276,8 @@ namespace QuickType | ||
| 5276 | 5276 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5277 | 5277 | /// [geographic projection](projection.html) is applied. |
| 5278 | 5278 | /// </summary> |
| 5279 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5280 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5279 | + [JsonProperty("type", Required = Required.Always)] | |
| 5280 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5281 | 5281 | } |
| 5282 | 5282 | |
| 5283 | 5283 | /// <summary> |
| @@ -5393,15 +5393,15 @@ namespace QuickType | ||
| 5393 | 5393 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5394 | 5394 | /// [geographic projection](projection.html) is applied. |
| 5395 | 5395 | /// </summary> |
| 5396 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5397 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5396 | + [JsonProperty("type", Required = Required.Always)] | |
| 5397 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5398 | 5398 | |
| 5399 | 5399 | /// <summary> |
| 5400 | 5400 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5401 | 5401 | /// `0` to `1` for opacity). |
| 5402 | 5402 | /// </summary> |
| 5403 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5404 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5403 | + [JsonProperty("value", Required = Required.Always)] | |
| 5404 | + public ConditionalValueDefValue Value { get; set; } | |
| 5405 | 5405 | } |
| 5406 | 5406 | |
| 5407 | 5407 | public partial class Axis |
| @@ -5678,15 +5678,15 @@ namespace QuickType | ||
| 5678 | 5678 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5679 | 5679 | /// [geographic projection](projection.html) is applied. |
| 5680 | 5680 | /// </summary> |
| 5681 | - [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5682 | - public ConditionalPredicateValueDefType? Type { get; set; } | |
| 5681 | + [JsonProperty("type", Required = Required.Always)] | |
| 5682 | + public ConditionalPredicateValueDefType Type { get; set; } | |
| 5683 | 5683 | |
| 5684 | 5684 | /// <summary> |
| 5685 | 5685 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5686 | 5686 | /// `0` to `1` for opacity). |
| 5687 | 5687 | /// </summary> |
| 5688 | - [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5689 | - public ConditionalValueDefValue? Value { get; set; } | |
| 5688 | + [JsonProperty("value", Required = Required.Always)] | |
| 5689 | + public ConditionalValueDefValue Value { get; set; } | |
| 5690 | 5690 | } |
| 5691 | 5691 | |
| 5692 | 5692 | /// <summary> |
| @@ -5753,8 +5753,8 @@ namespace QuickType | ||
| 5753 | 5753 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5754 | 5754 | /// layering facet specifications is not allowed. |
| 5755 | 5755 | /// </summary> |
| 5756 | - [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5757 | - public LayerSpec[]? Layer { get; set; } | |
| 5756 | + [JsonProperty("layer", Required = Required.Always)] | |
| 5757 | + public LayerSpec[] Layer { get; set; } | |
| 5758 | 5758 | |
| 5759 | 5759 | /// <summary> |
| 5760 | 5760 | /// Name of the visualization for later reference. |
| @@ -5816,8 +5816,8 @@ namespace QuickType | ||
| 5816 | 5816 | /// <summary> |
| 5817 | 5817 | /// A key-value mapping between encoding channels and definition of fields. |
| 5818 | 5818 | /// </summary> |
| 5819 | - [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5820 | - public Encoding? Encoding { get; set; } | |
| 5819 | + [JsonProperty("encoding", Required = Required.Always)] | |
| 5820 | + public Encoding Encoding { get; set; } | |
| 5821 | 5821 | |
| 5822 | 5822 | /// <summary> |
| 5823 | 5823 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -5825,8 +5825,8 @@ namespace QuickType | ||
| 5825 | 5825 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 5826 | 5826 | /// object](mark.html#mark-def). |
| 5827 | 5827 | /// </summary> |
| 5828 | - [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5829 | - public AnyMark? Mark { get; set; } | |
| 5828 | + [JsonProperty("mark", Required = Required.Always)] | |
| 5829 | + public AnyMark Mark { get; set; } | |
| 5830 | 5830 | |
| 5831 | 5831 | /// <summary> |
| 5832 | 5832 | /// An object defining properties of geographic projection. |
| @@ -5847,33 +5847,33 @@ namespace QuickType | ||
| 5847 | 5847 | /// An object that describes mappings between `row` and `column` channels and their field |
| 5848 | 5848 | /// definitions. |
| 5849 | 5849 | /// </summary> |
| 5850 | - [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5851 | - public FacetMapping? Facet { get; set; } | |
| 5850 | + [JsonProperty("facet", Required = Required.Always)] | |
| 5851 | + public FacetMapping Facet { get; set; } | |
| 5852 | 5852 | |
| 5853 | 5853 | /// <summary> |
| 5854 | 5854 | /// A specification of the view that gets faceted. |
| 5855 | 5855 | /// </summary> |
| 5856 | - [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5857 | - public Spec? SpecSpec { get; set; } | |
| 5856 | + [JsonProperty("spec", Required = Required.Always)] | |
| 5857 | + public Spec SpecSpec { get; set; } | |
| 5858 | 5858 | |
| 5859 | 5859 | /// <summary> |
| 5860 | 5860 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 5861 | 5861 | /// `row` or `column`. |
| 5862 | 5862 | /// </summary> |
| 5863 | - [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5864 | - public Repeat? Repeat { get; set; } | |
| 5863 | + [JsonProperty("repeat", Required = Required.Always)] | |
| 5864 | + public Repeat Repeat { get; set; } | |
| 5865 | 5865 | |
| 5866 | 5866 | /// <summary> |
| 5867 | 5867 | /// A list of views that should be concatenated and put into a column. |
| 5868 | 5868 | /// </summary> |
| 5869 | - [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5870 | - public Spec[]? Vconcat { get; set; } | |
| 5869 | + [JsonProperty("vconcat", Required = Required.Always)] | |
| 5870 | + public Spec[] Vconcat { get; set; } | |
| 5871 | 5871 | |
| 5872 | 5872 | /// <summary> |
| 5873 | 5873 | /// A list of views that should be concatenated and put into a row. |
| 5874 | 5874 | /// </summary> |
| 5875 | - [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 5876 | - public Spec[]? Hconcat { get; set; } | |
| 5875 | + [JsonProperty("hconcat", Required = Required.Always)] | |
| 5876 | + public Spec[] Hconcat { get; set; } | |
| 5877 | 5877 | } |
| 5878 | 5878 | |
| 5879 | 5879 | /// <summary> |
| @@ -6031,8 +6031,8 @@ namespace QuickType | ||
| 6031 | 6031 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6032 | 6032 | /// layering facet specifications is not allowed. |
| 6033 | 6033 | /// </summary> |
| 6034 | - [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6035 | - public LayerSpec[]? Layer { get; set; } | |
| 6034 | + [JsonProperty("layer", Required = Required.Always)] | |
| 6035 | + public LayerSpec[] Layer { get; set; } | |
| 6036 | 6036 | |
| 6037 | 6037 | /// <summary> |
| 6038 | 6038 | /// Name of the visualization for later reference. |
| @@ -6086,8 +6086,8 @@ namespace QuickType | ||
| 6086 | 6086 | /// <summary> |
| 6087 | 6087 | /// A key-value mapping between encoding channels and definition of fields. |
| 6088 | 6088 | /// </summary> |
| 6089 | - [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6090 | - public Encoding? Encoding { get; set; } | |
| 6089 | + [JsonProperty("encoding", Required = Required.Always)] | |
| 6090 | + public Encoding Encoding { get; set; } | |
| 6091 | 6091 | |
| 6092 | 6092 | /// <summary> |
| 6093 | 6093 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6095,8 +6095,8 @@ namespace QuickType | ||
| 6095 | 6095 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6096 | 6096 | /// object](mark.html#mark-def). |
| 6097 | 6097 | /// </summary> |
| 6098 | - [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6099 | - public AnyMark? Mark { get; set; } | |
| 6098 | + [JsonProperty("mark", Required = Required.Always)] | |
| 6099 | + public AnyMark Mark { get; set; } | |
| 6100 | 6100 | |
| 6101 | 6101 | /// <summary> |
| 6102 | 6102 | /// An object defining properties of geographic projection. |
| @@ -6737,8 +6737,8 @@ namespace QuickType | ||
| 6737 | 6737 | /// (3) a [selection predicate](filter.html#selection-predicate); |
| 6738 | 6738 | /// or (4) a logical operand that combines (1), (2), or (3). |
| 6739 | 6739 | /// </summary> |
| 6740 | - [JsonProperty("filter", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6741 | - public LogicalOperandPredicate? Filter { get; set; } | |
| 6740 | + [JsonProperty("filter", Required = Required.Always)] | |
| 6741 | + public LogicalOperandPredicate Filter { get; set; } | |
| 6742 | 6742 | |
| 6743 | 6743 | /// <summary> |
| 6744 | 6744 | /// The field for storing the computed formula value. |
| @@ -6759,8 +6759,8 @@ namespace QuickType | ||
| 6759 | 6759 | /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 6760 | 6760 | /// current data object. |
| 6761 | 6761 | /// </summary> |
| 6762 | - [JsonProperty("calculate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6763 | - public string? Calculate { get; set; } | |
| 6762 | + [JsonProperty("calculate", Required = Required.Always)] | |
| 6763 | + public string Calculate { get; set; } | |
| 6764 | 6764 | |
| 6765 | 6765 | /// <summary> |
| 6766 | 6766 | /// The default value to use if lookup fails. |
| @@ -6773,40 +6773,40 @@ namespace QuickType | ||
| 6773 | 6773 | /// <summary> |
| 6774 | 6774 | /// Secondary data reference. |
| 6775 | 6775 | /// </summary> |
| 6776 | - [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6777 | - public LookupData? From { get; set; } | |
| 6776 | + [JsonProperty("from", Required = Required.Always)] | |
| 6777 | + public LookupData From { get; set; } | |
| 6778 | 6778 | |
| 6779 | 6779 | /// <summary> |
| 6780 | 6780 | /// Key in primary data source. |
| 6781 | 6781 | /// </summary> |
| 6782 | - [JsonProperty("lookup", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6783 | - public string? Lookup { get; set; } | |
| 6782 | + [JsonProperty("lookup", Required = Required.Always)] | |
| 6783 | + public string Lookup { get; set; } | |
| 6784 | 6784 | |
| 6785 | 6785 | /// <summary> |
| 6786 | 6786 | /// An object indicating bin properties, or simply `true` for using default bin parameters. |
| 6787 | 6787 | /// </summary> |
| 6788 | - [JsonProperty("bin", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6789 | - public Bin? Bin { get; set; } | |
| 6788 | + [JsonProperty("bin", Required = Required.Always)] | |
| 6789 | + public Bin Bin { get; set; } | |
| 6790 | 6790 | |
| 6791 | 6791 | /// <summary> |
| 6792 | 6792 | /// The data field to bin. |
| 6793 | 6793 | /// |
| 6794 | 6794 | /// The data field to apply time unit. |
| 6795 | 6795 | /// </summary> |
| 6796 | - [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6797 | - public string? Field { get; set; } | |
| 6796 | + [JsonProperty("field", Required = Required.Always)] | |
| 6797 | + public string Field { get; set; } | |
| 6798 | 6798 | |
| 6799 | 6799 | /// <summary> |
| 6800 | 6800 | /// The timeUnit. |
| 6801 | 6801 | /// </summary> |
| 6802 | - [JsonProperty("timeUnit", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6803 | - public TimeUnit? TimeUnit { get; set; } | |
| 6802 | + [JsonProperty("timeUnit", Required = Required.Always)] | |
| 6803 | + public TimeUnit TimeUnit { get; set; } | |
| 6804 | 6804 | |
| 6805 | 6805 | /// <summary> |
| 6806 | 6806 | /// Array of objects that define fields to aggregate. |
| 6807 | 6807 | /// </summary> |
| 6808 | - [JsonProperty("aggregate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 6809 | - public AggregatedFieldDef[]? Aggregate { get; set; } | |
| 6808 | + [JsonProperty("aggregate", Required = Required.Always)] | |
| 6809 | + public AggregatedFieldDef[] Aggregate { get; set; } | |
| 6810 | 6810 | |
| 6811 | 6811 | /// <summary> |
| 6812 | 6812 | /// The data fields to group by. If not specified, a single group containing all data objects |
Mschema-dartdefault / TopLevel.dart+164 −164
| @@ -41,7 +41,7 @@ class TopLevel { | ||
| 41 | 41 | final String? description; |
| 42 | 42 | |
| 43 | 43 | ///A key-value mapping between encoding channels and definition of fields. |
| 44 | - final EncodingWithFacet? encoding; | |
| 44 | + final EncodingWithFacet encoding; | |
| 45 | 45 | |
| 46 | 46 | ///The height of a visualization. |
| 47 | 47 | /// |
| @@ -120,7 +120,7 @@ class TopLevel { | ||
| 120 | 120 | /// |
| 121 | 121 | ///__Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 122 | 122 | ///layering facet specifications is not allowed. |
| 123 | - final List<LayerSpec>? layer; | |
| 123 | + final List<LayerSpec> layer; | |
| 124 | 124 | |
| 125 | 125 | ///Scale, axis, and legend resolutions for layers. |
| 126 | 126 | /// |
| @@ -135,20 +135,20 @@ class TopLevel { | ||
| 135 | 135 | |
| 136 | 136 | ///An object that describes mappings between `row` and `column` channels and their field |
| 137 | 137 | ///definitions. |
| 138 | - final FacetMapping? facet; | |
| 138 | + final FacetMapping facet; | |
| 139 | 139 | |
| 140 | 140 | ///A specification of the view that gets faceted. |
| 141 | - final Spec? spec; | |
| 141 | + final Spec spec; | |
| 142 | 142 | |
| 143 | 143 | ///An object that describes what fields should be repeated into views that are laid out as a |
| 144 | 144 | ///`row` or `column`. |
| 145 | - final Repeat? repeat; | |
| 145 | + final Repeat repeat; | |
| 146 | 146 | |
| 147 | 147 | ///A list of views that should be concatenated and put into a column. |
| 148 | - final List<Spec>? vconcat; | |
| 148 | + final List<Spec> vconcat; | |
| 149 | 149 | |
| 150 | 150 | ///A list of views that should be concatenated and put into a row. |
| 151 | - final List<Spec>? hconcat; | |
| 151 | + final List<Spec> hconcat; | |
| 152 | 152 | |
| 153 | 153 | TopLevel({ |
| 154 | 154 | this.schema, |
| @@ -157,9 +157,9 @@ class TopLevel { | ||
| 157 | 157 | this.config, |
| 158 | 158 | this.data, |
| 159 | 159 | this.description, |
| 160 | - this.encoding, | |
| 160 | + required this.encoding, | |
| 161 | 161 | this.height, |
| 162 | - this.mark, | |
| 162 | + required this.mark, | |
| 163 | 163 | this.name, |
| 164 | 164 | this.padding, |
| 165 | 165 | this.projection, |
| @@ -167,13 +167,13 @@ class TopLevel { | ||
| 167 | 167 | this.title, |
| 168 | 168 | this.transform, |
| 169 | 169 | this.width, |
| 170 | - this.layer, | |
| 170 | + required this.layer, | |
| 171 | 171 | this.resolve, |
| 172 | - this.facet, | |
| 173 | - this.spec, | |
| 174 | - this.repeat, | |
| 175 | - this.vconcat, | |
| 176 | - this.hconcat, | |
| 172 | + required this.facet, | |
| 173 | + required this.spec, | |
| 174 | + required this.repeat, | |
| 175 | + required this.vconcat, | |
| 176 | + required this.hconcat, | |
| 177 | 177 | }); |
| 178 | 178 | |
| 179 | 179 | factory TopLevel.fromJson(Map<String, dynamic> json) => TopLevel( |
| @@ -183,7 +183,7 @@ class TopLevel { | ||
| 183 | 183 | config: json["config"] == null ? null : Config.fromJson(json["config"]), |
| 184 | 184 | data: json["data"] == null ? null : Data.fromJson(json["data"]), |
| 185 | 185 | description: json["description"], |
| 186 | - encoding: json["encoding"] == null ? null : EncodingWithFacet.fromJson(json["encoding"]), | |
| 186 | + encoding: EncodingWithFacet.fromJson(json["encoding"]), | |
| 187 | 187 | height: json["height"]?.toDouble(), |
| 188 | 188 | mark: json["mark"], |
| 189 | 189 | name: json["name"], |
| @@ -193,13 +193,13 @@ class TopLevel { | ||
| 193 | 193 | title: json["title"], |
| 194 | 194 | transform: json["transform"] == null ? null : List<Transform>.from(json["transform"]!.map((x) => Transform.fromJson(x))), |
| 195 | 195 | width: json["width"]?.toDouble(), |
| 196 | - layer: json["layer"] == null ? null : List<LayerSpec>.from(json["layer"]!.map((x) => LayerSpec.fromJson(x))), | |
| 196 | + layer: List<LayerSpec>.from(json["layer"].map((x) => LayerSpec.fromJson(x))), | |
| 197 | 197 | resolve: json["resolve"] == null ? null : Resolve.fromJson(json["resolve"]), |
| 198 | - facet: json["facet"] == null ? null : FacetMapping.fromJson(json["facet"]), | |
| 199 | - spec: json["spec"] == null ? null : Spec.fromJson(json["spec"]), | |
| 200 | - repeat: json["repeat"] == null ? null : Repeat.fromJson(json["repeat"]), | |
| 201 | - vconcat: json["vconcat"] == null ? null : List<Spec>.from(json["vconcat"]!.map((x) => Spec.fromJson(x))), | |
| 202 | - hconcat: json["hconcat"] == null ? null : List<Spec>.from(json["hconcat"]!.map((x) => Spec.fromJson(x))), | |
| 198 | + facet: FacetMapping.fromJson(json["facet"]), | |
| 199 | + spec: Spec.fromJson(json["spec"]), | |
| 200 | + repeat: Repeat.fromJson(json["repeat"]), | |
| 201 | + vconcat: List<Spec>.from(json["vconcat"].map((x) => Spec.fromJson(x))), | |
| 202 | + hconcat: List<Spec>.from(json["hconcat"].map((x) => Spec.fromJson(x))), | |
| 203 | 203 | ); |
| 204 | 204 | |
| 205 | 205 | Map<String, dynamic> toJson() => { |
| @@ -209,7 +209,7 @@ class TopLevel { | ||
| 209 | 209 | "config": config?.toJson(), |
| 210 | 210 | "data": data?.toJson(), |
| 211 | 211 | "description": description, |
| 212 | - "encoding": encoding?.toJson(), | |
| 212 | + "encoding": encoding.toJson(), | |
| 213 | 213 | "height": height, |
| 214 | 214 | "mark": mark, |
| 215 | 215 | "name": name, |
| @@ -219,13 +219,13 @@ class TopLevel { | ||
| 219 | 219 | "title": title, |
| 220 | 220 | "transform": transform == null ? null : List<dynamic>.from(transform!.map((x) => x.toJson())), |
| 221 | 221 | "width": width, |
| 222 | - "layer": layer == null ? null : List<dynamic>.from(layer!.map((x) => x.toJson())), | |
| 222 | + "layer": List<dynamic>.from(layer.map((x) => x.toJson())), | |
| 223 | 223 | "resolve": resolve?.toJson(), |
| 224 | - "facet": facet?.toJson(), | |
| 225 | - "spec": spec?.toJson(), | |
| 226 | - "repeat": repeat?.toJson(), | |
| 227 | - "vconcat": vconcat == null ? null : List<dynamic>.from(vconcat!.map((x) => x.toJson())), | |
| 228 | - "hconcat": hconcat == null ? null : List<dynamic>.from(hconcat!.map((x) => x.toJson())), | |
| 224 | + "facet": facet.toJson(), | |
| 225 | + "spec": spec.toJson(), | |
| 226 | + "repeat": repeat.toJson(), | |
| 227 | + "vconcat": List<dynamic>.from(vconcat.map((x) => x.toJson())), | |
| 228 | + "hconcat": List<dynamic>.from(hconcat.map((x) => x.toJson())), | |
| 229 | 229 | }; |
| 230 | 230 | } |
| 231 | 231 | |
| @@ -2446,13 +2446,13 @@ final vgProjectionTypeValues = EnumValues({ | ||
| 2446 | 2446 | class VgScheme { |
| 2447 | 2447 | final double? count; |
| 2448 | 2448 | final List<double>? extent; |
| 2449 | - final String? scheme; | |
| 2449 | + final String scheme; | |
| 2450 | 2450 | final double? step; |
| 2451 | 2451 | |
| 2452 | 2452 | VgScheme({ |
| 2453 | 2453 | this.count, |
| 2454 | 2454 | this.extent, |
| 2455 | - this.scheme, | |
| 2455 | + required this.scheme, | |
| 2456 | 2456 | this.step, |
| 2457 | 2457 | }); |
| 2458 | 2458 | |
| @@ -3090,7 +3090,7 @@ class SingleSelectionConfig { | ||
| 3090 | 3090 | class VgBinding { |
| 3091 | 3091 | final String? element; |
| 3092 | 3092 | final String input; |
| 3093 | - final List<String>? options; | |
| 3093 | + final List<String> options; | |
| 3094 | 3094 | final double? max; |
| 3095 | 3095 | final double? min; |
| 3096 | 3096 | final double? step; |
| @@ -3098,7 +3098,7 @@ class VgBinding { | ||
| 3098 | 3098 | VgBinding({ |
| 3099 | 3099 | this.element, |
| 3100 | 3100 | required this.input, |
| 3101 | - this.options, | |
| 3101 | + required this.options, | |
| 3102 | 3102 | this.max, |
| 3103 | 3103 | this.min, |
| 3104 | 3104 | this.step, |
| @@ -3107,7 +3107,7 @@ class VgBinding { | ||
| 3107 | 3107 | factory VgBinding.fromJson(Map<String, dynamic> json) => VgBinding( |
| 3108 | 3108 | element: json["element"], |
| 3109 | 3109 | input: json["input"], |
| 3110 | - options: json["options"] == null ? null : List<String>.from(json["options"]!.map((x) => x)), | |
| 3110 | + options: List<String>.from(json["options"].map((x) => x)), | |
| 3111 | 3111 | max: json["max"]?.toDouble(), |
| 3112 | 3112 | min: json["min"]?.toDouble(), |
| 3113 | 3113 | step: json["step"]?.toDouble(), |
| @@ -3116,7 +3116,7 @@ class VgBinding { | ||
| 3116 | 3116 | Map<String, dynamic> toJson() => { |
| 3117 | 3117 | "element": element, |
| 3118 | 3118 | "input": input, |
| 3119 | - "options": options == null ? null : List<dynamic>.from(options!.map((x) => x)), | |
| 3119 | + "options": List<dynamic>.from(options.map((x) => x)), | |
| 3120 | 3120 | "max": max, |
| 3121 | 3121 | "min": min, |
| 3122 | 3122 | "step": step, |
| @@ -4153,7 +4153,7 @@ class Data { | ||
| 4153 | 4153 | |
| 4154 | 4154 | ///An URL from which to load the data set. Use the `format.type` property |
| 4155 | 4155 | ///to ensure the loaded data is correctly parsed. |
| 4156 | - final String? url; | |
| 4156 | + final String url; | |
| 4157 | 4157 | |
| 4158 | 4158 | ///The full data set, included inline. This can be an array of objects or primitive values |
| 4159 | 4159 | ///or a string. |
| @@ -4162,13 +4162,13 @@ class Data { | ||
| 4162 | 4162 | final dynamic values; |
| 4163 | 4163 | |
| 4164 | 4164 | ///Provide a placeholder name and bind data at runtime. |
| 4165 | - final String? name; | |
| 4165 | + final String name; | |
| 4166 | 4166 | |
| 4167 | 4167 | Data({ |
| 4168 | 4168 | this.format, |
| 4169 | - this.url, | |
| 4170 | - this.values, | |
| 4171 | - this.name, | |
| 4169 | + required this.url, | |
| 4170 | + required this.values, | |
| 4171 | + required this.name, | |
| 4172 | 4172 | }); |
| 4173 | 4173 | |
| 4174 | 4174 | factory Data.fromJson(Map<String, dynamic> json) => Data( |
| @@ -4528,7 +4528,7 @@ class MarkPropDefWithCondition { | ||
| 4528 | 4528 | ///`"nominal"`). |
| 4529 | 4529 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4530 | 4530 | ///[geographic projection](projection.html) is applied. |
| 4531 | - final Type? type; | |
| 4531 | + final Type type; | |
| 4532 | 4532 | |
| 4533 | 4533 | ///A constant value in visual domain. |
| 4534 | 4534 | final dynamic value; |
| @@ -4542,7 +4542,7 @@ class MarkPropDefWithCondition { | ||
| 4542 | 4542 | this.scale, |
| 4543 | 4543 | this.sort, |
| 4544 | 4544 | this.timeUnit, |
| 4545 | - this.type, | |
| 4545 | + required this.type, | |
| 4546 | 4546 | this.value, |
| 4547 | 4547 | }); |
| 4548 | 4548 | |
| @@ -4555,7 +4555,7 @@ class MarkPropDefWithCondition { | ||
| 4555 | 4555 | scale: json["scale"] == null ? null : Scale.fromJson(json["scale"]), |
| 4556 | 4556 | sort: json["sort"], |
| 4557 | 4557 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 4558 | - type: typeValues.map[json["type"]], | |
| 4558 | + type: typeValues.map[json["type"]]!, | |
| 4559 | 4559 | value: json["value"], |
| 4560 | 4560 | ); |
| 4561 | 4561 | |
| @@ -4727,9 +4727,9 @@ class ConditionalValueDef { | ||
| 4727 | 4727 | final dynamic selection; |
| 4728 | 4728 | |
| 4729 | 4729 | ConditionalValueDef({ |
| 4730 | - this.test, | |
| 4730 | + required this.test, | |
| 4731 | 4731 | required this.value, |
| 4732 | - this.selection, | |
| 4732 | + required this.selection, | |
| 4733 | 4733 | }); |
| 4734 | 4734 | |
| 4735 | 4735 | factory ConditionalValueDef.fromJson(Map<String, dynamic> json) => ConditionalValueDef( |
| @@ -4747,32 +4747,32 @@ class ConditionalValueDef { | ||
| 4747 | 4747 | |
| 4748 | 4748 | class Selection { |
| 4749 | 4749 | final dynamic not; |
| 4750 | - final List<dynamic>? and; | |
| 4751 | - final List<dynamic>? or; | |
| 4750 | + final List<dynamic> and; | |
| 4751 | + final List<dynamic> or; | |
| 4752 | 4752 | |
| 4753 | 4753 | Selection({ |
| 4754 | - this.not, | |
| 4755 | - this.and, | |
| 4756 | - this.or, | |
| 4754 | + required this.not, | |
| 4755 | + required this.and, | |
| 4756 | + required this.or, | |
| 4757 | 4757 | }); |
| 4758 | 4758 | |
| 4759 | 4759 | factory Selection.fromJson(Map<String, dynamic> json) => Selection( |
| 4760 | 4760 | not: json["not"], |
| 4761 | - and: json["and"] == null ? null : List<dynamic>.from(json["and"]!.map((x) => x)), | |
| 4762 | - or: json["or"] == null ? null : List<dynamic>.from(json["or"]!.map((x) => x)), | |
| 4761 | + and: List<dynamic>.from(json["and"].map((x) => x)), | |
| 4762 | + or: List<dynamic>.from(json["or"].map((x) => x)), | |
| 4763 | 4763 | ); |
| 4764 | 4764 | |
| 4765 | 4765 | Map<String, dynamic> toJson() => { |
| 4766 | 4766 | "not": not, |
| 4767 | - "and": and == null ? null : List<dynamic>.from(and!.map((x) => x)), | |
| 4768 | - "or": or == null ? null : List<dynamic>.from(or!.map((x) => x)), | |
| 4767 | + "and": List<dynamic>.from(and.map((x) => x)), | |
| 4768 | + "or": List<dynamic>.from(or.map((x) => x)), | |
| 4769 | 4769 | }; |
| 4770 | 4770 | } |
| 4771 | 4771 | |
| 4772 | 4772 | class Predicate { |
| 4773 | 4773 | final dynamic not; |
| 4774 | - final List<dynamic>? and; | |
| 4775 | - final List<dynamic>? or; | |
| 4774 | + final List<dynamic> and; | |
| 4775 | + final List<dynamic> or; | |
| 4776 | 4776 | |
| 4777 | 4777 | ///The value that the field should be equal to. |
| 4778 | 4778 | final dynamic equal; |
| @@ -4780,7 +4780,7 @@ class Predicate { | ||
| 4780 | 4780 | ///Field to be filtered. |
| 4781 | 4781 | /// |
| 4782 | 4782 | ///Field to be filtered |
| 4783 | - final String? field; | |
| 4783 | + final String field; | |
| 4784 | 4784 | |
| 4785 | 4785 | ///Time unit for the field to be filtered. |
| 4786 | 4786 | /// |
| @@ -4789,48 +4789,48 @@ class Predicate { | ||
| 4789 | 4789 | |
| 4790 | 4790 | ///An array of inclusive minimum and maximum values |
| 4791 | 4791 | ///for a field value of a data item to be included in the filtered data. |
| 4792 | - final List<dynamic>? range; | |
| 4792 | + final List<dynamic> range; | |
| 4793 | 4793 | |
| 4794 | 4794 | ///A set of values that the `field`'s value should be a member of, |
| 4795 | 4795 | ///for a data item included in the filtered data. |
| 4796 | - final List<dynamic>? oneOf; | |
| 4796 | + final List<dynamic> oneOf; | |
| 4797 | 4797 | |
| 4798 | 4798 | ///Filter using a selection name. |
| 4799 | 4799 | final dynamic selection; |
| 4800 | 4800 | |
| 4801 | 4801 | Predicate({ |
| 4802 | - this.not, | |
| 4803 | - this.and, | |
| 4804 | - this.or, | |
| 4805 | - this.equal, | |
| 4806 | - this.field, | |
| 4802 | + required this.not, | |
| 4803 | + required this.and, | |
| 4804 | + required this.or, | |
| 4805 | + required this.equal, | |
| 4806 | + required this.field, | |
| 4807 | 4807 | this.timeUnit, |
| 4808 | - this.range, | |
| 4809 | - this.oneOf, | |
| 4810 | - this.selection, | |
| 4808 | + required this.range, | |
| 4809 | + required this.oneOf, | |
| 4810 | + required this.selection, | |
| 4811 | 4811 | }); |
| 4812 | 4812 | |
| 4813 | 4813 | factory Predicate.fromJson(Map<String, dynamic> json) => Predicate( |
| 4814 | 4814 | not: json["not"], |
| 4815 | - and: json["and"] == null ? null : List<dynamic>.from(json["and"]!.map((x) => x)), | |
| 4816 | - or: json["or"] == null ? null : List<dynamic>.from(json["or"]!.map((x) => x)), | |
| 4815 | + and: List<dynamic>.from(json["and"].map((x) => x)), | |
| 4816 | + or: List<dynamic>.from(json["or"].map((x) => x)), | |
| 4817 | 4817 | equal: json["equal"], |
| 4818 | 4818 | field: json["field"], |
| 4819 | 4819 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 4820 | - range: json["range"] == null ? null : List<dynamic>.from(json["range"]!.map((x) => x)), | |
| 4821 | - oneOf: json["oneOf"] == null ? null : List<dynamic>.from(json["oneOf"]!.map((x) => x)), | |
| 4820 | + range: List<dynamic>.from(json["range"].map((x) => x)), | |
| 4821 | + oneOf: List<dynamic>.from(json["oneOf"].map((x) => x)), | |
| 4822 | 4822 | selection: json["selection"], |
| 4823 | 4823 | ); |
| 4824 | 4824 | |
| 4825 | 4825 | Map<String, dynamic> toJson() => { |
| 4826 | 4826 | "not": not, |
| 4827 | - "and": and == null ? null : List<dynamic>.from(and!.map((x) => x)), | |
| 4828 | - "or": or == null ? null : List<dynamic>.from(or!.map((x) => x)), | |
| 4827 | + "and": List<dynamic>.from(and.map((x) => x)), | |
| 4828 | + "or": List<dynamic>.from(or.map((x) => x)), | |
| 4829 | 4829 | "equal": equal, |
| 4830 | 4830 | "field": field, |
| 4831 | 4831 | "timeUnit": timeUnitValues.reverse[timeUnit], |
| 4832 | - "range": range == null ? null : List<dynamic>.from(range!.map((x) => x)), | |
| 4833 | - "oneOf": oneOf == null ? null : List<dynamic>.from(oneOf!.map((x) => x)), | |
| 4832 | + "range": List<dynamic>.from(range.map((x) => x)), | |
| 4833 | + "oneOf": List<dynamic>.from(oneOf.map((x) => x)), | |
| 4834 | 4834 | "selection": selection, |
| 4835 | 4835 | }; |
| 4836 | 4836 | } |
| @@ -5091,12 +5091,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 5091 | 5091 | ///`"nominal"`). |
| 5092 | 5092 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5093 | 5093 | ///[geographic projection](projection.html) is applied. |
| 5094 | - final Type? type; | |
| 5094 | + final Type type; | |
| 5095 | 5095 | |
| 5096 | 5096 | ConditionalPredicateMarkPropFieldDefClass({ |
| 5097 | - this.test, | |
| 5098 | - this.value, | |
| 5099 | - this.selection, | |
| 5097 | + required this.test, | |
| 5098 | + required this.value, | |
| 5099 | + required this.selection, | |
| 5100 | 5100 | this.aggregate, |
| 5101 | 5101 | this.bin, |
| 5102 | 5102 | this.field, |
| @@ -5104,7 +5104,7 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 5104 | 5104 | this.scale, |
| 5105 | 5105 | this.sort, |
| 5106 | 5106 | this.timeUnit, |
| 5107 | - this.type, | |
| 5107 | + required this.type, | |
| 5108 | 5108 | }); |
| 5109 | 5109 | |
| 5110 | 5110 | factory ConditionalPredicateMarkPropFieldDefClass.fromJson(Map<String, dynamic> json) => ConditionalPredicateMarkPropFieldDefClass( |
| @@ -5118,7 +5118,7 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 5118 | 5118 | scale: json["scale"] == null ? null : Scale.fromJson(json["scale"]), |
| 5119 | 5119 | sort: json["sort"], |
| 5120 | 5120 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 5121 | - type: typeValues.map[json["type"]], | |
| 5121 | + type: typeValues.map[json["type"]]!, | |
| 5122 | 5122 | ); |
| 5123 | 5123 | |
| 5124 | 5124 | Map<String, dynamic> toJson() => { |
| @@ -6063,7 +6063,7 @@ class DefWithCondition { | ||
| 6063 | 6063 | ///`"nominal"`). |
| 6064 | 6064 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6065 | 6065 | ///[geographic projection](projection.html) is applied. |
| 6066 | - final Type? type; | |
| 6066 | + final Type type; | |
| 6067 | 6067 | |
| 6068 | 6068 | ///A constant value in visual domain. |
| 6069 | 6069 | final dynamic value; |
| @@ -6074,7 +6074,7 @@ class DefWithCondition { | ||
| 6074 | 6074 | this.condition, |
| 6075 | 6075 | this.field, |
| 6076 | 6076 | this.timeUnit, |
| 6077 | - this.type, | |
| 6077 | + required this.type, | |
| 6078 | 6078 | this.value, |
| 6079 | 6079 | }); |
| 6080 | 6080 | |
| @@ -6084,7 +6084,7 @@ class DefWithCondition { | ||
| 6084 | 6084 | condition: json["condition"], |
| 6085 | 6085 | field: json["field"], |
| 6086 | 6086 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 6087 | - type: typeValues.map[json["type"]], | |
| 6087 | + type: typeValues.map[json["type"]]!, | |
| 6088 | 6088 | value: json["value"], |
| 6089 | 6089 | ); |
| 6090 | 6090 | |
| @@ -6145,17 +6145,17 @@ class ConditionalPredicateFieldDefClass { | ||
| 6145 | 6145 | ///`"nominal"`). |
| 6146 | 6146 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6147 | 6147 | ///[geographic projection](projection.html) is applied. |
| 6148 | - final Type? type; | |
| 6148 | + final Type type; | |
| 6149 | 6149 | |
| 6150 | 6150 | ConditionalPredicateFieldDefClass({ |
| 6151 | - this.test, | |
| 6152 | - this.value, | |
| 6153 | - this.selection, | |
| 6151 | + required this.test, | |
| 6152 | + required this.value, | |
| 6153 | + required this.selection, | |
| 6154 | 6154 | this.aggregate, |
| 6155 | 6155 | this.bin, |
| 6156 | 6156 | this.field, |
| 6157 | 6157 | this.timeUnit, |
| 6158 | - this.type, | |
| 6158 | + required this.type, | |
| 6159 | 6159 | }); |
| 6160 | 6160 | |
| 6161 | 6161 | factory ConditionalPredicateFieldDefClass.fromJson(Map<String, dynamic> json) => ConditionalPredicateFieldDefClass( |
| @@ -6166,7 +6166,7 @@ class ConditionalPredicateFieldDefClass { | ||
| 6166 | 6166 | bin: json["bin"], |
| 6167 | 6167 | field: json["field"], |
| 6168 | 6168 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 6169 | - type: typeValues.map[json["type"]], | |
| 6169 | + type: typeValues.map[json["type"]]!, | |
| 6170 | 6170 | ); |
| 6171 | 6171 | |
| 6172 | 6172 | Map<String, dynamic> toJson() => { |
| @@ -6318,7 +6318,7 @@ class TextDefWithCondition { | ||
| 6318 | 6318 | ///`"nominal"`). |
| 6319 | 6319 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6320 | 6320 | ///[geographic projection](projection.html) is applied. |
| 6321 | - final Type? type; | |
| 6321 | + final Type type; | |
| 6322 | 6322 | |
| 6323 | 6323 | ///A constant value in visual domain. |
| 6324 | 6324 | final dynamic value; |
| @@ -6330,7 +6330,7 @@ class TextDefWithCondition { | ||
| 6330 | 6330 | this.field, |
| 6331 | 6331 | this.format, |
| 6332 | 6332 | this.timeUnit, |
| 6333 | - this.type, | |
| 6333 | + required this.type, | |
| 6334 | 6334 | this.value, |
| 6335 | 6335 | }); |
| 6336 | 6336 | |
| @@ -6341,7 +6341,7 @@ class TextDefWithCondition { | ||
| 6341 | 6341 | field: json["field"], |
| 6342 | 6342 | format: json["format"], |
| 6343 | 6343 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 6344 | - type: typeValues.map[json["type"]], | |
| 6344 | + type: typeValues.map[json["type"]]!, | |
| 6345 | 6345 | value: json["value"], |
| 6346 | 6346 | ); |
| 6347 | 6347 | |
| @@ -6407,18 +6407,18 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 6407 | 6407 | ///`"nominal"`). |
| 6408 | 6408 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6409 | 6409 | ///[geographic projection](projection.html) is applied. |
| 6410 | - final Type? type; | |
| 6410 | + final Type type; | |
| 6411 | 6411 | |
| 6412 | 6412 | ConditionalPredicateTextFieldDefClass({ |
| 6413 | - this.test, | |
| 6414 | - this.value, | |
| 6415 | - this.selection, | |
| 6413 | + required this.test, | |
| 6414 | + required this.value, | |
| 6415 | + required this.selection, | |
| 6416 | 6416 | this.aggregate, |
| 6417 | 6417 | this.bin, |
| 6418 | 6418 | this.field, |
| 6419 | 6419 | this.format, |
| 6420 | 6420 | this.timeUnit, |
| 6421 | - this.type, | |
| 6421 | + required this.type, | |
| 6422 | 6422 | }); |
| 6423 | 6423 | |
| 6424 | 6424 | factory ConditionalPredicateTextFieldDefClass.fromJson(Map<String, dynamic> json) => ConditionalPredicateTextFieldDefClass( |
| @@ -6430,7 +6430,7 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 6430 | 6430 | field: json["field"], |
| 6431 | 6431 | format: json["format"], |
| 6432 | 6432 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 6433 | - type: typeValues.map[json["type"]], | |
| 6433 | + type: typeValues.map[json["type"]]!, | |
| 6434 | 6434 | ); |
| 6435 | 6435 | |
| 6436 | 6436 | Map<String, dynamic> toJson() => { |
| @@ -6532,7 +6532,7 @@ class XClass { | ||
| 6532 | 6532 | ///`"nominal"`). |
| 6533 | 6533 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6534 | 6534 | ///[geographic projection](projection.html) is applied. |
| 6535 | - final Type? type; | |
| 6535 | + final Type type; | |
| 6536 | 6536 | |
| 6537 | 6537 | ///A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6538 | 6538 | ///`0` to `1` for opacity). |
| @@ -6547,8 +6547,8 @@ class XClass { | ||
| 6547 | 6547 | this.sort, |
| 6548 | 6548 | this.stack, |
| 6549 | 6549 | this.timeUnit, |
| 6550 | - this.type, | |
| 6551 | - this.value, | |
| 6550 | + required this.type, | |
| 6551 | + required this.value, | |
| 6552 | 6552 | }); |
| 6553 | 6553 | |
| 6554 | 6554 | factory XClass.fromJson(Map<String, dynamic> json) => XClass( |
| @@ -6560,7 +6560,7 @@ class XClass { | ||
| 6560 | 6560 | sort: json["sort"], |
| 6561 | 6561 | stack: stackOffsetValues.map[json["stack"]], |
| 6562 | 6562 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 6563 | - type: typeValues.map[json["type"]], | |
| 6563 | + type: typeValues.map[json["type"]]!, | |
| 6564 | 6564 | value: json["value"], |
| 6565 | 6565 | ); |
| 6566 | 6566 | |
| @@ -6843,7 +6843,7 @@ class X2Class { | ||
| 6843 | 6843 | ///`"nominal"`). |
| 6844 | 6844 | ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6845 | 6845 | ///[geographic projection](projection.html) is applied. |
| 6846 | - final Type? type; | |
| 6846 | + final Type type; | |
| 6847 | 6847 | |
| 6848 | 6848 | ///A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6849 | 6849 | ///`0` to `1` for opacity). |
| @@ -6854,8 +6854,8 @@ class X2Class { | ||
| 6854 | 6854 | this.bin, |
| 6855 | 6855 | this.field, |
| 6856 | 6856 | this.timeUnit, |
| 6857 | - this.type, | |
| 6858 | - this.value, | |
| 6857 | + required this.type, | |
| 6858 | + required this.value, | |
| 6859 | 6859 | }); |
| 6860 | 6860 | |
| 6861 | 6861 | factory X2Class.fromJson(Map<String, dynamic> json) => X2Class( |
| @@ -6863,7 +6863,7 @@ class X2Class { | ||
| 6863 | 6863 | bin: json["bin"], |
| 6864 | 6864 | field: json["field"], |
| 6865 | 6865 | timeUnit: timeUnitValues.map[json["timeUnit"]], |
| 6866 | - type: typeValues.map[json["type"]], | |
| 6866 | + type: typeValues.map[json["type"]]!, | |
| 6867 | 6867 | value: json["value"], |
| 6868 | 6868 | ); |
| 6869 | 6869 | |
| @@ -6937,7 +6937,7 @@ class Spec { | ||
| 6937 | 6937 | /// |
| 6938 | 6938 | ///__Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6939 | 6939 | ///layering facet specifications is not allowed. |
| 6940 | - final List<LayerSpec>? layer; | |
| 6940 | + final List<LayerSpec> layer; | |
| 6941 | 6941 | |
| 6942 | 6942 | ///Name of the visualization for later reference. |
| 6943 | 6943 | final String? name; |
| @@ -6982,7 +6982,7 @@ class Spec { | ||
| 6982 | 6982 | final double? width; |
| 6983 | 6983 | |
| 6984 | 6984 | ///A key-value mapping between encoding channels and definition of fields. |
| 6985 | - final Encoding? encoding; | |
| 6985 | + final Encoding encoding; | |
| 6986 | 6986 | |
| 6987 | 6987 | ///A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 6988 | 6988 | ///`"line"`, |
| @@ -7001,82 +7001,82 @@ class Spec { | ||
| 7001 | 7001 | |
| 7002 | 7002 | ///An object that describes mappings between `row` and `column` channels and their field |
| 7003 | 7003 | ///definitions. |
| 7004 | - final FacetMapping? facet; | |
| 7004 | + final FacetMapping facet; | |
| 7005 | 7005 | |
| 7006 | 7006 | ///A specification of the view that gets faceted. |
| 7007 | - final Spec? spec; | |
| 7007 | + final Spec spec; | |
| 7008 | 7008 | |
| 7009 | 7009 | ///An object that describes what fields should be repeated into views that are laid out as a |
| 7010 | 7010 | ///`row` or `column`. |
| 7011 | - final Repeat? repeat; | |
| 7011 | + final Repeat repeat; | |
| 7012 | 7012 | |
| 7013 | 7013 | ///A list of views that should be concatenated and put into a column. |
| 7014 | - final List<Spec>? vconcat; | |
| 7014 | + final List<Spec> vconcat; | |
| 7015 | 7015 | |
| 7016 | 7016 | ///A list of views that should be concatenated and put into a row. |
| 7017 | - final List<Spec>? hconcat; | |
| 7017 | + final List<Spec> hconcat; | |
| 7018 | 7018 | |
| 7019 | 7019 | Spec({ |
| 7020 | 7020 | this.data, |
| 7021 | 7021 | this.description, |
| 7022 | 7022 | this.height, |
| 7023 | - this.layer, | |
| 7023 | + required this.layer, | |
| 7024 | 7024 | this.name, |
| 7025 | 7025 | this.resolve, |
| 7026 | 7026 | this.title, |
| 7027 | 7027 | this.transform, |
| 7028 | 7028 | this.width, |
| 7029 | - this.encoding, | |
| 7030 | - this.mark, | |
| 7029 | + required this.encoding, | |
| 7030 | + required this.mark, | |
| 7031 | 7031 | this.projection, |
| 7032 | 7032 | this.selection, |
| 7033 | - this.facet, | |
| 7034 | - this.spec, | |
| 7035 | - this.repeat, | |
| 7036 | - this.vconcat, | |
| 7037 | - this.hconcat, | |
| 7033 | + required this.facet, | |
| 7034 | + required this.spec, | |
| 7035 | + required this.repeat, | |
| 7036 | + required this.vconcat, | |
| 7037 | + required this.hconcat, | |
| 7038 | 7038 | }); |
| 7039 | 7039 | |
| 7040 | 7040 | factory Spec.fromJson(Map<String, dynamic> json) => Spec( |
| 7041 | 7041 | data: json["data"] == null ? null : Data.fromJson(json["data"]), |
| 7042 | 7042 | description: json["description"], |
| 7043 | 7043 | height: json["height"]?.toDouble(), |
| 7044 | - layer: json["layer"] == null ? null : List<LayerSpec>.from(json["layer"]!.map((x) => LayerSpec.fromJson(x))), | |
| 7044 | + layer: List<LayerSpec>.from(json["layer"].map((x) => LayerSpec.fromJson(x))), | |
| 7045 | 7045 | name: json["name"], |
| 7046 | 7046 | resolve: json["resolve"] == null ? null : Resolve.fromJson(json["resolve"]), |
| 7047 | 7047 | title: json["title"], |
| 7048 | 7048 | transform: json["transform"] == null ? null : List<Transform>.from(json["transform"]!.map((x) => Transform.fromJson(x))), |
| 7049 | 7049 | width: json["width"]?.toDouble(), |
| 7050 | - encoding: json["encoding"] == null ? null : Encoding.fromJson(json["encoding"]), | |
| 7050 | + encoding: Encoding.fromJson(json["encoding"]), | |
| 7051 | 7051 | mark: json["mark"], |
| 7052 | 7052 | projection: json["projection"] == null ? null : Projection.fromJson(json["projection"]), |
| 7053 | 7053 | selection: Map.from(json["selection"]!).map((k, v) => MapEntry<String, SelectionDef>(k, SelectionDef.fromJson(v))), |
| 7054 | - facet: json["facet"] == null ? null : FacetMapping.fromJson(json["facet"]), | |
| 7055 | - spec: json["spec"] == null ? null : Spec.fromJson(json["spec"]), | |
| 7056 | - repeat: json["repeat"] == null ? null : Repeat.fromJson(json["repeat"]), | |
| 7057 | - vconcat: json["vconcat"] == null ? null : List<Spec>.from(json["vconcat"]!.map((x) => Spec.fromJson(x))), | |
| 7058 | - hconcat: json["hconcat"] == null ? null : List<Spec>.from(json["hconcat"]!.map((x) => Spec.fromJson(x))), | |
| 7054 | + facet: FacetMapping.fromJson(json["facet"]), | |
| 7055 | + spec: Spec.fromJson(json["spec"]), | |
| 7056 | + repeat: Repeat.fromJson(json["repeat"]), | |
| 7057 | + vconcat: List<Spec>.from(json["vconcat"].map((x) => Spec.fromJson(x))), | |
| 7058 | + hconcat: List<Spec>.from(json["hconcat"].map((x) => Spec.fromJson(x))), | |
| 7059 | 7059 | ); |
| 7060 | 7060 | |
| 7061 | 7061 | Map<String, dynamic> toJson() => { |
| 7062 | 7062 | "data": data?.toJson(), |
| 7063 | 7063 | "description": description, |
| 7064 | 7064 | "height": height, |
| 7065 | - "layer": layer == null ? null : List<dynamic>.from(layer!.map((x) => x.toJson())), | |
| 7065 | + "layer": List<dynamic>.from(layer.map((x) => x.toJson())), | |
| 7066 | 7066 | "name": name, |
| 7067 | 7067 | "resolve": resolve?.toJson(), |
| 7068 | 7068 | "title": title, |
| 7069 | 7069 | "transform": transform == null ? null : List<dynamic>.from(transform!.map((x) => x.toJson())), |
| 7070 | 7070 | "width": width, |
| 7071 | - "encoding": encoding?.toJson(), | |
| 7071 | + "encoding": encoding.toJson(), | |
| 7072 | 7072 | "mark": mark, |
| 7073 | 7073 | "projection": projection?.toJson(), |
| 7074 | 7074 | "selection": Map.from(selection!).map((k, v) => MapEntry<String, dynamic>(k, v.toJson())), |
| 7075 | - "facet": facet?.toJson(), | |
| 7076 | - "spec": spec?.toJson(), | |
| 7077 | - "repeat": repeat?.toJson(), | |
| 7078 | - "vconcat": vconcat == null ? null : List<dynamic>.from(vconcat!.map((x) => x.toJson())), | |
| 7079 | - "hconcat": hconcat == null ? null : List<dynamic>.from(hconcat!.map((x) => x.toJson())), | |
| 7075 | + "facet": facet.toJson(), | |
| 7076 | + "spec": spec.toJson(), | |
| 7077 | + "repeat": repeat.toJson(), | |
| 7078 | + "vconcat": List<dynamic>.from(vconcat.map((x) => x.toJson())), | |
| 7079 | + "hconcat": List<dynamic>.from(hconcat.map((x) => x.toJson())), | |
| 7080 | 7080 | }; |
| 7081 | 7081 | } |
| 7082 | 7082 | |
| @@ -7231,7 +7231,7 @@ class LayerSpec { | ||
| 7231 | 7231 | /// |
| 7232 | 7232 | ///__Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 7233 | 7233 | ///layering facet specifications is not allowed. |
| 7234 | - final List<LayerSpec>? layer; | |
| 7234 | + final List<LayerSpec> layer; | |
| 7235 | 7235 | |
| 7236 | 7236 | ///Name of the visualization for later reference. |
| 7237 | 7237 | final String? name; |
| @@ -7268,7 +7268,7 @@ class LayerSpec { | ||
| 7268 | 7268 | final double? width; |
| 7269 | 7269 | |
| 7270 | 7270 | ///A key-value mapping between encoding channels and definition of fields. |
| 7271 | - final Encoding? encoding; | |
| 7271 | + final Encoding encoding; | |
| 7272 | 7272 | |
| 7273 | 7273 | ///A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 7274 | 7274 | ///`"line"`, |
| @@ -7289,14 +7289,14 @@ class LayerSpec { | ||
| 7289 | 7289 | this.data, |
| 7290 | 7290 | this.description, |
| 7291 | 7291 | this.height, |
| 7292 | - this.layer, | |
| 7292 | + required this.layer, | |
| 7293 | 7293 | this.name, |
| 7294 | 7294 | this.resolve, |
| 7295 | 7295 | this.title, |
| 7296 | 7296 | this.transform, |
| 7297 | 7297 | this.width, |
| 7298 | - this.encoding, | |
| 7299 | - this.mark, | |
| 7298 | + required this.encoding, | |
| 7299 | + required this.mark, | |
| 7300 | 7300 | this.projection, |
| 7301 | 7301 | this.selection, |
| 7302 | 7302 | }); |
| @@ -7305,13 +7305,13 @@ class LayerSpec { | ||
| 7305 | 7305 | data: json["data"] == null ? null : Data.fromJson(json["data"]), |
| 7306 | 7306 | description: json["description"], |
| 7307 | 7307 | height: json["height"]?.toDouble(), |
| 7308 | - layer: json["layer"] == null ? null : List<LayerSpec>.from(json["layer"]!.map((x) => LayerSpec.fromJson(x))), | |
| 7308 | + layer: List<LayerSpec>.from(json["layer"].map((x) => LayerSpec.fromJson(x))), | |
| 7309 | 7309 | name: json["name"], |
| 7310 | 7310 | resolve: json["resolve"] == null ? null : Resolve.fromJson(json["resolve"]), |
| 7311 | 7311 | title: json["title"], |
| 7312 | 7312 | transform: json["transform"] == null ? null : List<Transform>.from(json["transform"]!.map((x) => Transform.fromJson(x))), |
| 7313 | 7313 | width: json["width"]?.toDouble(), |
| 7314 | - encoding: json["encoding"] == null ? null : Encoding.fromJson(json["encoding"]), | |
| 7314 | + encoding: Encoding.fromJson(json["encoding"]), | |
| 7315 | 7315 | mark: json["mark"], |
| 7316 | 7316 | projection: json["projection"] == null ? null : Projection.fromJson(json["projection"]), |
| 7317 | 7317 | selection: Map.from(json["selection"]!).map((k, v) => MapEntry<String, SelectionDef>(k, SelectionDef.fromJson(v))), |
| @@ -7321,13 +7321,13 @@ class LayerSpec { | ||
| 7321 | 7321 | "data": data?.toJson(), |
| 7322 | 7322 | "description": description, |
| 7323 | 7323 | "height": height, |
| 7324 | - "layer": layer == null ? null : List<dynamic>.from(layer!.map((x) => x.toJson())), | |
| 7324 | + "layer": List<dynamic>.from(layer.map((x) => x.toJson())), | |
| 7325 | 7325 | "name": name, |
| 7326 | 7326 | "resolve": resolve?.toJson(), |
| 7327 | 7327 | "title": title, |
| 7328 | 7328 | "transform": transform == null ? null : List<dynamic>.from(transform!.map((x) => x.toJson())), |
| 7329 | 7329 | "width": width, |
| 7330 | - "encoding": encoding?.toJson(), | |
| 7330 | + "encoding": encoding.toJson(), | |
| 7331 | 7331 | "mark": mark, |
| 7332 | 7332 | "projection": projection?.toJson(), |
| 7333 | 7333 | "selection": Map.from(selection!).map((k, v) => MapEntry<String, dynamic>(k, v.toJson())), |
| @@ -8113,7 +8113,7 @@ class Transform { | ||
| 8113 | 8113 | |
| 8114 | 8114 | ///A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 8115 | 8115 | ///current data object. |
| 8116 | - final String? calculate; | |
| 8116 | + final String calculate; | |
| 8117 | 8117 | |
| 8118 | 8118 | ///The default value to use if lookup fails. |
| 8119 | 8119 | /// |
| @@ -8121,10 +8121,10 @@ class Transform { | ||
| 8121 | 8121 | final String? transformDefault; |
| 8122 | 8122 | |
| 8123 | 8123 | ///Secondary data reference. |
| 8124 | - final LookupData? from; | |
| 8124 | + final LookupData from; | |
| 8125 | 8125 | |
| 8126 | 8126 | ///Key in primary data source. |
| 8127 | - final String? lookup; | |
| 8127 | + final String lookup; | |
| 8128 | 8128 | |
| 8129 | 8129 | ///An object indicating bin properties, or simply `true` for using default bin parameters. |
| 8130 | 8130 | final dynamic bin; |
| @@ -8132,29 +8132,29 @@ class Transform { | ||
| 8132 | 8132 | ///The data field to bin. |
| 8133 | 8133 | /// |
| 8134 | 8134 | ///The data field to apply time unit. |
| 8135 | - final String? field; | |
| 8135 | + final String field; | |
| 8136 | 8136 | |
| 8137 | 8137 | ///The timeUnit. |
| 8138 | - final TimeUnit? timeUnit; | |
| 8138 | + final TimeUnit timeUnit; | |
| 8139 | 8139 | |
| 8140 | 8140 | ///Array of objects that define fields to aggregate. |
| 8141 | - final List<AggregatedFieldDef>? aggregate; | |
| 8141 | + final List<AggregatedFieldDef> aggregate; | |
| 8142 | 8142 | |
| 8143 | 8143 | ///The data fields to group by. If not specified, a single group containing all data objects |
| 8144 | 8144 | ///will be used. |
| 8145 | 8145 | final List<String>? groupby; |
| 8146 | 8146 | |
| 8147 | 8147 | Transform({ |
| 8148 | - this.filter, | |
| 8148 | + required this.filter, | |
| 8149 | 8149 | this.transformAs, |
| 8150 | - this.calculate, | |
| 8150 | + required this.calculate, | |
| 8151 | 8151 | this.transformDefault, |
| 8152 | - this.from, | |
| 8153 | - this.lookup, | |
| 8154 | - this.bin, | |
| 8155 | - this.field, | |
| 8156 | - this.timeUnit, | |
| 8157 | - this.aggregate, | |
| 8152 | + required this.from, | |
| 8153 | + required this.lookup, | |
| 8154 | + required this.bin, | |
| 8155 | + required this.field, | |
| 8156 | + required this.timeUnit, | |
| 8157 | + required this.aggregate, | |
| 8158 | 8158 | this.groupby, |
| 8159 | 8159 | }); |
| 8160 | 8160 | |
| @@ -8163,12 +8163,12 @@ class Transform { | ||
| 8163 | 8163 | transformAs: json["as"], |
| 8164 | 8164 | calculate: json["calculate"], |
| 8165 | 8165 | transformDefault: json["default"], |
| 8166 | - from: json["from"] == null ? null : LookupData.fromJson(json["from"]), | |
| 8166 | + from: LookupData.fromJson(json["from"]), | |
| 8167 | 8167 | lookup: json["lookup"], |
| 8168 | 8168 | bin: json["bin"], |
| 8169 | 8169 | field: json["field"], |
| 8170 | - timeUnit: timeUnitValues.map[json["timeUnit"]], | |
| 8171 | - aggregate: json["aggregate"] == null ? null : List<AggregatedFieldDef>.from(json["aggregate"]!.map((x) => AggregatedFieldDef.fromJson(x))), | |
| 8170 | + timeUnit: timeUnitValues.map[json["timeUnit"]]!, | |
| 8171 | + aggregate: List<AggregatedFieldDef>.from(json["aggregate"].map((x) => AggregatedFieldDef.fromJson(x))), | |
| 8172 | 8172 | groupby: json["groupby"] == null ? null : List<String>.from(json["groupby"]!.map((x) => x)), |
| 8173 | 8173 | ); |
| 8174 | 8174 | |
| @@ -8177,12 +8177,12 @@ class Transform { | ||
| 8177 | 8177 | "as": transformAs, |
| 8178 | 8178 | "calculate": calculate, |
| 8179 | 8179 | "default": transformDefault, |
| 8180 | - "from": from?.toJson(), | |
| 8180 | + "from": from.toJson(), | |
| 8181 | 8181 | "lookup": lookup, |
| 8182 | 8182 | "bin": bin, |
| 8183 | 8183 | "field": field, |
| 8184 | 8184 | "timeUnit": timeUnitValues.reverse[timeUnit], |
| 8185 | - "aggregate": aggregate == null ? null : List<dynamic>.from(aggregate!.map((x) => x.toJson())), | |
| 8185 | + "aggregate": List<dynamic>.from(aggregate.map((x) => x.toJson())), | |
| 8186 | 8186 | "groupby": groupby == null ? null : List<dynamic>.from(groupby!.map((x) => x)), |
| 8187 | 8187 | }; |
| 8188 | 8188 | } |
Mschema-elixirdefault / QuickType.ex+154 −174
| @@ -1938,12 +1938,13 @@ defmodule ProjectionConfig do | ||
| 1938 | 1938 | end |
| 1939 | 1939 | |
| 1940 | 1940 | defmodule VGScheme do |
| 1941 | + @enforce_keys [:scheme] | |
| 1941 | 1942 | defstruct [:count, :extent, :scheme, :step] |
| 1942 | 1943 | |
| 1943 | 1944 | @type t :: %__MODULE__{ |
| 1944 | 1945 | count: float() | nil, |
| 1945 | 1946 | extent: [float()] | nil, |
| 1946 | - scheme: String.t() | nil, | |
| 1947 | + scheme: String.t(), | |
| 1947 | 1948 | step: float() | nil |
| 1948 | 1949 | } |
| 1949 | 1950 | |
| @@ -2502,13 +2503,13 @@ defmodule MultiSelectionConfig do | ||
| 2502 | 2503 | end |
| 2503 | 2504 | |
| 2504 | 2505 | defmodule VGBinding do |
| 2505 | - @enforce_keys [:input] | |
| 2506 | + @enforce_keys [:input, :options] | |
| 2506 | 2507 | defstruct [:element, :input, :options, :max, :min, :step] |
| 2507 | 2508 | |
| 2508 | 2509 | @type t :: %__MODULE__{ |
| 2509 | 2510 | element: String.t() | nil, |
| 2510 | 2511 | input: String.t(), |
| 2511 | - options: [String.t()] | nil, | |
| 2512 | + options: [String.t()], | |
| 2512 | 2513 | max: float() | nil, |
| 2513 | 2514 | min: float() | nil, |
| 2514 | 2515 | step: float() | nil |
| @@ -3596,7 +3597,7 @@ defmodule ConfigClass do | ||
| 3596 | 3597 | def encode_padding(value) when is_nil(value), do: value |
| 3597 | 3598 | def encode_padding(_), do: {:error, "Unexpected type when encoding ConfigClass.padding"} |
| 3598 | 3599 | |
| 3599 | - def decode_range_value(%{} = value), do: VGScheme.from_map(value) | |
| 3600 | + def decode_range_value(%{"scheme" => _,} = value), do: VGScheme.from_map(value) | |
| 3600 | 3601 | def decode_range_value(value) when is_list(value), do: value |
| 3601 | 3602 | def decode_range_value(_), do: {:error, "Unexpected type when decoding ConfigClass.range"} |
| 3602 | 3603 | |
| @@ -3881,25 +3882,24 @@ defmodule Data do | ||
| 3881 | 3882 | - `:name` - Provide a placeholder name and bind data at runtime. |
| 3882 | 3883 | """ |
| 3883 | 3884 | |
| 3885 | + @enforce_keys [:url, :values, :name] | |
| 3884 | 3886 | defstruct [:format, :url, :values, :name] |
| 3885 | 3887 | |
| 3886 | 3888 | @type t :: %__MODULE__{ |
| 3887 | 3889 | format: DataFormat.t() | nil, |
| 3888 | - url: String.t() | nil, | |
| 3889 | - values: [boolean() | float() | %{String.t() => any()} | String.t()] | %{String.t() => any()} | String.t() | nil, | |
| 3890 | - name: String.t() | nil | |
| 3890 | + url: String.t(), | |
| 3891 | + values: [boolean() | float() | %{String.t() => any()} | String.t()] | %{String.t() => any()} | String.t(), | |
| 3892 | + name: String.t() | |
| 3891 | 3893 | } |
| 3892 | 3894 | |
| 3893 | 3895 | def decode_values(value) when is_binary(value), do: value |
| 3894 | 3896 | def decode_values(value) when is_list(value), do: value |
| 3895 | 3897 | def decode_values(value) when is_map(value), do: value |
| 3896 | - def decode_values(value) when is_nil(value), do: value | |
| 3897 | 3898 | def decode_values(_), do: {:error, "Unexpected type when decoding Data.values"} |
| 3898 | 3899 | |
| 3899 | 3900 | def encode_values(value) when is_binary(value), do: value |
| 3900 | 3901 | def encode_values(value) when is_list(value), do: value |
| 3901 | 3902 | def encode_values(value) when is_map(value), do: value |
| 3902 | - def encode_values(value) when is_nil(value), do: value | |
| 3903 | 3903 | def encode_values(_), do: {:error, "Unexpected type when encoding Data.values"} |
| 3904 | 3904 | |
| 3905 | 3905 | def from_map(m) do |
| @@ -4084,25 +4084,24 @@ defmodule BinParams do | ||
| 4084 | 4084 | end |
| 4085 | 4085 | |
| 4086 | 4086 | defmodule Selection do |
| 4087 | + @enforce_keys [:selection_not, :selection_and, :selection_or] | |
| 4087 | 4088 | defstruct [:selection_not, :selection_and, :selection_or] |
| 4088 | 4089 | |
| 4089 | 4090 | @type t :: %__MODULE__{ |
| 4090 | - selection_not: Selection.t() | String.t() | nil, | |
| 4091 | - selection_and: [Selection.t() | String.t()] | nil, | |
| 4092 | - selection_or: [Selection.t() | String.t()] | nil | |
| 4091 | + selection_not: Selection.t() | String.t(), | |
| 4092 | + selection_and: [Selection.t() | String.t()], | |
| 4093 | + selection_or: [Selection.t() | String.t()] | |
| 4093 | 4094 | } |
| 4094 | 4095 | |
| 4095 | - def decode_selection_not(%{} = value), do: Selection.from_map(value) | |
| 4096 | + def decode_selection_not(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 4096 | 4097 | def decode_selection_not(value) when is_binary(value), do: value |
| 4097 | - def decode_selection_not(value) when is_nil(value), do: value | |
| 4098 | 4098 | def decode_selection_not(_), do: {:error, "Unexpected type when decoding Selection.selection_not"} |
| 4099 | 4099 | |
| 4100 | 4100 | def encode_selection_not(%Selection{} = value), do: Selection.to_map(value) |
| 4101 | 4101 | def encode_selection_not(value) when is_binary(value), do: value |
| 4102 | - def encode_selection_not(value) when is_nil(value), do: value | |
| 4103 | 4102 | def encode_selection_not(_), do: {:error, "Unexpected type when encoding Selection.selection_not"} |
| 4104 | 4103 | |
| 4105 | - def decode_selection_and_element(%{} = value), do: Selection.from_map(value) | |
| 4104 | + def decode_selection_and_element(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 4106 | 4105 | def decode_selection_and_element(value) when is_binary(value), do: value |
| 4107 | 4106 | def decode_selection_and_element(_), do: {:error, "Unexpected type when decoding Selection.selection_and"} |
| 4108 | 4107 | |
| @@ -4110,7 +4109,7 @@ defmodule Selection do | ||
| 4110 | 4109 | def encode_selection_and_element(value) when is_binary(value), do: value |
| 4111 | 4110 | def encode_selection_and_element(_), do: {:error, "Unexpected type when encoding Selection.selection_and"} |
| 4112 | 4111 | |
| 4113 | - def decode_selection_or_element(%{} = value), do: Selection.from_map(value) | |
| 4112 | + def decode_selection_or_element(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 4114 | 4113 | def decode_selection_or_element(value) when is_binary(value), do: value |
| 4115 | 4114 | def decode_selection_or_element(_), do: {:error, "Unexpected type when decoding Selection.selection_or"} |
| 4116 | 4115 | |
| @@ -4121,8 +4120,8 @@ defmodule Selection do | ||
| 4121 | 4120 | def from_map(m) do |
| 4122 | 4121 | %Selection{ |
| 4123 | 4122 | selection_not: decode_selection_not(m["not"]), |
| 4124 | - selection_and: m["and"] && Enum.map(m["and"], &decode_selection_and_element/1), | |
| 4125 | - selection_or: m["or"] && Enum.map(m["or"], &decode_selection_or_element/1), | |
| 4123 | + selection_and: Enum.map(m["and"], &decode_selection_and_element/1), | |
| 4124 | + selection_or: Enum.map(m["or"], &decode_selection_or_element/1), | |
| 4126 | 4125 | } |
| 4127 | 4126 | end |
| 4128 | 4127 | |
| @@ -4333,31 +4332,30 @@ defmodule Predicate do | ||
| 4333 | 4332 | - `:selection` - Filter using a selection name. |
| 4334 | 4333 | """ |
| 4335 | 4334 | |
| 4335 | + @enforce_keys [:predicate_not, :predicate_and, :predicate_or, :equal, :field, :range, :one_of, :selection] | |
| 4336 | 4336 | defstruct [:predicate_not, :predicate_and, :predicate_or, :equal, :field, :time_unit, :range, :one_of, :selection] |
| 4337 | 4337 | |
| 4338 | 4338 | @type t :: %__MODULE__{ |
| 4339 | - predicate_not: Predicate.t() | String.t() | nil, | |
| 4340 | - predicate_and: [Predicate.t() | String.t()] | nil, | |
| 4341 | - predicate_or: [Predicate.t() | String.t()] | nil, | |
| 4342 | - equal: boolean() | DateTimeClass.t() | float() | String.t() | nil, | |
| 4343 | - field: String.t() | nil, | |
| 4339 | + predicate_not: Predicate.t() | String.t(), | |
| 4340 | + predicate_and: [Predicate.t() | String.t()], | |
| 4341 | + predicate_or: [Predicate.t() | String.t()], | |
| 4342 | + equal: boolean() | DateTimeClass.t() | float() | String.t(), | |
| 4343 | + field: String.t(), | |
| 4344 | 4344 | time_unit: TimeUnit.t() | nil, |
| 4345 | - range: [DateTimeClass.t() | float() | nil] | nil, | |
| 4346 | - one_of: [boolean() | DateTimeClass.t() | float() | String.t()] | nil, | |
| 4347 | - selection: Selection.t() | String.t() | nil | |
| 4345 | + range: [DateTimeClass.t() | float() | nil], | |
| 4346 | + one_of: [boolean() | DateTimeClass.t() | float() | String.t()], | |
| 4347 | + selection: Selection.t() | String.t() | |
| 4348 | 4348 | } |
| 4349 | 4349 | |
| 4350 | - def decode_predicate_not(%{} = value), do: Predicate.from_map(value) | |
| 4350 | + def decode_predicate_not(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 4351 | 4351 | def decode_predicate_not(value) when is_binary(value), do: value |
| 4352 | - def decode_predicate_not(value) when is_nil(value), do: value | |
| 4353 | 4352 | def decode_predicate_not(_), do: {:error, "Unexpected type when decoding Predicate.predicate_not"} |
| 4354 | 4353 | |
| 4355 | 4354 | def encode_predicate_not(%Predicate{} = value), do: Predicate.to_map(value) |
| 4356 | 4355 | def encode_predicate_not(value) when is_binary(value), do: value |
| 4357 | - def encode_predicate_not(value) when is_nil(value), do: value | |
| 4358 | 4356 | def encode_predicate_not(_), do: {:error, "Unexpected type when encoding Predicate.predicate_not"} |
| 4359 | 4357 | |
| 4360 | - def decode_predicate_and_element(%{} = value), do: Predicate.from_map(value) | |
| 4358 | + def decode_predicate_and_element(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 4361 | 4359 | def decode_predicate_and_element(value) when is_binary(value), do: value |
| 4362 | 4360 | def decode_predicate_and_element(_), do: {:error, "Unexpected type when decoding Predicate.predicate_and"} |
| 4363 | 4361 | |
| @@ -4365,7 +4363,7 @@ defmodule Predicate do | ||
| 4365 | 4363 | def encode_predicate_and_element(value) when is_binary(value), do: value |
| 4366 | 4364 | def encode_predicate_and_element(_), do: {:error, "Unexpected type when encoding Predicate.predicate_and"} |
| 4367 | 4365 | |
| 4368 | - def decode_predicate_or_element(%{} = value), do: Predicate.from_map(value) | |
| 4366 | + def decode_predicate_or_element(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 4369 | 4367 | def decode_predicate_or_element(value) when is_binary(value), do: value |
| 4370 | 4368 | def decode_predicate_or_element(_), do: {:error, "Unexpected type when decoding Predicate.predicate_or"} |
| 4371 | 4369 | |
| @@ -4378,7 +4376,6 @@ defmodule Predicate do | ||
| 4378 | 4376 | def decode_equal(value) when is_float(value), do: value |
| 4379 | 4377 | def decode_equal(value) when is_integer(value), do: value |
| 4380 | 4378 | def decode_equal(value) when is_binary(value), do: value |
| 4381 | - def decode_equal(value) when is_nil(value), do: value | |
| 4382 | 4379 | def decode_equal(_), do: {:error, "Unexpected type when decoding Predicate.equal"} |
| 4383 | 4380 | |
| 4384 | 4381 | def encode_equal(%DateTimeClass{} = value), do: DateTimeClass.to_map(value) |
| @@ -4386,7 +4383,6 @@ defmodule Predicate do | ||
| 4386 | 4383 | def encode_equal(value) when is_float(value), do: value |
| 4387 | 4384 | def encode_equal(value) when is_integer(value), do: value |
| 4388 | 4385 | def encode_equal(value) when is_binary(value), do: value |
| 4389 | - def encode_equal(value) when is_nil(value), do: value | |
| 4390 | 4386 | def encode_equal(_), do: {:error, "Unexpected type when encoding Predicate.equal"} |
| 4391 | 4387 | |
| 4392 | 4388 | def decode_range_element(%{} = value), do: DateTimeClass.from_map(value) |
| @@ -4415,26 +4411,24 @@ defmodule Predicate do | ||
| 4415 | 4411 | def encode_one_of_element(value) when is_binary(value), do: value |
| 4416 | 4412 | def encode_one_of_element(_), do: {:error, "Unexpected type when encoding Predicate.one_of"} |
| 4417 | 4413 | |
| 4418 | - def decode_selection(%{} = value), do: Selection.from_map(value) | |
| 4414 | + def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 4419 | 4415 | def decode_selection(value) when is_binary(value), do: value |
| 4420 | - def decode_selection(value) when is_nil(value), do: value | |
| 4421 | 4416 | def decode_selection(_), do: {:error, "Unexpected type when decoding Predicate.selection"} |
| 4422 | 4417 | |
| 4423 | 4418 | def encode_selection(%Selection{} = value), do: Selection.to_map(value) |
| 4424 | 4419 | def encode_selection(value) when is_binary(value), do: value |
| 4425 | - def encode_selection(value) when is_nil(value), do: value | |
| 4426 | 4420 | def encode_selection(_), do: {:error, "Unexpected type when encoding Predicate.selection"} |
| 4427 | 4421 | |
| 4428 | 4422 | def from_map(m) do |
| 4429 | 4423 | %Predicate{ |
| 4430 | 4424 | predicate_not: decode_predicate_not(m["not"]), |
| 4431 | - predicate_and: m["and"] && Enum.map(m["and"], &decode_predicate_and_element/1), | |
| 4432 | - predicate_or: m["or"] && Enum.map(m["or"], &decode_predicate_or_element/1), | |
| 4425 | + predicate_and: Enum.map(m["and"], &decode_predicate_and_element/1), | |
| 4426 | + predicate_or: Enum.map(m["or"], &decode_predicate_or_element/1), | |
| 4433 | 4427 | equal: decode_equal(m["equal"]), |
| 4434 | 4428 | field: m["field"], |
| 4435 | 4429 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 4436 | - range: m["range"] && Enum.map(m["range"], &decode_range_element/1), | |
| 4437 | - one_of: m["oneOf"] && Enum.map(m["oneOf"], &decode_one_of_element/1), | |
| 4430 | + range: Enum.map(m["range"], &decode_range_element/1), | |
| 4431 | + one_of: Enum.map(m["oneOf"], &decode_one_of_element/1), | |
| 4438 | 4432 | selection: decode_selection(m["selection"]), |
| 4439 | 4433 | } |
| 4440 | 4434 | end |
| @@ -4472,33 +4466,29 @@ defmodule ConditionalValueDef do | ||
| 4472 | 4466 | - `:selection` - A [selection name](selection.html), or a series of [composedselections](selection.html#compose). |
| 4473 | 4467 | """ |
| 4474 | 4468 | |
| 4475 | - @enforce_keys [:value] | |
| 4469 | + @enforce_keys [:test, :value, :selection] | |
| 4476 | 4470 | defstruct [:test, :value, :selection] |
| 4477 | 4471 | |
| 4478 | 4472 | @type t :: %__MODULE__{ |
| 4479 | - test: Predicate.t() | String.t() | nil, | |
| 4473 | + test: Predicate.t() | String.t(), | |
| 4480 | 4474 | value: boolean() | float() | String.t(), |
| 4481 | - selection: Selection.t() | String.t() | nil | |
| 4475 | + selection: Selection.t() | String.t() | |
| 4482 | 4476 | } |
| 4483 | 4477 | |
| 4484 | - def decode_test(%{} = value), do: Predicate.from_map(value) | |
| 4478 | + def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 4485 | 4479 | def decode_test(value) when is_binary(value), do: value |
| 4486 | - def decode_test(value) when is_nil(value), do: value | |
| 4487 | 4480 | def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalValueDef.test"} |
| 4488 | 4481 | |
| 4489 | 4482 | def encode_test(%Predicate{} = value), do: Predicate.to_map(value) |
| 4490 | 4483 | def encode_test(value) when is_binary(value), do: value |
| 4491 | - def encode_test(value) when is_nil(value), do: value | |
| 4492 | 4484 | def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalValueDef.test"} |
| 4493 | 4485 | |
| 4494 | - def decode_selection(%{} = value), do: Selection.from_map(value) | |
| 4486 | + def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 4495 | 4487 | def decode_selection(value) when is_binary(value), do: value |
| 4496 | - def decode_selection(value) when is_nil(value), do: value | |
| 4497 | 4488 | def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalValueDef.selection"} |
| 4498 | 4489 | |
| 4499 | 4490 | def encode_selection(%Selection{} = value), do: Selection.to_map(value) |
| 4500 | 4491 | def encode_selection(value) when is_binary(value), do: value |
| 4501 | - def encode_selection(value) when is_nil(value), do: value | |
| 4502 | 4492 | def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalValueDef.selection"} |
| 4503 | 4493 | |
| 4504 | 4494 | def from_map(m) do |
| @@ -5456,12 +5446,13 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do | ||
| 5456 | 5446 | - `:type` - The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or`"nominal"`).It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a[geographic projection](projection.html) is applied. |
| 5457 | 5447 | """ |
| 5458 | 5448 | |
| 5449 | + @enforce_keys [:test, :value, :selection, :type] | |
| 5459 | 5450 | defstruct [:test, :value, :selection, :aggregate, :bin, :field, :legend, :scale, :sort, :time_unit, :type] |
| 5460 | 5451 | |
| 5461 | 5452 | @type t :: %__MODULE__{ |
| 5462 | - test: Predicate.t() | String.t() | nil, | |
| 5463 | - value: boolean() | float() | String.t() | nil, | |
| 5464 | - selection: Selection.t() | String.t() | nil, | |
| 5453 | + test: Predicate.t() | String.t(), | |
| 5454 | + value: boolean() | float() | String.t(), | |
| 5455 | + selection: Selection.t() | String.t(), | |
| 5465 | 5456 | aggregate: AggregateOp.t() | nil, |
| 5466 | 5457 | bin: boolean() | BinParams.t() | nil, |
| 5467 | 5458 | field: RepeatRef.t() | String.t() | nil, |
| @@ -5469,27 +5460,23 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do | ||
| 5469 | 5460 | scale: Scale.t() | nil, |
| 5470 | 5461 | sort: SortField.t() | SortEnum.t() | nil | nil, |
| 5471 | 5462 | time_unit: TimeUnit.t() | nil, |
| 5472 | - type: Type.t() | nil | |
| 5463 | + type: Type.t() | |
| 5473 | 5464 | } |
| 5474 | 5465 | |
| 5475 | - def decode_test(%{} = value), do: Predicate.from_map(value) | |
| 5466 | + def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 5476 | 5467 | def decode_test(value) when is_binary(value), do: value |
| 5477 | - def decode_test(value) when is_nil(value), do: value | |
| 5478 | 5468 | def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalPredicateMarkPropFieldDefClass.test"} |
| 5479 | 5469 | |
| 5480 | 5470 | def encode_test(%Predicate{} = value), do: Predicate.to_map(value) |
| 5481 | 5471 | def encode_test(value) when is_binary(value), do: value |
| 5482 | - def encode_test(value) when is_nil(value), do: value | |
| 5483 | 5472 | def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalPredicateMarkPropFieldDefClass.test"} |
| 5484 | 5473 | |
| 5485 | - def decode_selection(%{} = value), do: Selection.from_map(value) | |
| 5474 | + def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 5486 | 5475 | def decode_selection(value) when is_binary(value), do: value |
| 5487 | - def decode_selection(value) when is_nil(value), do: value | |
| 5488 | 5476 | def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalPredicateMarkPropFieldDefClass.selection"} |
| 5489 | 5477 | |
| 5490 | 5478 | def encode_selection(%Selection{} = value), do: Selection.to_map(value) |
| 5491 | 5479 | def encode_selection(value) when is_binary(value), do: value |
| 5492 | - def encode_selection(value) when is_nil(value), do: value | |
| 5493 | 5480 | def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalPredicateMarkPropFieldDefClass.selection"} |
| 5494 | 5481 | |
| 5495 | 5482 | def decode_bin(%{} = value), do: BinParams.from_map(value) |
| @@ -5534,7 +5521,7 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do | ||
| 5534 | 5521 | scale: m["scale"] && Scale.from_map(m["scale"]), |
| 5535 | 5522 | sort: decode_sort(m["sort"]), |
| 5536 | 5523 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 5537 | - type: m["type"] && Type.decode(m["type"]), | |
| 5524 | + type: Type.decode(m["type"]), | |
| 5538 | 5525 | } |
| 5539 | 5526 | end |
| 5540 | 5527 | |
| @@ -5556,7 +5543,7 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do | ||
| 5556 | 5543 | "scale" => struct.scale && Scale.to_map(struct.scale), |
| 5557 | 5544 | "sort" => encode_sort(struct.sort), |
| 5558 | 5545 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 5559 | - "type" => struct.type && Type.encode(struct.type), | |
| 5546 | + "type" => Type.encode(struct.type), | |
| 5560 | 5547 | } |
| 5561 | 5548 | end |
| 5562 | 5549 | |
| @@ -5622,6 +5609,7 @@ defmodule MarkPropDefWithCondition do | ||
| 5622 | 5609 | - `:value` - A constant value in visual domain. |
| 5623 | 5610 | """ |
| 5624 | 5611 | |
| 5612 | + @enforce_keys [:type] | |
| 5625 | 5613 | defstruct [:aggregate, :bin, :condition, :field, :legend, :scale, :sort, :time_unit, :type, :value] |
| 5626 | 5614 | |
| 5627 | 5615 | @type t :: %__MODULE__{ |
| @@ -5633,7 +5621,7 @@ defmodule MarkPropDefWithCondition do | ||
| 5633 | 5621 | scale: Scale.t() | nil, |
| 5634 | 5622 | sort: SortField.t() | SortEnum.t() | nil | nil, |
| 5635 | 5623 | time_unit: TimeUnit.t() | nil, |
| 5636 | - type: Type.t() | nil, | |
| 5624 | + type: Type.t(), | |
| 5637 | 5625 | value: boolean() | float() | String.t() | nil |
| 5638 | 5626 | } |
| 5639 | 5627 | |
| @@ -5647,7 +5635,7 @@ defmodule MarkPropDefWithCondition do | ||
| 5647 | 5635 | def encode_bin(value) when is_nil(value), do: value |
| 5648 | 5636 | def encode_bin(_), do: {:error, "Unexpected type when encoding MarkPropDefWithCondition.bin"} |
| 5649 | 5637 | |
| 5650 | - def decode_condition(%{} = value), do: ConditionalPredicateMarkPropFieldDefClass.from_map(value) | |
| 5638 | + def decode_condition(%{"test" => _,"value" => _,"selection" => _,"type" => _,} = value), do: ConditionalPredicateMarkPropFieldDefClass.from_map(value) | |
| 5651 | 5639 | def decode_condition(value) when is_list(value), do: value |
| 5652 | 5640 | def decode_condition(value) when is_nil(value), do: value |
| 5653 | 5641 | def decode_condition(_), do: {:error, "Unexpected type when decoding MarkPropDefWithCondition.condition"} |
| @@ -5687,7 +5675,7 @@ defmodule MarkPropDefWithCondition do | ||
| 5687 | 5675 | scale: m["scale"] && Scale.from_map(m["scale"]), |
| 5688 | 5676 | sort: decode_sort(m["sort"]), |
| 5689 | 5677 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 5690 | - type: m["type"] && Type.decode(m["type"]), | |
| 5678 | + type: Type.decode(m["type"]), | |
| 5691 | 5679 | value: m["value"], |
| 5692 | 5680 | } |
| 5693 | 5681 | end |
| @@ -5708,7 +5696,7 @@ defmodule MarkPropDefWithCondition do | ||
| 5708 | 5696 | "scale" => struct.scale && Scale.to_map(struct.scale), |
| 5709 | 5697 | "sort" => encode_sort(struct.sort), |
| 5710 | 5698 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 5711 | - "type" => struct.type && Type.encode(struct.type), | |
| 5699 | + "type" => Type.encode(struct.type), | |
| 5712 | 5700 | "value" => struct.value, |
| 5713 | 5701 | } |
| 5714 | 5702 | end |
| @@ -5936,37 +5924,34 @@ defmodule ConditionalPredicateFieldDefClass do | ||
| 5936 | 5924 | - `:type` - The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or`"nominal"`).It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a[geographic projection](projection.html) is applied. |
| 5937 | 5925 | """ |
| 5938 | 5926 | |
| 5927 | + @enforce_keys [:test, :value, :selection, :type] | |
| 5939 | 5928 | defstruct [:test, :value, :selection, :aggregate, :bin, :field, :time_unit, :type] |
| 5940 | 5929 | |
| 5941 | 5930 | @type t :: %__MODULE__{ |
| 5942 | - test: Predicate.t() | String.t() | nil, | |
| 5943 | - value: boolean() | float() | String.t() | nil, | |
| 5944 | - selection: Selection.t() | String.t() | nil, | |
| 5931 | + test: Predicate.t() | String.t(), | |
| 5932 | + value: boolean() | float() | String.t(), | |
| 5933 | + selection: Selection.t() | String.t(), | |
| 5945 | 5934 | aggregate: AggregateOp.t() | nil, |
| 5946 | 5935 | bin: boolean() | BinParams.t() | nil, |
| 5947 | 5936 | field: RepeatRef.t() | String.t() | nil, |
| 5948 | 5937 | time_unit: TimeUnit.t() | nil, |
| 5949 | - type: Type.t() | nil | |
| 5938 | + type: Type.t() | |
| 5950 | 5939 | } |
| 5951 | 5940 | |
| 5952 | - def decode_test(%{} = value), do: Predicate.from_map(value) | |
| 5941 | + def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 5953 | 5942 | def decode_test(value) when is_binary(value), do: value |
| 5954 | - def decode_test(value) when is_nil(value), do: value | |
| 5955 | 5943 | def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalPredicateFieldDefClass.test"} |
| 5956 | 5944 | |
| 5957 | 5945 | def encode_test(%Predicate{} = value), do: Predicate.to_map(value) |
| 5958 | 5946 | def encode_test(value) when is_binary(value), do: value |
| 5959 | - def encode_test(value) when is_nil(value), do: value | |
| 5960 | 5947 | def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalPredicateFieldDefClass.test"} |
| 5961 | 5948 | |
| 5962 | - def decode_selection(%{} = value), do: Selection.from_map(value) | |
| 5949 | + def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 5963 | 5950 | def decode_selection(value) when is_binary(value), do: value |
| 5964 | - def decode_selection(value) when is_nil(value), do: value | |
| 5965 | 5951 | def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalPredicateFieldDefClass.selection"} |
| 5966 | 5952 | |
| 5967 | 5953 | def encode_selection(%Selection{} = value), do: Selection.to_map(value) |
| 5968 | 5954 | def encode_selection(value) when is_binary(value), do: value |
| 5969 | - def encode_selection(value) when is_nil(value), do: value | |
| 5970 | 5955 | def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalPredicateFieldDefClass.selection"} |
| 5971 | 5956 | |
| 5972 | 5957 | def decode_bin(%{} = value), do: BinParams.from_map(value) |
| @@ -5998,7 +5983,7 @@ defmodule ConditionalPredicateFieldDefClass do | ||
| 5998 | 5983 | bin: decode_bin(m["bin"]), |
| 5999 | 5984 | field: decode_field(m["field"]), |
| 6000 | 5985 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 6001 | - type: m["type"] && Type.decode(m["type"]), | |
| 5986 | + type: Type.decode(m["type"]), | |
| 6002 | 5987 | } |
| 6003 | 5988 | end |
| 6004 | 5989 | |
| @@ -6017,7 +6002,7 @@ defmodule ConditionalPredicateFieldDefClass do | ||
| 6017 | 6002 | "bin" => encode_bin(struct.bin), |
| 6018 | 6003 | "field" => encode_field(struct.field), |
| 6019 | 6004 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 6020 | - "type" => struct.type && Type.encode(struct.type), | |
| 6005 | + "type" => Type.encode(struct.type), | |
| 6021 | 6006 | } |
| 6022 | 6007 | end |
| 6023 | 6008 | |
| @@ -6053,6 +6038,7 @@ defmodule DefWithCondition do | ||
| 6053 | 6038 | - `:value` - A constant value in visual domain. |
| 6054 | 6039 | """ |
| 6055 | 6040 | |
| 6041 | + @enforce_keys [:type] | |
| 6056 | 6042 | defstruct [:aggregate, :bin, :condition, :field, :time_unit, :type, :value] |
| 6057 | 6043 | |
| 6058 | 6044 | @type t :: %__MODULE__{ |
| @@ -6061,7 +6047,7 @@ defmodule DefWithCondition do | ||
| 6061 | 6047 | condition: [ConditionalValueDef.t()] | ConditionalPredicateFieldDefClass.t() | nil, |
| 6062 | 6048 | field: RepeatRef.t() | String.t() | nil, |
| 6063 | 6049 | time_unit: TimeUnit.t() | nil, |
| 6064 | - type: Type.t() | nil, | |
| 6050 | + type: Type.t(), | |
| 6065 | 6051 | value: boolean() | float() | String.t() | nil |
| 6066 | 6052 | } |
| 6067 | 6053 | |
| @@ -6075,7 +6061,7 @@ defmodule DefWithCondition do | ||
| 6075 | 6061 | def encode_bin(value) when is_nil(value), do: value |
| 6076 | 6062 | def encode_bin(_), do: {:error, "Unexpected type when encoding DefWithCondition.bin"} |
| 6077 | 6063 | |
| 6078 | - def decode_condition(%{} = value), do: ConditionalPredicateFieldDefClass.from_map(value) | |
| 6064 | + def decode_condition(%{"test" => _,"value" => _,"selection" => _,"type" => _,} = value), do: ConditionalPredicateFieldDefClass.from_map(value) | |
| 6079 | 6065 | def decode_condition(value) when is_list(value), do: value |
| 6080 | 6066 | def decode_condition(value) when is_nil(value), do: value |
| 6081 | 6067 | def decode_condition(_), do: {:error, "Unexpected type when decoding DefWithCondition.condition"} |
| @@ -6102,7 +6088,7 @@ defmodule DefWithCondition do | ||
| 6102 | 6088 | condition: decode_condition(m["condition"]), |
| 6103 | 6089 | field: decode_field(m["field"]), |
| 6104 | 6090 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 6105 | - type: m["type"] && Type.decode(m["type"]), | |
| 6091 | + type: Type.decode(m["type"]), | |
| 6106 | 6092 | value: m["value"], |
| 6107 | 6093 | } |
| 6108 | 6094 | end |
| @@ -6120,7 +6106,7 @@ defmodule DefWithCondition do | ||
| 6120 | 6106 | "condition" => encode_condition(struct.condition), |
| 6121 | 6107 | "field" => encode_field(struct.field), |
| 6122 | 6108 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 6123 | - "type" => struct.type && Type.encode(struct.type), | |
| 6109 | + "type" => Type.encode(struct.type), | |
| 6124 | 6110 | "value" => struct.value, |
| 6125 | 6111 | } |
| 6126 | 6112 | end |
| @@ -6221,38 +6207,35 @@ defmodule ConditionalPredicateTextFieldDefClass do | ||
| 6221 | 6207 | - `:type` - The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or`"nominal"`).It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a[geographic projection](projection.html) is applied. |
| 6222 | 6208 | """ |
| 6223 | 6209 | |
| 6210 | + @enforce_keys [:test, :value, :selection, :type] | |
| 6224 | 6211 | defstruct [:test, :value, :selection, :aggregate, :bin, :field, :format, :time_unit, :type] |
| 6225 | 6212 | |
| 6226 | 6213 | @type t :: %__MODULE__{ |
| 6227 | - test: Predicate.t() | String.t() | nil, | |
| 6228 | - value: boolean() | float() | String.t() | nil, | |
| 6229 | - selection: Selection.t() | String.t() | nil, | |
| 6214 | + test: Predicate.t() | String.t(), | |
| 6215 | + value: boolean() | float() | String.t(), | |
| 6216 | + selection: Selection.t() | String.t(), | |
| 6230 | 6217 | aggregate: AggregateOp.t() | nil, |
| 6231 | 6218 | bin: boolean() | BinParams.t() | nil, |
| 6232 | 6219 | field: RepeatRef.t() | String.t() | nil, |
| 6233 | 6220 | format: String.t() | nil, |
| 6234 | 6221 | time_unit: TimeUnit.t() | nil, |
| 6235 | - type: Type.t() | nil | |
| 6222 | + type: Type.t() | |
| 6236 | 6223 | } |
| 6237 | 6224 | |
| 6238 | - def decode_test(%{} = value), do: Predicate.from_map(value) | |
| 6225 | + def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 6239 | 6226 | def decode_test(value) when is_binary(value), do: value |
| 6240 | - def decode_test(value) when is_nil(value), do: value | |
| 6241 | 6227 | def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalPredicateTextFieldDefClass.test"} |
| 6242 | 6228 | |
| 6243 | 6229 | def encode_test(%Predicate{} = value), do: Predicate.to_map(value) |
| 6244 | 6230 | def encode_test(value) when is_binary(value), do: value |
| 6245 | - def encode_test(value) when is_nil(value), do: value | |
| 6246 | 6231 | def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalPredicateTextFieldDefClass.test"} |
| 6247 | 6232 | |
| 6248 | - def decode_selection(%{} = value), do: Selection.from_map(value) | |
| 6233 | + def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value) | |
| 6249 | 6234 | def decode_selection(value) when is_binary(value), do: value |
| 6250 | - def decode_selection(value) when is_nil(value), do: value | |
| 6251 | 6235 | def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalPredicateTextFieldDefClass.selection"} |
| 6252 | 6236 | |
| 6253 | 6237 | def encode_selection(%Selection{} = value), do: Selection.to_map(value) |
| 6254 | 6238 | def encode_selection(value) when is_binary(value), do: value |
| 6255 | - def encode_selection(value) when is_nil(value), do: value | |
| 6256 | 6239 | def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalPredicateTextFieldDefClass.selection"} |
| 6257 | 6240 | |
| 6258 | 6241 | def decode_bin(%{} = value), do: BinParams.from_map(value) |
| @@ -6285,7 +6268,7 @@ defmodule ConditionalPredicateTextFieldDefClass do | ||
| 6285 | 6268 | field: decode_field(m["field"]), |
| 6286 | 6269 | format: m["format"], |
| 6287 | 6270 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 6288 | - type: m["type"] && Type.decode(m["type"]), | |
| 6271 | + type: Type.decode(m["type"]), | |
| 6289 | 6272 | } |
| 6290 | 6273 | end |
| 6291 | 6274 | |
| @@ -6305,7 +6288,7 @@ defmodule ConditionalPredicateTextFieldDefClass do | ||
| 6305 | 6288 | "field" => encode_field(struct.field), |
| 6306 | 6289 | "format" => struct.format, |
| 6307 | 6290 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 6308 | - "type" => struct.type && Type.encode(struct.type), | |
| 6291 | + "type" => Type.encode(struct.type), | |
| 6309 | 6292 | } |
| 6310 | 6293 | end |
| 6311 | 6294 | |
| @@ -6344,6 +6327,7 @@ defmodule TextDefWithCondition do | ||
| 6344 | 6327 | - `:value` - A constant value in visual domain. |
| 6345 | 6328 | """ |
| 6346 | 6329 | |
| 6330 | + @enforce_keys [:type] | |
| 6347 | 6331 | defstruct [:aggregate, :bin, :condition, :field, :format, :time_unit, :type, :value] |
| 6348 | 6332 | |
| 6349 | 6333 | @type t :: %__MODULE__{ |
| @@ -6353,7 +6337,7 @@ defmodule TextDefWithCondition do | ||
| 6353 | 6337 | field: RepeatRef.t() | String.t() | nil, |
| 6354 | 6338 | format: String.t() | nil, |
| 6355 | 6339 | time_unit: TimeUnit.t() | nil, |
| 6356 | - type: Type.t() | nil, | |
| 6340 | + type: Type.t(), | |
| 6357 | 6341 | value: boolean() | float() | String.t() | nil |
| 6358 | 6342 | } |
| 6359 | 6343 | |
| @@ -6367,7 +6351,7 @@ defmodule TextDefWithCondition do | ||
| 6367 | 6351 | def encode_bin(value) when is_nil(value), do: value |
| 6368 | 6352 | def encode_bin(_), do: {:error, "Unexpected type when encoding TextDefWithCondition.bin"} |
| 6369 | 6353 | |
| 6370 | - def decode_condition(%{} = value), do: ConditionalPredicateTextFieldDefClass.from_map(value) | |
| 6354 | + def decode_condition(%{"test" => _,"value" => _,"selection" => _,"type" => _,} = value), do: ConditionalPredicateTextFieldDefClass.from_map(value) | |
| 6371 | 6355 | def decode_condition(value) when is_list(value), do: value |
| 6372 | 6356 | def decode_condition(value) when is_nil(value), do: value |
| 6373 | 6357 | def decode_condition(_), do: {:error, "Unexpected type when decoding TextDefWithCondition.condition"} |
| @@ -6395,7 +6379,7 @@ defmodule TextDefWithCondition do | ||
| 6395 | 6379 | field: decode_field(m["field"]), |
| 6396 | 6380 | format: m["format"], |
| 6397 | 6381 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 6398 | - type: m["type"] && Type.decode(m["type"]), | |
| 6382 | + type: Type.decode(m["type"]), | |
| 6399 | 6383 | value: m["value"], |
| 6400 | 6384 | } |
| 6401 | 6385 | end |
| @@ -6414,7 +6398,7 @@ defmodule TextDefWithCondition do | ||
| 6414 | 6398 | "field" => encode_field(struct.field), |
| 6415 | 6399 | "format" => struct.format, |
| 6416 | 6400 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 6417 | - "type" => struct.type && Type.encode(struct.type), | |
| 6401 | + "type" => Type.encode(struct.type), | |
| 6418 | 6402 | "value" => struct.value, |
| 6419 | 6403 | } |
| 6420 | 6404 | end |
| @@ -6585,6 +6569,7 @@ defmodule XClass do | ||
| 6585 | 6569 | - `:value` - A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between`0` to `1` for opacity). |
| 6586 | 6570 | """ |
| 6587 | 6571 | |
| 6572 | + @enforce_keys [:type, :value] | |
| 6588 | 6573 | defstruct [:aggregate, :axis, :bin, :field, :scale, :sort, :stack, :time_unit, :type, :value] |
| 6589 | 6574 | |
| 6590 | 6575 | @type t :: %__MODULE__{ |
| @@ -6596,8 +6581,8 @@ defmodule XClass do | ||
| 6596 | 6581 | sort: SortField.t() | SortEnum.t() | nil | nil, |
| 6597 | 6582 | stack: StackOffset.t() | nil | nil, |
| 6598 | 6583 | time_unit: TimeUnit.t() | nil, |
| 6599 | - type: Type.t() | nil, | |
| 6600 | - value: boolean() | float() | String.t() | nil | |
| 6584 | + type: Type.t(), | |
| 6585 | + value: boolean() | float() | String.t() | |
| 6601 | 6586 | } |
| 6602 | 6587 | |
| 6603 | 6588 | def decode_bin(%{} = value), do: BinParams.from_map(value) |
| @@ -6640,7 +6625,7 @@ defmodule XClass do | ||
| 6640 | 6625 | sort: decode_sort(m["sort"]), |
| 6641 | 6626 | stack: m["stack"] && StackOffset.decode(m["stack"]), |
| 6642 | 6627 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 6643 | - type: m["type"] && Type.decode(m["type"]), | |
| 6628 | + type: Type.decode(m["type"]), | |
| 6644 | 6629 | value: m["value"], |
| 6645 | 6630 | } |
| 6646 | 6631 | end |
| @@ -6661,7 +6646,7 @@ defmodule XClass do | ||
| 6661 | 6646 | "sort" => encode_sort(struct.sort), |
| 6662 | 6647 | "stack" => struct.stack && StackOffset.encode(struct.stack), |
| 6663 | 6648 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 6664 | - "type" => struct.type && Type.encode(struct.type), | |
| 6649 | + "type" => Type.encode(struct.type), | |
| 6665 | 6650 | "value" => struct.value, |
| 6666 | 6651 | } |
| 6667 | 6652 | end |
| @@ -6690,6 +6675,7 @@ defmodule X2Class do | ||
| 6690 | 6675 | - `:value` - A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between`0` to `1` for opacity). |
| 6691 | 6676 | """ |
| 6692 | 6677 | |
| 6678 | + @enforce_keys [:type, :value] | |
| 6693 | 6679 | defstruct [:aggregate, :bin, :field, :time_unit, :type, :value] |
| 6694 | 6680 | |
| 6695 | 6681 | @type t :: %__MODULE__{ |
| @@ -6697,8 +6683,8 @@ defmodule X2Class do | ||
| 6697 | 6683 | bin: boolean() | BinParams.t() | nil, |
| 6698 | 6684 | field: RepeatRef.t() | String.t() | nil, |
| 6699 | 6685 | time_unit: TimeUnit.t() | nil, |
| 6700 | - type: Type.t() | nil, | |
| 6701 | - value: boolean() | float() | String.t() | nil | |
| 6686 | + type: Type.t(), | |
| 6687 | + value: boolean() | float() | String.t() | |
| 6702 | 6688 | } |
| 6703 | 6689 | |
| 6704 | 6690 | def decode_bin(%{} = value), do: BinParams.from_map(value) |
| @@ -6727,7 +6713,7 @@ defmodule X2Class do | ||
| 6727 | 6713 | bin: decode_bin(m["bin"]), |
| 6728 | 6714 | field: decode_field(m["field"]), |
| 6729 | 6715 | time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), |
| 6730 | - type: m["type"] && Type.decode(m["type"]), | |
| 6716 | + type: Type.decode(m["type"]), | |
| 6731 | 6717 | value: m["value"], |
| 6732 | 6718 | } |
| 6733 | 6719 | end |
| @@ -6744,7 +6730,7 @@ defmodule X2Class do | ||
| 6744 | 6730 | "bin" => encode_bin(struct.bin), |
| 6745 | 6731 | "field" => encode_field(struct.field), |
| 6746 | 6732 | "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), |
| 6747 | - "type" => struct.type && Type.encode(struct.type), | |
| 6733 | + "type" => Type.encode(struct.type), | |
| 6748 | 6734 | "value" => struct.value, |
| 6749 | 6735 | } |
| 6750 | 6736 | end |
| @@ -7890,30 +7876,29 @@ defmodule Transform do | ||
| 7890 | 7876 | - `:groupby` - The data fields to group by. If not specified, a single group containing all data objectswill be used. |
| 7891 | 7877 | """ |
| 7892 | 7878 | |
| 7879 | + @enforce_keys [:filter, :calculate, :from, :lookup, :bin, :field, :time_unit, :aggregate] | |
| 7893 | 7880 | defstruct [:filter, :as, :calculate, :default, :from, :lookup, :bin, :field, :time_unit, :aggregate, :groupby] |
| 7894 | 7881 | |
| 7895 | 7882 | @type t :: %__MODULE__{ |
| 7896 | - filter: Predicate.t() | String.t() | nil, | |
| 7883 | + filter: Predicate.t() | String.t(), | |
| 7897 | 7884 | as: [String.t()] | String.t() | nil, |
| 7898 | - calculate: String.t() | nil, | |
| 7885 | + calculate: String.t(), | |
| 7899 | 7886 | default: String.t() | nil, |
| 7900 | - from: LookupData.t() | nil, | |
| 7901 | - lookup: String.t() | nil, | |
| 7902 | - bin: boolean() | BinParams.t() | nil, | |
| 7903 | - field: String.t() | nil, | |
| 7904 | - time_unit: TimeUnit.t() | nil, | |
| 7905 | - aggregate: [AggregatedFieldDef.t()] | nil, | |
| 7887 | + from: LookupData.t(), | |
| 7888 | + lookup: String.t(), | |
| 7889 | + bin: boolean() | BinParams.t(), | |
| 7890 | + field: String.t(), | |
| 7891 | + time_unit: TimeUnit.t(), | |
| 7892 | + aggregate: [AggregatedFieldDef.t()], | |
| 7906 | 7893 | groupby: [String.t()] | nil |
| 7907 | 7894 | } |
| 7908 | 7895 | |
| 7909 | - def decode_filter(%{} = value), do: Predicate.from_map(value) | |
| 7896 | + def decode_filter(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value) | |
| 7910 | 7897 | def decode_filter(value) when is_binary(value), do: value |
| 7911 | - def decode_filter(value) when is_nil(value), do: value | |
| 7912 | 7898 | def decode_filter(_), do: {:error, "Unexpected type when decoding Transform.filter"} |
| 7913 | 7899 | |
| 7914 | 7900 | def encode_filter(%Predicate{} = value), do: Predicate.to_map(value) |
| 7915 | 7901 | def encode_filter(value) when is_binary(value), do: value |
| 7916 | - def encode_filter(value) when is_nil(value), do: value | |
| 7917 | 7902 | def encode_filter(_), do: {:error, "Unexpected type when encoding Transform.filter"} |
| 7918 | 7903 | |
| 7919 | 7904 | def decode_as(value) when is_binary(value), do: value |
| @@ -7928,12 +7913,10 @@ defmodule Transform do | ||
| 7928 | 7913 | |
| 7929 | 7914 | def decode_bin(%{} = value), do: BinParams.from_map(value) |
| 7930 | 7915 | def decode_bin(value) when is_boolean(value), do: value |
| 7931 | - def decode_bin(value) when is_nil(value), do: value | |
| 7932 | 7916 | def decode_bin(_), do: {:error, "Unexpected type when decoding Transform.bin"} |
| 7933 | 7917 | |
| 7934 | 7918 | def encode_bin(%BinParams{} = value), do: BinParams.to_map(value) |
| 7935 | 7919 | def encode_bin(value) when is_boolean(value), do: value |
| 7936 | - def encode_bin(value) when is_nil(value), do: value | |
| 7937 | 7920 | def encode_bin(_), do: {:error, "Unexpected type when encoding Transform.bin"} |
| 7938 | 7921 | |
| 7939 | 7922 | def from_map(m) do |
| @@ -7942,12 +7925,12 @@ defmodule Transform do | ||
| 7942 | 7925 | as: decode_as(m["as"]), |
| 7943 | 7926 | calculate: m["calculate"], |
| 7944 | 7927 | default: m["default"], |
| 7945 | - from: m["from"] && LookupData.from_map(m["from"]), | |
| 7928 | + from: LookupData.from_map(m["from"]), | |
| 7946 | 7929 | lookup: m["lookup"], |
| 7947 | 7930 | bin: decode_bin(m["bin"]), |
| 7948 | 7931 | field: m["field"], |
| 7949 | - time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]), | |
| 7950 | - aggregate: m["aggregate"] && Enum.map(m["aggregate"], &AggregatedFieldDef.from_map/1), | |
| 7932 | + time_unit: TimeUnit.decode(m["timeUnit"]), | |
| 7933 | + aggregate: Enum.map(m["aggregate"], &AggregatedFieldDef.from_map/1), | |
| 7951 | 7934 | groupby: m["groupby"], |
| 7952 | 7935 | } |
| 7953 | 7936 | end |
| @@ -7964,11 +7947,11 @@ defmodule Transform do | ||
| 7964 | 7947 | "as" => encode_as(struct.as), |
| 7965 | 7948 | "calculate" => struct.calculate, |
| 7966 | 7949 | "default" => struct.default, |
| 7967 | - "from" => struct.from && LookupData.to_map(struct.from), | |
| 7950 | + "from" => LookupData.to_map(struct.from), | |
| 7968 | 7951 | "lookup" => struct.lookup, |
| 7969 | 7952 | "bin" => encode_bin(struct.bin), |
| 7970 | 7953 | "field" => struct.field, |
| 7971 | - "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit), | |
| 7954 | + "timeUnit" => TimeUnit.encode(struct.time_unit), | |
| 7972 | 7955 | "aggregate" => struct.aggregate && Enum.map(struct.aggregate, &AggregatedFieldDef.to_map/1), |
| 7973 | 7956 | "groupby" => struct.groupby, |
| 7974 | 7957 | } |
| @@ -7999,20 +7982,21 @@ defmodule LayerSpec do | ||
| 7999 | 7982 | - `:selection` - A key-value mapping between selection names and definitions. |
| 8000 | 7983 | """ |
| 8001 | 7984 | |
| 7985 | + @enforce_keys [:layer, :encoding, :mark] | |
| 8002 | 7986 | defstruct [:data, :description, :height, :layer, :name, :resolve, :title, :transform, :width, :encoding, :mark, :projection, :selection] |
| 8003 | 7987 | |
| 8004 | 7988 | @type t :: %__MODULE__{ |
| 8005 | 7989 | data: Data.t() | nil, |
| 8006 | 7990 | description: String.t() | nil, |
| 8007 | 7991 | height: float() | nil, |
| 8008 | - layer: [LayerSpec.t()] | nil, | |
| 7992 | + layer: [LayerSpec.t()], | |
| 8009 | 7993 | name: String.t() | nil, |
| 8010 | 7994 | resolve: Resolve.t() | nil, |
| 8011 | 7995 | title: TitleParams.t() | String.t() | nil, |
| 8012 | 7996 | transform: [Transform.t()] | nil, |
| 8013 | 7997 | width: float() | nil, |
| 8014 | - encoding: Encoding.t() | nil, | |
| 8015 | - mark: MarkDef.t() | Mark.t() | nil, | |
| 7998 | + encoding: Encoding.t(), | |
| 7999 | + mark: MarkDef.t() | Mark.t(), | |
| 8016 | 8000 | projection: Projection.t() | nil, |
| 8017 | 8001 | selection: %{String.t() => SelectionDef.t()} | nil |
| 8018 | 8002 | } |
| @@ -8029,12 +8013,10 @@ defmodule LayerSpec do | ||
| 8029 | 8013 | |
| 8030 | 8014 | def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value) |
| 8031 | 8015 | def decode_mark(value) when is_binary(value), do: Mark.decode(value) |
| 8032 | - def decode_mark(value) when is_nil(value), do: value | |
| 8033 | 8016 | def decode_mark(_), do: {:error, "Unexpected type when decoding LayerSpec.mark"} |
| 8034 | 8017 | |
| 8035 | 8018 | def encode_mark(%MarkDef{} = value), do: MarkDef.to_map(value) |
| 8036 | 8019 | def encode_mark(value) when is_atom(value), do: Mark.encode(value) |
| 8037 | - def encode_mark(value) when is_nil(value), do: value | |
| 8038 | 8020 | def encode_mark(_), do: {:error, "Unexpected type when encoding LayerSpec.mark"} |
| 8039 | 8021 | |
| 8040 | 8022 | def from_map(m) do |
| @@ -8042,13 +8024,13 @@ defmodule LayerSpec do | ||
| 8042 | 8024 | data: m["data"] && Data.from_map(m["data"]), |
| 8043 | 8025 | description: m["description"], |
| 8044 | 8026 | height: m["height"], |
| 8045 | - layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1), | |
| 8027 | + layer: Enum.map(m["layer"], &LayerSpec.from_map/1), | |
| 8046 | 8028 | name: m["name"], |
| 8047 | 8029 | resolve: m["resolve"] && Resolve.from_map(m["resolve"]), |
| 8048 | 8030 | title: decode_title(m["title"]), |
| 8049 | 8031 | transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1), |
| 8050 | 8032 | width: m["width"], |
| 8051 | - encoding: m["encoding"] && Encoding.from_map(m["encoding"]), | |
| 8033 | + encoding: Encoding.from_map(m["encoding"]), | |
| 8052 | 8034 | mark: decode_mark(m["mark"]), |
| 8053 | 8035 | projection: m["projection"] && Projection.from_map(m["projection"]), |
| 8054 | 8036 | selection: m["selection"] |
| @@ -8073,7 +8055,7 @@ defmodule LayerSpec do | ||
| 8073 | 8055 | "title" => encode_title(struct.title), |
| 8074 | 8056 | "transform" => struct.transform && Enum.map(struct.transform, &Transform.to_map/1), |
| 8075 | 8057 | "width" => struct.width, |
| 8076 | - "encoding" => struct.encoding && Encoding.to_map(struct.encoding), | |
| 8058 | + "encoding" => Encoding.to_map(struct.encoding), | |
| 8077 | 8059 | "mark" => encode_mark(struct.mark), |
| 8078 | 8060 | "projection" => struct.projection && Projection.to_map(struct.projection), |
| 8079 | 8061 | "selection" => struct.selection |
| @@ -8153,27 +8135,28 @@ defmodule Spec do | ||
| 8153 | 8135 | - `:hconcat` - A list of views that should be concatenated and put into a row. |
| 8154 | 8136 | """ |
| 8155 | 8137 | |
| 8138 | + @enforce_keys [:layer, :encoding, :mark, :facet, :spec, :repeat, :vconcat, :hconcat] | |
| 8156 | 8139 | defstruct [:data, :description, :height, :layer, :name, :resolve, :title, :transform, :width, :encoding, :mark, :projection, :selection, :facet, :spec, :repeat, :vconcat, :hconcat] |
| 8157 | 8140 | |
| 8158 | 8141 | @type t :: %__MODULE__{ |
| 8159 | 8142 | data: Data.t() | nil, |
| 8160 | 8143 | description: String.t() | nil, |
| 8161 | 8144 | height: float() | nil, |
| 8162 | - layer: [LayerSpec.t()] | nil, | |
| 8145 | + layer: [LayerSpec.t()], | |
| 8163 | 8146 | name: String.t() | nil, |
| 8164 | 8147 | resolve: Resolve.t() | nil, |
| 8165 | 8148 | title: TitleParams.t() | String.t() | nil, |
| 8166 | 8149 | transform: [Transform.t()] | nil, |
| 8167 | 8150 | width: float() | nil, |
| 8168 | - encoding: Encoding.t() | nil, | |
| 8169 | - mark: MarkDef.t() | Mark.t() | nil, | |
| 8151 | + encoding: Encoding.t(), | |
| 8152 | + mark: MarkDef.t() | Mark.t(), | |
| 8170 | 8153 | projection: Projection.t() | nil, |
| 8171 | 8154 | selection: %{String.t() => SelectionDef.t()} | nil, |
| 8172 | - facet: FacetMapping.t() | nil, | |
| 8173 | - spec: Spec.t() | nil, | |
| 8174 | - repeat: Repeat.t() | nil, | |
| 8175 | - vconcat: [Spec.t()] | nil, | |
| 8176 | - hconcat: [Spec.t()] | nil | |
| 8155 | + facet: FacetMapping.t(), | |
| 8156 | + spec: Spec.t(), | |
| 8157 | + repeat: Repeat.t(), | |
| 8158 | + vconcat: [Spec.t()], | |
| 8159 | + hconcat: [Spec.t()] | |
| 8177 | 8160 | } |
| 8178 | 8161 | |
| 8179 | 8162 | def decode_title(%{"text" => _,} = value), do: TitleParams.from_map(value) |
| @@ -8188,12 +8171,10 @@ defmodule Spec do | ||
| 8188 | 8171 | |
| 8189 | 8172 | def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value) |
| 8190 | 8173 | def decode_mark(value) when is_binary(value), do: Mark.decode(value) |
| 8191 | - def decode_mark(value) when is_nil(value), do: value | |
| 8192 | 8174 | def decode_mark(_), do: {:error, "Unexpected type when decoding Spec.mark"} |
| 8193 | 8175 | |
| 8194 | 8176 | def encode_mark(%MarkDef{} = value), do: MarkDef.to_map(value) |
| 8195 | 8177 | def encode_mark(value) when is_atom(value), do: Mark.encode(value) |
| 8196 | - def encode_mark(value) when is_nil(value), do: value | |
| 8197 | 8178 | def encode_mark(_), do: {:error, "Unexpected type when encoding Spec.mark"} |
| 8198 | 8179 | |
| 8199 | 8180 | def from_map(m) do |
| @@ -8201,22 +8182,22 @@ defmodule Spec do | ||
| 8201 | 8182 | data: m["data"] && Data.from_map(m["data"]), |
| 8202 | 8183 | description: m["description"], |
| 8203 | 8184 | height: m["height"], |
| 8204 | - layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1), | |
| 8185 | + layer: Enum.map(m["layer"], &LayerSpec.from_map/1), | |
| 8205 | 8186 | name: m["name"], |
| 8206 | 8187 | resolve: m["resolve"] && Resolve.from_map(m["resolve"]), |
| 8207 | 8188 | title: decode_title(m["title"]), |
| 8208 | 8189 | transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1), |
| 8209 | 8190 | width: m["width"], |
| 8210 | - encoding: m["encoding"] && Encoding.from_map(m["encoding"]), | |
| 8191 | + encoding: Encoding.from_map(m["encoding"]), | |
| 8211 | 8192 | mark: decode_mark(m["mark"]), |
| 8212 | 8193 | projection: m["projection"] && Projection.from_map(m["projection"]), |
| 8213 | 8194 | selection: m["selection"] |
| 8214 | 8195 | |> Map.new(fn {key, value} -> {key, SelectionDef.from_map(value)} end), |
| 8215 | - facet: m["facet"] && FacetMapping.from_map(m["facet"]), | |
| 8216 | - spec: m["spec"] && Spec.from_map(m["spec"]), | |
| 8217 | - repeat: m["repeat"] && Repeat.from_map(m["repeat"]), | |
| 8218 | - vconcat: m["vconcat"] && Enum.map(m["vconcat"], &Spec.from_map/1), | |
| 8219 | - hconcat: m["hconcat"] && Enum.map(m["hconcat"], &Spec.from_map/1), | |
| 8196 | + facet: FacetMapping.from_map(m["facet"]), | |
| 8197 | + spec: Spec.from_map(m["spec"]), | |
| 8198 | + repeat: Repeat.from_map(m["repeat"]), | |
| 8199 | + vconcat: Enum.map(m["vconcat"], &Spec.from_map/1), | |
| 8200 | + hconcat: Enum.map(m["hconcat"], &Spec.from_map/1), | |
| 8220 | 8201 | } |
| 8221 | 8202 | end |
| 8222 | 8203 | |
| @@ -8237,14 +8218,14 @@ defmodule Spec do | ||
| 8237 | 8218 | "title" => encode_title(struct.title), |
| 8238 | 8219 | "transform" => struct.transform && Enum.map(struct.transform, &Transform.to_map/1), |
| 8239 | 8220 | "width" => struct.width, |
| 8240 | - "encoding" => struct.encoding && Encoding.to_map(struct.encoding), | |
| 8221 | + "encoding" => Encoding.to_map(struct.encoding), | |
| 8241 | 8222 | "mark" => encode_mark(struct.mark), |
| 8242 | 8223 | "projection" => struct.projection && Projection.to_map(struct.projection), |
| 8243 | 8224 | "selection" => struct.selection |
| 8244 | 8225 | |> Map.new(fn {key, value} -> {key, SelectionDef.to_map(value)} end), |
| 8245 | - "facet" => struct.facet && FacetMapping.to_map(struct.facet), | |
| 8246 | - "spec" => struct.spec && Spec.to_map(struct.spec), | |
| 8247 | - "repeat" => struct.repeat && Repeat.to_map(struct.repeat), | |
| 8226 | + "facet" => FacetMapping.to_map(struct.facet), | |
| 8227 | + "spec" => Spec.to_map(struct.spec), | |
| 8228 | + "repeat" => Repeat.to_map(struct.repeat), | |
| 8248 | 8229 | "vconcat" => struct.vconcat && Enum.map(struct.vconcat, &Spec.to_map/1), |
| 8249 | 8230 | "hconcat" => struct.hconcat && Enum.map(struct.hconcat, &Spec.to_map/1), |
| 8250 | 8231 | } |
| @@ -8284,6 +8265,7 @@ defmodule TopLevel do | ||
| 8284 | 8265 | - `:hconcat` - A list of views that should be concatenated and put into a row. |
| 8285 | 8266 | """ |
| 8286 | 8267 | |
| 8268 | + @enforce_keys [:encoding, :mark, :layer, :facet, :spec, :repeat, :vconcat, :hconcat] | |
| 8287 | 8269 | defstruct [:schema, :autosize, :background, :config, :data, :description, :encoding, :height, :mark, :name, :padding, :projection, :selection, :title, :transform, :width, :layer, :resolve, :facet, :spec, :repeat, :vconcat, :hconcat] |
| 8288 | 8270 | |
| 8289 | 8271 | @type t :: %__MODULE__{ |
| @@ -8293,9 +8275,9 @@ defmodule TopLevel do | ||
| 8293 | 8275 | config: ConfigClass.t() | nil, |
| 8294 | 8276 | data: Data.t() | nil, |
| 8295 | 8277 | description: String.t() | nil, |
| 8296 | - encoding: EncodingWithFacet.t() | nil, | |
| 8278 | + encoding: EncodingWithFacet.t(), | |
| 8297 | 8279 | height: float() | nil, |
| 8298 | - mark: MarkDef.t() | Mark.t() | nil, | |
| 8280 | + mark: MarkDef.t() | Mark.t(), | |
| 8299 | 8281 | name: String.t() | nil, |
| 8300 | 8282 | padding: PaddingClass.t() | float() | nil, |
| 8301 | 8283 | projection: Projection.t() | nil, |
| @@ -8303,13 +8285,13 @@ defmodule TopLevel do | ||
| 8303 | 8285 | title: TitleParams.t() | String.t() | nil, |
| 8304 | 8286 | transform: [Transform.t()] | nil, |
| 8305 | 8287 | width: float() | nil, |
| 8306 | - layer: [LayerSpec.t()] | nil, | |
| 8288 | + layer: [LayerSpec.t()], | |
| 8307 | 8289 | resolve: Resolve.t() | nil, |
| 8308 | - facet: FacetMapping.t() | nil, | |
| 8309 | - spec: Spec.t() | nil, | |
| 8310 | - repeat: Repeat.t() | nil, | |
| 8311 | - vconcat: [Spec.t()] | nil, | |
| 8312 | - hconcat: [Spec.t()] | nil | |
| 8290 | + facet: FacetMapping.t(), | |
| 8291 | + spec: Spec.t(), | |
| 8292 | + repeat: Repeat.t(), | |
| 8293 | + vconcat: [Spec.t()], | |
| 8294 | + hconcat: [Spec.t()] | |
| 8313 | 8295 | } |
| 8314 | 8296 | |
| 8315 | 8297 | def decode_autosize(%{} = value), do: AutoSizeParams.from_map(value) |
| @@ -8324,12 +8306,10 @@ defmodule TopLevel do | ||
| 8324 | 8306 | |
| 8325 | 8307 | def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value) |
| 8326 | 8308 | def decode_mark(value) when is_binary(value), do: Mark.decode(value) |
| 8327 | - def decode_mark(value) when is_nil(value), do: value | |
| 8328 | 8309 | def decode_mark(_), do: {:error, "Unexpected type when decoding TopLevel.mark"} |
| 8329 | 8310 | |
| 8330 | 8311 | def encode_mark(%MarkDef{} = value), do: MarkDef.to_map(value) |
| 8331 | 8312 | def encode_mark(value) when is_atom(value), do: Mark.encode(value) |
| 8332 | - def encode_mark(value) when is_nil(value), do: value | |
| 8333 | 8313 | def encode_mark(_), do: {:error, "Unexpected type when encoding TopLevel.mark"} |
| 8334 | 8314 | |
| 8335 | 8315 | def decode_padding(%{} = value), do: PaddingClass.from_map(value) |
| @@ -8362,7 +8342,7 @@ defmodule TopLevel do | ||
| 8362 | 8342 | config: m["config"] && ConfigClass.from_map(m["config"]), |
| 8363 | 8343 | data: m["data"] && Data.from_map(m["data"]), |
| 8364 | 8344 | description: m["description"], |
| 8365 | - encoding: m["encoding"] && EncodingWithFacet.from_map(m["encoding"]), | |
| 8345 | + encoding: EncodingWithFacet.from_map(m["encoding"]), | |
| 8366 | 8346 | height: m["height"], |
| 8367 | 8347 | mark: decode_mark(m["mark"]), |
| 8368 | 8348 | name: m["name"], |
| @@ -8373,13 +8353,13 @@ defmodule TopLevel do | ||
| 8373 | 8353 | title: decode_title(m["title"]), |
| 8374 | 8354 | transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1), |
| 8375 | 8355 | width: m["width"], |
| 8376 | - layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1), | |
| 8356 | + layer: Enum.map(m["layer"], &LayerSpec.from_map/1), | |
| 8377 | 8357 | resolve: m["resolve"] && Resolve.from_map(m["resolve"]), |
| 8378 | - facet: m["facet"] && FacetMapping.from_map(m["facet"]), | |
| 8379 | - spec: m["spec"] && Spec.from_map(m["spec"]), | |
| 8380 | - repeat: m["repeat"] && Repeat.from_map(m["repeat"]), | |
| 8381 | - vconcat: m["vconcat"] && Enum.map(m["vconcat"], &Spec.from_map/1), | |
| 8382 | - hconcat: m["hconcat"] && Enum.map(m["hconcat"], &Spec.from_map/1), | |
| 8358 | + facet: FacetMapping.from_map(m["facet"]), | |
| 8359 | + spec: Spec.from_map(m["spec"]), | |
| 8360 | + repeat: Repeat.from_map(m["repeat"]), | |
| 8361 | + vconcat: Enum.map(m["vconcat"], &Spec.from_map/1), | |
| 8362 | + hconcat: Enum.map(m["hconcat"], &Spec.from_map/1), | |
| 8383 | 8363 | } |
| 8384 | 8364 | end |
| 8385 | 8365 | |
| @@ -8397,7 +8377,7 @@ defmodule TopLevel do | ||
| 8397 | 8377 | "config" => struct.config && ConfigClass.to_map(struct.config), |
| 8398 | 8378 | "data" => struct.data && Data.to_map(struct.data), |
| 8399 | 8379 | "description" => struct.description, |
| 8400 | - "encoding" => struct.encoding && EncodingWithFacet.to_map(struct.encoding), | |
| 8380 | + "encoding" => EncodingWithFacet.to_map(struct.encoding), | |
| 8401 | 8381 | "height" => struct.height, |
| 8402 | 8382 | "mark" => encode_mark(struct.mark), |
| 8403 | 8383 | "name" => struct.name, |
| @@ -8410,9 +8390,9 @@ defmodule TopLevel do | ||
| 8410 | 8390 | "width" => struct.width, |
| 8411 | 8391 | "layer" => struct.layer && Enum.map(struct.layer, &LayerSpec.to_map/1), |
| 8412 | 8392 | "resolve" => struct.resolve && Resolve.to_map(struct.resolve), |
| 8413 | - "facet" => struct.facet && FacetMapping.to_map(struct.facet), | |
| 8414 | - "spec" => struct.spec && Spec.to_map(struct.spec), | |
| 8415 | - "repeat" => struct.repeat && Repeat.to_map(struct.repeat), | |
| 8393 | + "facet" => FacetMapping.to_map(struct.facet), | |
| 8394 | + "spec" => Spec.to_map(struct.spec), | |
| 8395 | + "repeat" => Repeat.to_map(struct.repeat), | |
| 8416 | 8396 | "vconcat" => struct.vconcat && Enum.map(struct.vconcat, &Spec.to_map/1), |
| 8417 | 8397 | "hconcat" => struct.hconcat && Enum.map(struct.hconcat, &Spec.to_map/1), |
| 8418 | 8398 | } |
Mschema-flowdefault / TopLevel.js+130 −130
| @@ -49,7 +49,7 @@ export type TopLevel = { | ||
| 49 | 49 | /** |
| 50 | 50 | * A key-value mapping between encoding channels and definition of fields. |
| 51 | 51 | */ |
| 52 | - encoding?: EncodingWithFacet; | |
| 52 | + encoding: EncodingWithFacet; | |
| 53 | 53 | /** |
| 54 | 54 | * The height of a visualization. |
| 55 | 55 | * |
| @@ -76,7 +76,7 @@ export type TopLevel = { | ||
| 76 | 76 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 77 | 77 | * object](mark.html#mark-def). |
| 78 | 78 | */ |
| 79 | - mark?: AnyMark; | |
| 79 | + mark: AnyMark; | |
| 80 | 80 | /** |
| 81 | 81 | * Name of the visualization for later reference. |
| 82 | 82 | */ |
| @@ -138,7 +138,7 @@ export type TopLevel = { | ||
| 138 | 138 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 139 | 139 | * layering facet specifications is not allowed. |
| 140 | 140 | */ |
| 141 | - layer?: LayerSpec[]; | |
| 141 | + layer: LayerSpec[]; | |
| 142 | 142 | /** |
| 143 | 143 | * Scale, axis, and legend resolutions for layers. |
| 144 | 144 | * |
| @@ -155,24 +155,24 @@ export type TopLevel = { | ||
| 155 | 155 | * An object that describes mappings between `row` and `column` channels and their field |
| 156 | 156 | * definitions. |
| 157 | 157 | */ |
| 158 | - facet?: FacetMapping; | |
| 158 | + facet: FacetMapping; | |
| 159 | 159 | /** |
| 160 | 160 | * A specification of the view that gets faceted. |
| 161 | 161 | */ |
| 162 | - spec?: Spec; | |
| 162 | + spec: Spec; | |
| 163 | 163 | /** |
| 164 | 164 | * An object that describes what fields should be repeated into views that are laid out as a |
| 165 | 165 | * `row` or `column`. |
| 166 | 166 | */ |
| 167 | - repeat?: Repeat; | |
| 167 | + repeat: Repeat; | |
| 168 | 168 | /** |
| 169 | 169 | * A list of views that should be concatenated and put into a column. |
| 170 | 170 | */ |
| 171 | - vconcat?: Spec[]; | |
| 171 | + vconcat: Spec[]; | |
| 172 | 172 | /** |
| 173 | 173 | * A list of views that should be concatenated and put into a row. |
| 174 | 174 | */ |
| 175 | - hconcat?: Spec[]; | |
| 175 | + hconcat: Spec[]; | |
| 176 | 176 | }; |
| 177 | 177 | |
| 178 | 178 | /** |
| @@ -1827,8 +1827,8 @@ export type RangeConfigValue = TitleFontWeight[] | RangeConfigValueVGScheme; | ||
| 1827 | 1827 | export type RangeConfigValueVGScheme = { |
| 1828 | 1828 | count?: number; |
| 1829 | 1829 | extent?: number[]; |
| 1830 | - scheme?: string; | |
| 1831 | - step?: number; | |
| 1830 | + scheme: string; | |
| 1831 | + step: number; | |
| 1832 | 1832 | }; |
| 1833 | 1833 | |
| 1834 | 1834 | /** |
| @@ -2295,7 +2295,7 @@ export type SingleSelectionConfig = { | ||
| 2295 | 2295 | export type VGBinding = { |
| 2296 | 2296 | element?: string; |
| 2297 | 2297 | input: string; |
| 2298 | - options?: string[]; | |
| 2298 | + options: string[]; | |
| 2299 | 2299 | max?: number; |
| 2300 | 2300 | min?: number; |
| 2301 | 2301 | step?: number; |
| @@ -3052,18 +3052,18 @@ export type Data = { | ||
| 3052 | 3052 | * An URL from which to load the data set. Use the `format.type` property |
| 3053 | 3053 | * to ensure the loaded data is correctly parsed. |
| 3054 | 3054 | */ |
| 3055 | - url?: string; | |
| 3055 | + url: string; | |
| 3056 | 3056 | /** |
| 3057 | 3057 | * The full data set, included inline. This can be an array of objects or primitive values |
| 3058 | 3058 | * or a string. |
| 3059 | 3059 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3060 | 3060 | * parsed according to the specified format type. |
| 3061 | 3061 | */ |
| 3062 | - values?: Values; | |
| 3062 | + values: Values; | |
| 3063 | 3063 | /** |
| 3064 | 3064 | * Provide a placeholder name and bind data at runtime. |
| 3065 | 3065 | */ |
| 3066 | - name?: string; | |
| 3066 | + name: string; | |
| 3067 | 3067 | }; |
| 3068 | 3068 | |
| 3069 | 3069 | /** |
| @@ -3362,7 +3362,7 @@ export type MarkPropDefWithCondition = { | ||
| 3362 | 3362 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3363 | 3363 | * [geographic projection](projection.html) is applied. |
| 3364 | 3364 | */ |
| 3365 | - type?: Type; | |
| 3365 | + type: Type; | |
| 3366 | 3366 | /** |
| 3367 | 3367 | * A constant value in visual domain. |
| 3368 | 3368 | */ |
| @@ -3468,7 +3468,7 @@ export type BinParams = { | ||
| 3468 | 3468 | export type ColorCondition = ConditionalValueDef[] | ConditionalPredicateMarkPropFieldDefClass; |
| 3469 | 3469 | |
| 3470 | 3470 | export type ConditionalValueDef = { |
| 3471 | - test?: LogicalOperandPredicate; | |
| 3471 | + test: LogicalOperandPredicate; | |
| 3472 | 3472 | /** |
| 3473 | 3473 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 3474 | 3474 | * `0` to `1` for opacity). |
| @@ -3478,13 +3478,13 @@ export type ConditionalValueDef = { | ||
| 3478 | 3478 | * A [selection name](selection.html), or a series of [composed |
| 3479 | 3479 | * selections](selection.html#compose). |
| 3480 | 3480 | */ |
| 3481 | - selection?: SelectionOperand; | |
| 3481 | + selection: SelectionOperand; | |
| 3482 | 3482 | }; |
| 3483 | 3483 | |
| 3484 | 3484 | export type Selection = { |
| 3485 | - not?: SelectionOperand; | |
| 3486 | - and?: SelectionOperand[]; | |
| 3487 | - or?: SelectionOperand[]; | |
| 3485 | + not: SelectionOperand; | |
| 3486 | + and: SelectionOperand[]; | |
| 3487 | + or: SelectionOperand[]; | |
| 3488 | 3488 | }; |
| 3489 | 3489 | |
| 3490 | 3490 | /** |
| @@ -3496,19 +3496,19 @@ export type Selection = { | ||
| 3496 | 3496 | export type SelectionOperand = Selection | string; |
| 3497 | 3497 | |
| 3498 | 3498 | export type Predicate = { |
| 3499 | - not?: LogicalOperandPredicate; | |
| 3500 | - and?: LogicalOperandPredicate[]; | |
| 3501 | - or?: LogicalOperandPredicate[]; | |
| 3499 | + not: LogicalOperandPredicate; | |
| 3500 | + and: LogicalOperandPredicate[]; | |
| 3501 | + or: LogicalOperandPredicate[]; | |
| 3502 | 3502 | /** |
| 3503 | 3503 | * The value that the field should be equal to. |
| 3504 | 3504 | */ |
| 3505 | - equal?: Equal; | |
| 3505 | + equal: Equal; | |
| 3506 | 3506 | /** |
| 3507 | 3507 | * Field to be filtered. |
| 3508 | 3508 | * |
| 3509 | 3509 | * Field to be filtered |
| 3510 | 3510 | */ |
| 3511 | - field?: string; | |
| 3511 | + field: string; | |
| 3512 | 3512 | /** |
| 3513 | 3513 | * Time unit for the field to be filtered. |
| 3514 | 3514 | * |
| @@ -3519,16 +3519,16 @@ export type Predicate = { | ||
| 3519 | 3519 | * An array of inclusive minimum and maximum values |
| 3520 | 3520 | * for a field value of a data item to be included in the filtered data. |
| 3521 | 3521 | */ |
| 3522 | - range?: RangeElement[]; | |
| 3522 | + range: RangeElement[]; | |
| 3523 | 3523 | /** |
| 3524 | 3524 | * A set of values that the `field`'s value should be a member of, |
| 3525 | 3525 | * for a data item included in the filtered data. |
| 3526 | 3526 | */ |
| 3527 | - oneOf?: Equal[]; | |
| 3527 | + oneOf: Equal[]; | |
| 3528 | 3528 | /** |
| 3529 | 3529 | * Filter using a selection name. |
| 3530 | 3530 | */ |
| 3531 | - selection?: SelectionOperand; | |
| 3531 | + selection: SelectionOperand; | |
| 3532 | 3532 | }; |
| 3533 | 3533 | |
| 3534 | 3534 | /** |
| @@ -3689,17 +3689,17 @@ export type TimeUnit = | ||
| 3689 | 3689 | export type ConditionalValueDefValue = boolean | number | string; |
| 3690 | 3690 | |
| 3691 | 3691 | export type ConditionalPredicateMarkPropFieldDefClass = { |
| 3692 | - test?: LogicalOperandPredicate; | |
| 3692 | + test: LogicalOperandPredicate; | |
| 3693 | 3693 | /** |
| 3694 | 3694 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 3695 | 3695 | * `0` to `1` for opacity). |
| 3696 | 3696 | */ |
| 3697 | - value?: ConditionalValueDefValue; | |
| 3697 | + value: ConditionalValueDefValue; | |
| 3698 | 3698 | /** |
| 3699 | 3699 | * A [selection name](selection.html), or a series of [composed |
| 3700 | 3700 | * selections](selection.html#compose). |
| 3701 | 3701 | */ |
| 3702 | - selection?: SelectionOperand; | |
| 3702 | + selection: SelectionOperand; | |
| 3703 | 3703 | /** |
| 3704 | 3704 | * Aggregation function for the field |
| 3705 | 3705 | * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -3765,7 +3765,7 @@ export type ConditionalPredicateMarkPropFieldDefClass = { | ||
| 3765 | 3765 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3766 | 3766 | * [geographic projection](projection.html) is applied. |
| 3767 | 3767 | */ |
| 3768 | - type?: Type; | |
| 3768 | + type: Type; | |
| 3769 | 3769 | }; |
| 3770 | 3770 | |
| 3771 | 3771 | export type Field = RepeatRef | string; |
| @@ -4540,7 +4540,7 @@ export type DefWithCondition = { | ||
| 4540 | 4540 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4541 | 4541 | * [geographic projection](projection.html) is applied. |
| 4542 | 4542 | */ |
| 4543 | - type?: Type; | |
| 4543 | + type: Type; | |
| 4544 | 4544 | /** |
| 4545 | 4545 | * A constant value in visual domain. |
| 4546 | 4546 | */ |
| @@ -4550,17 +4550,17 @@ export type DefWithCondition = { | ||
| 4550 | 4550 | export type HrefCondition = ConditionalValueDef[] | ConditionalPredicateFieldDefClass; |
| 4551 | 4551 | |
| 4552 | 4552 | export type ConditionalPredicateFieldDefClass = { |
| 4553 | - test?: LogicalOperandPredicate; | |
| 4553 | + test: LogicalOperandPredicate; | |
| 4554 | 4554 | /** |
| 4555 | 4555 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4556 | 4556 | * `0` to `1` for opacity). |
| 4557 | 4557 | */ |
| 4558 | - value?: ConditionalValueDefValue; | |
| 4558 | + value: ConditionalValueDefValue; | |
| 4559 | 4559 | /** |
| 4560 | 4560 | * A [selection name](selection.html), or a series of [composed |
| 4561 | 4561 | * selections](selection.html#compose). |
| 4562 | 4562 | */ |
| 4563 | - selection?: SelectionOperand; | |
| 4563 | + selection: SelectionOperand; | |
| 4564 | 4564 | /** |
| 4565 | 4565 | * Aggregation function for the field |
| 4566 | 4566 | * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -4602,7 +4602,7 @@ export type ConditionalPredicateFieldDefClass = { | ||
| 4602 | 4602 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4603 | 4603 | * [geographic projection](projection.html) is applied. |
| 4604 | 4604 | */ |
| 4605 | - type?: Type; | |
| 4605 | + type: Type; | |
| 4606 | 4606 | }; |
| 4607 | 4607 | |
| 4608 | 4608 | export type Order = OrderFieldDef[] | OrderFieldDef; |
| @@ -4731,7 +4731,7 @@ export type TextDefWithCondition = { | ||
| 4731 | 4731 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4732 | 4732 | * [geographic projection](projection.html) is applied. |
| 4733 | 4733 | */ |
| 4734 | - type?: Type; | |
| 4734 | + type: Type; | |
| 4735 | 4735 | /** |
| 4736 | 4736 | * A constant value in visual domain. |
| 4737 | 4737 | */ |
| @@ -4741,17 +4741,17 @@ export type TextDefWithCondition = { | ||
| 4741 | 4741 | export type TextCondition = ConditionalValueDef[] | ConditionalPredicateTextFieldDefClass; |
| 4742 | 4742 | |
| 4743 | 4743 | export type ConditionalPredicateTextFieldDefClass = { |
| 4744 | - test?: LogicalOperandPredicate; | |
| 4744 | + test: LogicalOperandPredicate; | |
| 4745 | 4745 | /** |
| 4746 | 4746 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4747 | 4747 | * `0` to `1` for opacity). |
| 4748 | 4748 | */ |
| 4749 | - value?: ConditionalValueDefValue; | |
| 4749 | + value: ConditionalValueDefValue; | |
| 4750 | 4750 | /** |
| 4751 | 4751 | * A [selection name](selection.html), or a series of [composed |
| 4752 | 4752 | * selections](selection.html#compose). |
| 4753 | 4753 | */ |
| 4754 | - selection?: SelectionOperand; | |
| 4754 | + selection: SelectionOperand; | |
| 4755 | 4755 | /** |
| 4756 | 4756 | * Aggregation function for the field |
| 4757 | 4757 | * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -4798,7 +4798,7 @@ export type ConditionalPredicateTextFieldDefClass = { | ||
| 4798 | 4798 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4799 | 4799 | * [geographic projection](projection.html) is applied. |
| 4800 | 4800 | */ |
| 4801 | - type?: Type; | |
| 4801 | + type: Type; | |
| 4802 | 4802 | }; |
| 4803 | 4803 | |
| 4804 | 4804 | /** |
| @@ -4897,12 +4897,12 @@ export type XClass = { | ||
| 4897 | 4897 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4898 | 4898 | * [geographic projection](projection.html) is applied. |
| 4899 | 4899 | */ |
| 4900 | - type?: Type; | |
| 4900 | + type: Type; | |
| 4901 | 4901 | /** |
| 4902 | 4902 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4903 | 4903 | * `0` to `1` for opacity). |
| 4904 | 4904 | */ |
| 4905 | - value?: ConditionalValueDefValue; | |
| 4905 | + value: ConditionalValueDefValue; | |
| 4906 | 4906 | }; |
| 4907 | 4907 | |
| 4908 | 4908 | export type Axis = { |
| @@ -5125,12 +5125,12 @@ export type X2Class = { | ||
| 5125 | 5125 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5126 | 5126 | * [geographic projection](projection.html) is applied. |
| 5127 | 5127 | */ |
| 5128 | - type?: Type; | |
| 5128 | + type: Type; | |
| 5129 | 5129 | /** |
| 5130 | 5130 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5131 | 5131 | * `0` to `1` for opacity). |
| 5132 | 5132 | */ |
| 5133 | - value?: ConditionalValueDefValue; | |
| 5133 | + value: ConditionalValueDefValue; | |
| 5134 | 5134 | }; |
| 5135 | 5135 | |
| 5136 | 5136 | /** |
| @@ -5186,7 +5186,7 @@ export type Spec = { | ||
| 5186 | 5186 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5187 | 5187 | * layering facet specifications is not allowed. |
| 5188 | 5188 | */ |
| 5189 | - layer?: LayerSpec[]; | |
| 5189 | + layer: LayerSpec[]; | |
| 5190 | 5190 | /** |
| 5191 | 5191 | * Name of the visualization for later reference. |
| 5192 | 5192 | */ |
| @@ -5237,14 +5237,14 @@ export type Spec = { | ||
| 5237 | 5237 | /** |
| 5238 | 5238 | * A key-value mapping between encoding channels and definition of fields. |
| 5239 | 5239 | */ |
| 5240 | - encoding?: Encoding; | |
| 5240 | + encoding: Encoding; | |
| 5241 | 5241 | /** |
| 5242 | 5242 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 5243 | 5243 | * `"line"`, |
| 5244 | 5244 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 5245 | 5245 | * object](mark.html#mark-def). |
| 5246 | 5246 | */ |
| 5247 | - mark?: AnyMark; | |
| 5247 | + mark: AnyMark; | |
| 5248 | 5248 | /** |
| 5249 | 5249 | * An object defining properties of geographic projection. |
| 5250 | 5250 | * |
| @@ -5260,24 +5260,24 @@ export type Spec = { | ||
| 5260 | 5260 | * An object that describes mappings between `row` and `column` channels and their field |
| 5261 | 5261 | * definitions. |
| 5262 | 5262 | */ |
| 5263 | - facet?: FacetMapping; | |
| 5263 | + facet: FacetMapping; | |
| 5264 | 5264 | /** |
| 5265 | 5265 | * A specification of the view that gets faceted. |
| 5266 | 5266 | */ |
| 5267 | - spec?: Spec; | |
| 5267 | + spec: Spec; | |
| 5268 | 5268 | /** |
| 5269 | 5269 | * An object that describes what fields should be repeated into views that are laid out as a |
| 5270 | 5270 | * `row` or `column`. |
| 5271 | 5271 | */ |
| 5272 | - repeat?: Repeat; | |
| 5272 | + repeat: Repeat; | |
| 5273 | 5273 | /** |
| 5274 | 5274 | * A list of views that should be concatenated and put into a column. |
| 5275 | 5275 | */ |
| 5276 | - vconcat?: Spec[]; | |
| 5276 | + vconcat: Spec[]; | |
| 5277 | 5277 | /** |
| 5278 | 5278 | * A list of views that should be concatenated and put into a row. |
| 5279 | 5279 | */ |
| 5280 | - hconcat?: Spec[]; | |
| 5280 | + hconcat: Spec[]; | |
| 5281 | 5281 | }; |
| 5282 | 5282 | |
| 5283 | 5283 | /** |
| @@ -5402,7 +5402,7 @@ export type LayerSpec = { | ||
| 5402 | 5402 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5403 | 5403 | * layering facet specifications is not allowed. |
| 5404 | 5404 | */ |
| 5405 | - layer?: LayerSpec[]; | |
| 5405 | + layer: LayerSpec[]; | |
| 5406 | 5406 | /** |
| 5407 | 5407 | * Name of the visualization for later reference. |
| 5408 | 5408 | */ |
| @@ -5445,14 +5445,14 @@ export type LayerSpec = { | ||
| 5445 | 5445 | /** |
| 5446 | 5446 | * A key-value mapping between encoding channels and definition of fields. |
| 5447 | 5447 | */ |
| 5448 | - encoding?: Encoding; | |
| 5448 | + encoding: Encoding; | |
| 5449 | 5449 | /** |
| 5450 | 5450 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 5451 | 5451 | * `"line"`, |
| 5452 | 5452 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 5453 | 5453 | * object](mark.html#mark-def). |
| 5454 | 5454 | */ |
| 5455 | - mark?: AnyMark; | |
| 5455 | + mark: AnyMark; | |
| 5456 | 5456 | /** |
| 5457 | 5457 | * An object defining properties of geographic projection. |
| 5458 | 5458 | * |
| @@ -5995,7 +5995,7 @@ export type Transform = { | ||
| 5995 | 5995 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 5996 | 5996 | * or (4) a logical operand that combines (1), (2), or (3). |
| 5997 | 5997 | */ |
| 5998 | - filter?: LogicalOperandPredicate; | |
| 5998 | + filter: LogicalOperandPredicate; | |
| 5999 | 5999 | /** |
| 6000 | 6000 | * The field for storing the computed formula value. |
| 6001 | 6001 | * |
| @@ -6013,7 +6013,7 @@ export type Transform = { | ||
| 6013 | 6013 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 6014 | 6014 | * current data object. |
| 6015 | 6015 | */ |
| 6016 | - calculate?: string; | |
| 6016 | + calculate: string; | |
| 6017 | 6017 | /** |
| 6018 | 6018 | * The default value to use if lookup fails. |
| 6019 | 6019 | * |
| @@ -6023,29 +6023,29 @@ export type Transform = { | ||
| 6023 | 6023 | /** |
| 6024 | 6024 | * Secondary data reference. |
| 6025 | 6025 | */ |
| 6026 | - from?: LookupData; | |
| 6026 | + from: LookupData; | |
| 6027 | 6027 | /** |
| 6028 | 6028 | * Key in primary data source. |
| 6029 | 6029 | */ |
| 6030 | - lookup?: string; | |
| 6030 | + lookup: string; | |
| 6031 | 6031 | /** |
| 6032 | 6032 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 6033 | 6033 | */ |
| 6034 | - bin?: Bin; | |
| 6034 | + bin: Bin; | |
| 6035 | 6035 | /** |
| 6036 | 6036 | * The data field to bin. |
| 6037 | 6037 | * |
| 6038 | 6038 | * The data field to apply time unit. |
| 6039 | 6039 | */ |
| 6040 | - field?: string; | |
| 6040 | + field: string; | |
| 6041 | 6041 | /** |
| 6042 | 6042 | * The timeUnit. |
| 6043 | 6043 | */ |
| 6044 | - timeUnit?: TimeUnit; | |
| 6044 | + timeUnit: TimeUnit; | |
| 6045 | 6045 | /** |
| 6046 | 6046 | * Array of objects that define fields to aggregate. |
| 6047 | 6047 | */ |
| 6048 | - aggregate?: AggregatedFieldDef[]; | |
| 6048 | + aggregate: AggregatedFieldDef[]; | |
| 6049 | 6049 | /** |
| 6050 | 6050 | * The data fields to group by. If not specified, a single group containing all data objects |
| 6051 | 6051 | * will be used. |
| @@ -6276,9 +6276,9 @@ const typeMap: any = { | ||
| 6276 | 6276 | { json: "config", js: "config", typ: u(undefined, r("Config")) }, |
| 6277 | 6277 | { json: "data", js: "data", typ: u(undefined, r("Data")) }, |
| 6278 | 6278 | { json: "description", js: "description", typ: u(undefined, "") }, |
| 6279 | - { json: "encoding", js: "encoding", typ: u(undefined, r("EncodingWithFacet")) }, | |
| 6279 | + { json: "encoding", js: "encoding", typ: r("EncodingWithFacet") }, | |
| 6280 | 6280 | { json: "height", js: "height", typ: u(undefined, 3.14) }, |
| 6281 | - { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) }, | |
| 6281 | + { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) }, | |
| 6282 | 6282 | { json: "name", js: "name", typ: u(undefined, "") }, |
| 6283 | 6283 | { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) }, |
| 6284 | 6284 | { json: "projection", js: "projection", typ: u(undefined, r("Projection")) }, |
| @@ -6286,13 +6286,13 @@ const typeMap: any = { | ||
| 6286 | 6286 | { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) }, |
| 6287 | 6287 | { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) }, |
| 6288 | 6288 | { json: "width", js: "width", typ: u(undefined, 3.14) }, |
| 6289 | - { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) }, | |
| 6289 | + { json: "layer", js: "layer", typ: a(r("LayerSpec")) }, | |
| 6290 | 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"))) }, | |
| 6291 | + { json: "facet", js: "facet", typ: r("FacetMapping") }, | |
| 6292 | + { json: "spec", js: "spec", typ: r("Spec") }, | |
| 6293 | + { json: "repeat", js: "repeat", typ: r("Repeat") }, | |
| 6294 | + { json: "vconcat", js: "vconcat", typ: a(r("Spec")) }, | |
| 6295 | + { json: "hconcat", js: "hconcat", typ: a(r("Spec")) }, | |
| 6296 | 6296 | ], false), |
| 6297 | 6297 | "AutoSizeParams": o([ |
| 6298 | 6298 | { json: "contains", js: "contains", typ: u(undefined, r("Contains")) }, |
| @@ -6566,8 +6566,8 @@ const typeMap: any = { | ||
| 6566 | 6566 | "RangeConfigValueVGScheme": o([ |
| 6567 | 6567 | { json: "count", js: "count", typ: u(undefined, 3.14) }, |
| 6568 | 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) }, | |
| 6569 | + { json: "scheme", js: "scheme", typ: "" }, | |
| 6570 | + { json: "step", js: "step", typ: 3.14 }, | |
| 6571 | 6571 | ], false), |
| 6572 | 6572 | "ScaleConfig": o([ |
| 6573 | 6573 | { json: "bandPaddingInner", js: "bandPaddingInner", typ: u(undefined, 3.14) }, |
| @@ -6636,7 +6636,7 @@ const typeMap: any = { | ||
| 6636 | 6636 | "VGBinding": o([ |
| 6637 | 6637 | { json: "element", js: "element", typ: u(undefined, "") }, |
| 6638 | 6638 | { json: "input", js: "input", typ: "" }, |
| 6639 | - { json: "options", js: "options", typ: u(undefined, a("")) }, | |
| 6639 | + { json: "options", js: "options", typ: a("") }, | |
| 6640 | 6640 | { json: "max", js: "max", typ: u(undefined, 3.14) }, |
| 6641 | 6641 | { json: "min", js: "min", typ: u(undefined, 3.14) }, |
| 6642 | 6642 | { json: "step", js: "step", typ: u(undefined, 3.14) }, |
| @@ -6764,9 +6764,9 @@ const typeMap: any = { | ||
| 6764 | 6764 | ], false), |
| 6765 | 6765 | "Data": o([ |
| 6766 | 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, "") }, | |
| 6767 | + { json: "url", js: "url", typ: "" }, | |
| 6768 | + { json: "values", js: "values", typ: u(a(u(true, 3.14, m("any"), "")), m("any"), "") }, | |
| 6769 | + { json: "name", js: "name", typ: "" }, | |
| 6770 | 6770 | ], false), |
| 6771 | 6771 | "DataFormat": o([ |
| 6772 | 6772 | { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) }, |
| @@ -6801,7 +6801,7 @@ const typeMap: any = { | ||
| 6801 | 6801 | { json: "scale", js: "scale", typ: u(undefined, r("Scale")) }, |
| 6802 | 6802 | { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) }, |
| 6803 | 6803 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 6804 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 6804 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6805 | 6805 | { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, |
| 6806 | 6806 | ], false), |
| 6807 | 6807 | "BinParams": o([ |
| @@ -6815,25 +6815,25 @@ const typeMap: any = { | ||
| 6815 | 6815 | { json: "steps", js: "steps", typ: u(undefined, a(3.14)) }, |
| 6816 | 6816 | ], false), |
| 6817 | 6817 | "ConditionalValueDef": o([ |
| 6818 | - { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 6818 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 6819 | 6819 | { json: "value", js: "value", typ: u(true, 3.14, "") }, |
| 6820 | - { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) }, | |
| 6820 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 6821 | 6821 | ], false), |
| 6822 | 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"), ""))) }, | |
| 6823 | + { json: "not", js: "not", typ: u(r("Selection"), "") }, | |
| 6824 | + { json: "and", js: "and", typ: a(u(r("Selection"), "")) }, | |
| 6825 | + { json: "or", js: "or", typ: a(u(r("Selection"), "")) }, | |
| 6826 | 6826 | ], false), |
| 6827 | 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, "") }, | |
| 6828 | + { json: "not", js: "not", typ: u(r("Predicate"), "") }, | |
| 6829 | + { json: "and", js: "and", typ: a(u(r("Predicate"), "")) }, | |
| 6830 | + { json: "or", js: "or", typ: a(u(r("Predicate"), "")) }, | |
| 6831 | + { json: "equal", js: "equal", typ: u(true, r("DateTime"), 3.14, "") }, | |
| 6832 | + { json: "field", js: "field", typ: "" }, | |
| 6833 | 6833 | { 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"), "")) }, | |
| 6834 | + { json: "range", js: "range", typ: a(u(r("DateTime"), 3.14, null)) }, | |
| 6835 | + { json: "oneOf", js: "oneOf", typ: a(u(true, r("DateTime"), 3.14, "")) }, | |
| 6836 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 6837 | 6837 | ], false), |
| 6838 | 6838 | "DateTime": o([ |
| 6839 | 6839 | { json: "date", js: "date", typ: u(undefined, 3.14) }, |
| @@ -6848,9 +6848,9 @@ const typeMap: any = { | ||
| 6848 | 6848 | { json: "year", js: "year", typ: u(undefined, 3.14) }, |
| 6849 | 6849 | ], false), |
| 6850 | 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"), "")) }, | |
| 6851 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 6852 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 6853 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 6854 | 6854 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| 6855 | 6855 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 6856 | 6856 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| @@ -6858,7 +6858,7 @@ const typeMap: any = { | ||
| 6858 | 6858 | { json: "scale", js: "scale", typ: u(undefined, r("Scale")) }, |
| 6859 | 6859 | { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) }, |
| 6860 | 6860 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 6861 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 6861 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6862 | 6862 | ], false), |
| 6863 | 6863 | "RepeatRef": o([ |
| 6864 | 6864 | { json: "repeat", js: "repeat", typ: r("RepeatEnum") }, |
| @@ -6941,18 +6941,18 @@ const typeMap: any = { | ||
| 6941 | 6941 | { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateFieldDefClass"))) }, |
| 6942 | 6942 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 6943 | 6943 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 6944 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 6944 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6945 | 6945 | { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, |
| 6946 | 6946 | ], false), |
| 6947 | 6947 | "ConditionalPredicateFieldDefClass": o([ |
| 6948 | - { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 6949 | - { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, | |
| 6950 | - { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) }, | |
| 6948 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 6949 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 6950 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 6951 | 6951 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| 6952 | 6952 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 6953 | 6953 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 6954 | 6954 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 6955 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 6955 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6956 | 6956 | ], false), |
| 6957 | 6957 | "OrderFieldDef": o([ |
| 6958 | 6958 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| @@ -6969,19 +6969,19 @@ const typeMap: any = { | ||
| 6969 | 6969 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 6970 | 6970 | { json: "format", js: "format", typ: u(undefined, "") }, |
| 6971 | 6971 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 6972 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 6972 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6973 | 6973 | { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, |
| 6974 | 6974 | ], false), |
| 6975 | 6975 | "ConditionalPredicateTextFieldDefClass": o([ |
| 6976 | - { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 6977 | - { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, | |
| 6978 | - { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) }, | |
| 6976 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 6977 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 6978 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 6979 | 6979 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| 6980 | 6980 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 6981 | 6981 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 6982 | 6982 | { json: "format", js: "format", typ: u(undefined, "") }, |
| 6983 | 6983 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 6984 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 6984 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6985 | 6985 | ], false), |
| 6986 | 6986 | "XClass": o([ |
| 6987 | 6987 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| @@ -6992,8 +6992,8 @@ const typeMap: any = { | ||
| 6992 | 6992 | { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) }, |
| 6993 | 6993 | { json: "stack", js: "stack", typ: u(undefined, u(r("StackOffset"), null)) }, |
| 6994 | 6994 | { 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, "")) }, | |
| 6995 | + { json: "type", js: "type", typ: r("Type") }, | |
| 6996 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 6997 | 6997 | ], false), |
| 6998 | 6998 | "Axis": o([ |
| 6999 | 6999 | { json: "domain", js: "domain", typ: u(undefined, true) }, |
| @@ -7024,8 +7024,8 @@ const typeMap: any = { | ||
| 7024 | 7024 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 7025 | 7025 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 7026 | 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, "")) }, | |
| 7027 | + { json: "type", js: "type", typ: r("Type") }, | |
| 7028 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 7029 | 7029 | ], false), |
| 7030 | 7030 | "FacetMapping": o([ |
| 7031 | 7031 | { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) }, |
| @@ -7035,21 +7035,21 @@ const typeMap: any = { | ||
| 7035 | 7035 | { json: "data", js: "data", typ: u(undefined, r("Data")) }, |
| 7036 | 7036 | { json: "description", js: "description", typ: u(undefined, "") }, |
| 7037 | 7037 | { json: "height", js: "height", typ: u(undefined, 3.14) }, |
| 7038 | - { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) }, | |
| 7038 | + { json: "layer", js: "layer", typ: a(r("LayerSpec")) }, | |
| 7039 | 7039 | { json: "name", js: "name", typ: u(undefined, "") }, |
| 7040 | 7040 | { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) }, |
| 7041 | 7041 | { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) }, |
| 7042 | 7042 | { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) }, |
| 7043 | 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"))) }, | |
| 7044 | + { json: "encoding", js: "encoding", typ: r("Encoding") }, | |
| 7045 | + { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) }, | |
| 7046 | 7046 | { json: "projection", js: "projection", typ: u(undefined, r("Projection")) }, |
| 7047 | 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"))) }, | |
| 7048 | + { json: "facet", js: "facet", typ: r("FacetMapping") }, | |
| 7049 | + { json: "spec", js: "spec", typ: r("Spec") }, | |
| 7050 | + { json: "repeat", js: "repeat", typ: r("Repeat") }, | |
| 7051 | + { json: "vconcat", js: "vconcat", typ: a(r("Spec")) }, | |
| 7052 | + { json: "hconcat", js: "hconcat", typ: a(r("Spec")) }, | |
| 7053 | 7053 | ], false), |
| 7054 | 7054 | "Encoding": o([ |
| 7055 | 7055 | { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) }, |
| @@ -7070,14 +7070,14 @@ const typeMap: any = { | ||
| 7070 | 7070 | { json: "data", js: "data", typ: u(undefined, r("Data")) }, |
| 7071 | 7071 | { json: "description", js: "description", typ: u(undefined, "") }, |
| 7072 | 7072 | { json: "height", js: "height", typ: u(undefined, 3.14) }, |
| 7073 | - { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) }, | |
| 7073 | + { json: "layer", js: "layer", typ: a(r("LayerSpec")) }, | |
| 7074 | 7074 | { json: "name", js: "name", typ: u(undefined, "") }, |
| 7075 | 7075 | { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) }, |
| 7076 | 7076 | { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) }, |
| 7077 | 7077 | { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) }, |
| 7078 | 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"))) }, | |
| 7079 | + { json: "encoding", js: "encoding", typ: r("Encoding") }, | |
| 7080 | + { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) }, | |
| 7081 | 7081 | { json: "projection", js: "projection", typ: u(undefined, r("Projection")) }, |
| 7082 | 7082 | { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) }, |
| 7083 | 7083 | ], false), |
| @@ -7181,16 +7181,16 @@ const typeMap: any = { | ||
| 7181 | 7181 | { json: "text", js: "text", typ: "" }, |
| 7182 | 7182 | ], false), |
| 7183 | 7183 | "Transform": o([ |
| 7184 | - { json: "filter", js: "filter", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 7184 | + { json: "filter", js: "filter", typ: u(r("Predicate"), "") }, | |
| 7185 | 7185 | { json: "as", js: "as", typ: u(undefined, u(a(""), "")) }, |
| 7186 | - { json: "calculate", js: "calculate", typ: u(undefined, "") }, | |
| 7186 | + { json: "calculate", js: "calculate", typ: "" }, | |
| 7187 | 7187 | { 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"))) }, | |
| 7188 | + { json: "from", js: "from", typ: r("LookupData") }, | |
| 7189 | + { json: "lookup", js: "lookup", typ: "" }, | |
| 7190 | + { json: "bin", js: "bin", typ: u(true, r("BinParams")) }, | |
| 7191 | + { json: "field", js: "field", typ: "" }, | |
| 7192 | + { json: "timeUnit", js: "timeUnit", typ: r("TimeUnit") }, | |
| 7193 | + { json: "aggregate", js: "aggregate", typ: a(r("AggregatedFieldDef")) }, | |
| 7194 | 7194 | { json: "groupby", js: "groupby", typ: u(undefined, a("")) }, |
| 7195 | 7195 | ], false), |
| 7196 | 7196 | "AggregatedFieldDef": o([ |
Mschema-golangdefault / quicktype.go+41 −41
| @@ -47,7 +47,7 @@ type TopLevel struct { | ||
| 47 | 47 | // Description of this mark for commenting purpose. |
| 48 | 48 | Description *string `json:"description,omitempty"` |
| 49 | 49 | // A key-value mapping between encoding channels and definition of fields. |
| 50 | - Encoding *EncodingWithFacet `json:"encoding,omitempty"` | |
| 50 | + Encoding EncodingWithFacet `json:"encoding"` | |
| 51 | 51 | // The height of a visualization. |
| 52 | 52 | // |
| 53 | 53 | // __Default value:__ |
| @@ -116,7 +116,7 @@ type TopLevel struct { | ||
| 116 | 116 | // |
| 117 | 117 | // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 118 | 118 | // layering facet specifications is not allowed. |
| 119 | - Layer []LayerSpec `json:"layer,omitempty"` | |
| 119 | + Layer []LayerSpec `json:"layer"` | |
| 120 | 120 | // Scale, axis, and legend resolutions for layers. |
| 121 | 121 | // |
| 122 | 122 | // Scale, axis, and legend resolutions for facets. |
| @@ -129,16 +129,16 @@ type TopLevel struct { | ||
| 129 | 129 | Resolve *Resolve `json:"resolve,omitempty"` |
| 130 | 130 | // An object that describes mappings between `row` and `column` channels and their field |
| 131 | 131 | // definitions. |
| 132 | - Facet *FacetMapping `json:"facet,omitempty"` | |
| 132 | + Facet FacetMapping `json:"facet"` | |
| 133 | 133 | // A specification of the view that gets faceted. |
| 134 | - Spec *Spec `json:"spec,omitempty"` | |
| 134 | + Spec Spec `json:"spec"` | |
| 135 | 135 | // An object that describes what fields should be repeated into views that are laid out as a |
| 136 | 136 | // `row` or `column`. |
| 137 | - Repeat *Repeat `json:"repeat,omitempty"` | |
| 137 | + Repeat Repeat `json:"repeat"` | |
| 138 | 138 | // A list of views that should be concatenated and put into a column. |
| 139 | - Vconcat []Spec `json:"vconcat,omitempty"` | |
| 139 | + Vconcat []Spec `json:"vconcat"` | |
| 140 | 140 | // A list of views that should be concatenated and put into a row. |
| 141 | - Hconcat []Spec `json:"hconcat,omitempty"` | |
| 141 | + Hconcat []Spec `json:"hconcat"` | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | type AutoSizeParams struct { |
| @@ -992,7 +992,7 @@ type ProjectionConfig struct { | ||
| 992 | 992 | type VGScheme struct { |
| 993 | 993 | Count *float64 `json:"count,omitempty"` |
| 994 | 994 | Extent []float64 `json:"extent,omitempty"` |
| 995 | - Scheme *string `json:"scheme,omitempty"` | |
| 995 | + Scheme string `json:"scheme"` | |
| 996 | 996 | Step *float64 `json:"step,omitempty"` |
| 997 | 997 | } |
| 998 | 998 | |
| @@ -1274,7 +1274,7 @@ type SingleSelectionConfig struct { | ||
| 1274 | 1274 | type VGBinding struct { |
| 1275 | 1275 | Element *string `json:"element,omitempty"` |
| 1276 | 1276 | Input string `json:"input"` |
| 1277 | - Options []string `json:"options,omitempty"` | |
| 1277 | + Options []string `json:"options"` | |
| 1278 | 1278 | Max *float64 `json:"max,omitempty"` |
| 1279 | 1279 | Min *float64 `json:"min,omitempty"` |
| 1280 | 1280 | Step *float64 `json:"step,omitempty"` |
| @@ -1752,14 +1752,14 @@ type Data struct { | ||
| 1752 | 1752 | Format *DataFormat `json:"format,omitempty"` |
| 1753 | 1753 | // An URL from which to load the data set. Use the `format.type` property |
| 1754 | 1754 | // to ensure the loaded data is correctly parsed. |
| 1755 | - URL *string `json:"url,omitempty"` | |
| 1755 | + URL string `json:"url"` | |
| 1756 | 1756 | // The full data set, included inline. This can be an array of objects or primitive values |
| 1757 | 1757 | // or a string. |
| 1758 | 1758 | // Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 1759 | 1759 | // parsed according to the specified format type. |
| 1760 | 1760 | Values *ValuesUnion `json:"values"` |
| 1761 | 1761 | // Provide a placeholder name and bind data at runtime. |
| 1762 | - Name *string `json:"name,omitempty"` | |
| 1762 | + Name string `json:"name"` | |
| 1763 | 1763 | } |
| 1764 | 1764 | |
| 1765 | 1765 | // An object that specifies the format for parsing the data file. |
| @@ -1968,7 +1968,7 @@ type MarkPropDefWithCondition struct { | ||
| 1968 | 1968 | // `"nominal"`). |
| 1969 | 1969 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 1970 | 1970 | // [geographic projection](projection.html) is applied. |
| 1971 | - Type *Type `json:"type,omitempty"` | |
| 1971 | + Type Type `json:"type"` | |
| 1972 | 1972 | // A constant value in visual domain. |
| 1973 | 1973 | Value *ConditionalValueDefValue `json:"value"` |
| 1974 | 1974 | } |
| @@ -2018,30 +2018,30 @@ type ConditionalValueDef struct { | ||
| 2018 | 2018 | |
| 2019 | 2019 | type Selection struct { |
| 2020 | 2020 | Not *SelectionOperand `json:"not"` |
| 2021 | - And []SelectionOperand `json:"and,omitempty"` | |
| 2022 | - Or []SelectionOperand `json:"or,omitempty"` | |
| 2021 | + And []SelectionOperand `json:"and"` | |
| 2022 | + Or []SelectionOperand `json:"or"` | |
| 2023 | 2023 | } |
| 2024 | 2024 | |
| 2025 | 2025 | type Predicate struct { |
| 2026 | 2026 | Not *LogicalOperandPredicate `json:"not"` |
| 2027 | - And []LogicalOperandPredicate `json:"and,omitempty"` | |
| 2028 | - Or []LogicalOperandPredicate `json:"or,omitempty"` | |
| 2027 | + And []LogicalOperandPredicate `json:"and"` | |
| 2028 | + Or []LogicalOperandPredicate `json:"or"` | |
| 2029 | 2029 | // The value that the field should be equal to. |
| 2030 | 2030 | Equal *Equal `json:"equal"` |
| 2031 | 2031 | // Field to be filtered. |
| 2032 | 2032 | // |
| 2033 | 2033 | // Field to be filtered |
| 2034 | - Field *string `json:"field,omitempty"` | |
| 2034 | + Field string `json:"field"` | |
| 2035 | 2035 | // Time unit for the field to be filtered. |
| 2036 | 2036 | // |
| 2037 | 2037 | // time unit for the field to be filtered. |
| 2038 | 2038 | TimeUnit *TimeUnit `json:"timeUnit,omitempty"` |
| 2039 | 2039 | // An array of inclusive minimum and maximum values |
| 2040 | 2040 | // for a field value of a data item to be included in the filtered data. |
| 2041 | - Range []RangeElement `json:"range,omitempty"` | |
| 2041 | + Range []RangeElement `json:"range"` | |
| 2042 | 2042 | // A set of values that the `field`'s value should be a member of, |
| 2043 | 2043 | // for a data item included in the filtered data. |
| 2044 | - OneOf []Equal `json:"oneOf,omitempty"` | |
| 2044 | + OneOf []Equal `json:"oneOf"` | |
| 2045 | 2045 | // Filter using a selection name. |
| 2046 | 2046 | Selection *SelectionOperand `json:"selection"` |
| 2047 | 2047 | } |
| @@ -2137,7 +2137,7 @@ type ConditionalPredicateMarkPropFieldDefClass struct { | ||
| 2137 | 2137 | // `"nominal"`). |
| 2138 | 2138 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 2139 | 2139 | // [geographic projection](projection.html) is applied. |
| 2140 | - Type *Type `json:"type,omitempty"` | |
| 2140 | + Type Type `json:"type"` | |
| 2141 | 2141 | } |
| 2142 | 2142 | |
| 2143 | 2143 | // Reference to a repeated value. |
| @@ -2597,7 +2597,7 @@ type DefWithCondition struct { | ||
| 2597 | 2597 | // `"nominal"`). |
| 2598 | 2598 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 2599 | 2599 | // [geographic projection](projection.html) is applied. |
| 2600 | - Type *Type `json:"type,omitempty"` | |
| 2600 | + Type Type `json:"type"` | |
| 2601 | 2601 | // A constant value in visual domain. |
| 2602 | 2602 | Value *ConditionalValueDefValue `json:"value"` |
| 2603 | 2603 | } |
| @@ -2641,7 +2641,7 @@ type ConditionalPredicateFieldDefClass struct { | ||
| 2641 | 2641 | // `"nominal"`). |
| 2642 | 2642 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 2643 | 2643 | // [geographic projection](projection.html) is applied. |
| 2644 | - Type *Type `json:"type,omitempty"` | |
| 2644 | + Type Type `json:"type"` | |
| 2645 | 2645 | } |
| 2646 | 2646 | |
| 2647 | 2647 | type OrderFieldDef struct { |
| @@ -2740,7 +2740,7 @@ type TextDefWithCondition struct { | ||
| 2740 | 2740 | // `"nominal"`). |
| 2741 | 2741 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 2742 | 2742 | // [geographic projection](projection.html) is applied. |
| 2743 | - Type *Type `json:"type,omitempty"` | |
| 2743 | + Type Type `json:"type"` | |
| 2744 | 2744 | // A constant value in visual domain. |
| 2745 | 2745 | Value *ConditionalValueDefValue `json:"value"` |
| 2746 | 2746 | } |
| @@ -2787,7 +2787,7 @@ type ConditionalPredicateTextFieldDefClass struct { | ||
| 2787 | 2787 | // `"nominal"`). |
| 2788 | 2788 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 2789 | 2789 | // [geographic projection](projection.html) is applied. |
| 2790 | - Type *Type `json:"type,omitempty"` | |
| 2790 | + Type Type `json:"type"` | |
| 2791 | 2791 | } |
| 2792 | 2792 | |
| 2793 | 2793 | // X coordinates of the marks, or width of horizontal `"bar"` and `"area"`. |
| @@ -2866,7 +2866,7 @@ type XClass struct { | ||
| 2866 | 2866 | // `"nominal"`). |
| 2867 | 2867 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 2868 | 2868 | // [geographic projection](projection.html) is applied. |
| 2869 | - Type *Type `json:"type,omitempty"` | |
| 2869 | + Type Type `json:"type"` | |
| 2870 | 2870 | // A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 2871 | 2871 | // `0` to `1` for opacity). |
| 2872 | 2872 | Value *ConditionalValueDefValue `json:"value"` |
| @@ -3034,7 +3034,7 @@ type X2Class struct { | ||
| 3034 | 3034 | // `"nominal"`). |
| 3035 | 3035 | // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3036 | 3036 | // [geographic projection](projection.html) is applied. |
| 3037 | - Type *Type `json:"type,omitempty"` | |
| 3037 | + Type Type `json:"type"` | |
| 3038 | 3038 | // A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 3039 | 3039 | // `0` to `1` for opacity). |
| 3040 | 3040 | Value *ConditionalValueDefValue `json:"value"` |
| @@ -3077,7 +3077,7 @@ type Spec struct { | ||
| 3077 | 3077 | // |
| 3078 | 3078 | // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 3079 | 3079 | // layering facet specifications is not allowed. |
| 3080 | - Layer []LayerSpec `json:"layer,omitempty"` | |
| 3080 | + Layer []LayerSpec `json:"layer"` | |
| 3081 | 3081 | // Name of the visualization for later reference. |
| 3082 | 3082 | Name *string `json:"name,omitempty"` |
| 3083 | 3083 | // Scale, axis, and legend resolutions for layers. |
| @@ -3116,7 +3116,7 @@ type Spec struct { | ||
| 3116 | 3116 | // __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 3117 | 3117 | Width *float64 `json:"width,omitempty"` |
| 3118 | 3118 | // A key-value mapping between encoding channels and definition of fields. |
| 3119 | - Encoding *Encoding `json:"encoding,omitempty"` | |
| 3119 | + Encoding Encoding `json:"encoding"` | |
| 3120 | 3120 | // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 3121 | 3121 | // `"line"`, |
| 3122 | 3122 | // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| @@ -3131,16 +3131,16 @@ type Spec struct { | ||
| 3131 | 3131 | Selection map[string]SelectionDef `json:"selection,omitempty"` |
| 3132 | 3132 | // An object that describes mappings between `row` and `column` channels and their field |
| 3133 | 3133 | // definitions. |
| 3134 | - Facet *FacetMapping `json:"facet,omitempty"` | |
| 3134 | + Facet FacetMapping `json:"facet"` | |
| 3135 | 3135 | // A specification of the view that gets faceted. |
| 3136 | - Spec *Spec `json:"spec,omitempty"` | |
| 3136 | + Spec Spec `json:"spec"` | |
| 3137 | 3137 | // An object that describes what fields should be repeated into views that are laid out as a |
| 3138 | 3138 | // `row` or `column`. |
| 3139 | - Repeat *Repeat `json:"repeat,omitempty"` | |
| 3139 | + Repeat Repeat `json:"repeat"` | |
| 3140 | 3140 | // A list of views that should be concatenated and put into a column. |
| 3141 | - Vconcat []Spec `json:"vconcat,omitempty"` | |
| 3141 | + Vconcat []Spec `json:"vconcat"` | |
| 3142 | 3142 | // A list of views that should be concatenated and put into a row. |
| 3143 | - Hconcat []Spec `json:"hconcat,omitempty"` | |
| 3143 | + Hconcat []Spec `json:"hconcat"` | |
| 3144 | 3144 | } |
| 3145 | 3145 | |
| 3146 | 3146 | // A key-value mapping between encoding channels and definition of fields. |
| @@ -3227,7 +3227,7 @@ type LayerSpec struct { | ||
| 3227 | 3227 | // |
| 3228 | 3228 | // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 3229 | 3229 | // layering facet specifications is not allowed. |
| 3230 | - Layer []LayerSpec `json:"layer,omitempty"` | |
| 3230 | + Layer []LayerSpec `json:"layer"` | |
| 3231 | 3231 | // Name of the visualization for later reference. |
| 3232 | 3232 | Name *string `json:"name,omitempty"` |
| 3233 | 3233 | // Scale, axis, and legend resolutions for layers. |
| @@ -3258,7 +3258,7 @@ type LayerSpec struct { | ||
| 3258 | 3258 | // __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 3259 | 3259 | Width *float64 `json:"width,omitempty"` |
| 3260 | 3260 | // A key-value mapping between encoding channels and definition of fields. |
| 3261 | - Encoding *Encoding `json:"encoding,omitempty"` | |
| 3261 | + Encoding Encoding `json:"encoding"` | |
| 3262 | 3262 | // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 3263 | 3263 | // `"line"`, |
| 3264 | 3264 | // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| @@ -3624,25 +3624,25 @@ type Transform struct { | ||
| 3624 | 3624 | As *Style `json:"as"` |
| 3625 | 3625 | // A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 3626 | 3626 | // current data object. |
| 3627 | - Calculate *string `json:"calculate,omitempty"` | |
| 3627 | + Calculate string `json:"calculate"` | |
| 3628 | 3628 | // The default value to use if lookup fails. |
| 3629 | 3629 | // |
| 3630 | 3630 | // __Default value:__ `null` |
| 3631 | 3631 | Default *string `json:"default,omitempty"` |
| 3632 | 3632 | // Secondary data reference. |
| 3633 | - From *LookupData `json:"from,omitempty"` | |
| 3633 | + From LookupData `json:"from"` | |
| 3634 | 3634 | // Key in primary data source. |
| 3635 | - Lookup *string `json:"lookup,omitempty"` | |
| 3635 | + Lookup string `json:"lookup"` | |
| 3636 | 3636 | // An object indicating bin properties, or simply `true` for using default bin parameters. |
| 3637 | 3637 | Bin *Bin `json:"bin"` |
| 3638 | 3638 | // The data field to bin. |
| 3639 | 3639 | // |
| 3640 | 3640 | // The data field to apply time unit. |
| 3641 | - Field *string `json:"field,omitempty"` | |
| 3641 | + Field string `json:"field"` | |
| 3642 | 3642 | // The timeUnit. |
| 3643 | - TimeUnit *TimeUnit `json:"timeUnit,omitempty"` | |
| 3643 | + TimeUnit TimeUnit `json:"timeUnit"` | |
| 3644 | 3644 | // Array of objects that define fields to aggregate. |
| 3645 | - Aggregate []AggregatedFieldDef `json:"aggregate,omitempty"` | |
| 3645 | + Aggregate []AggregatedFieldDef `json:"aggregate"` | |
| 3646 | 3646 | // The data fields to group by. If not specified, a single group containing all data objects |
| 3647 | 3647 | // will be used. |
| 3648 | 3648 | Groupby []string `json:"groupby,omitempty"` |
Mschema-haskelldefault / QuickType.hs+128 −128
| @@ -299,9 +299,9 @@ data QuickType = QuickType | ||
| 299 | 299 | , configQuickType :: Maybe Config |
| 300 | 300 | , quickTypeDataQuickType :: Maybe Data |
| 301 | 301 | , descriptionQuickType :: Maybe Text |
| 302 | - , encodingQuickType :: Maybe EncodingWithFacet | |
| 302 | + , encodingQuickType :: EncodingWithFacet | |
| 303 | 303 | , heightQuickType :: Maybe Float |
| 304 | - , markQuickType :: Maybe AnyMark | |
| 304 | + , markQuickType :: AnyMark | |
| 305 | 305 | , nameQuickType :: Maybe Text |
| 306 | 306 | , paddingQuickType :: Maybe Padding |
| 307 | 307 | , projectionQuickType :: Maybe Projection |
| @@ -309,13 +309,13 @@ data QuickType = QuickType | ||
| 309 | 309 | , titleQuickType :: Maybe Title |
| 310 | 310 | , transformQuickType :: Maybe ([Transform]) |
| 311 | 311 | , widthQuickType :: Maybe Float |
| 312 | - , layerQuickType :: Maybe ([LayerSpec]) | |
| 312 | + , layerQuickType :: [LayerSpec] | |
| 313 | 313 | , resolveQuickType :: Maybe Resolve |
| 314 | - , facetQuickType :: Maybe FacetMapping | |
| 315 | - , specQuickType :: Maybe Spec | |
| 316 | - , repeatQuickType :: Maybe Repeat | |
| 317 | - , vconcatQuickType :: Maybe ([Spec]) | |
| 318 | - , hconcatQuickType :: Maybe ([Spec]) | |
| 314 | + , facetQuickType :: FacetMapping | |
| 315 | + , specQuickType :: Spec | |
| 316 | + , repeatQuickType :: Repeat | |
| 317 | + , vconcatQuickType :: [Spec] | |
| 318 | + , hconcatQuickType :: [Spec] | |
| 319 | 319 | } deriving (Show) |
| 320 | 320 | |
| 321 | 321 | {-| Sets how the visualization size should be determined. If a string, should be one of |
| @@ -2106,7 +2106,7 @@ data RangeConfigValue | ||
| 2106 | 2106 | data VGScheme = VGScheme |
| 2107 | 2107 | { countVGScheme :: Maybe Float |
| 2108 | 2108 | , extentVGScheme :: Maybe ([Float]) |
| 2109 | - , schemeVGScheme :: Maybe Text | |
| 2109 | + , schemeVGScheme :: Text | |
| 2110 | 2110 | , stepVGScheme :: Maybe Float |
| 2111 | 2111 | } deriving (Show) |
| 2112 | 2112 | |
| @@ -2571,7 +2571,7 @@ data SingleSelectionConfig = SingleSelectionConfig | ||
| 2571 | 2571 | data VGBinding = VGBinding |
| 2572 | 2572 | { elementVGBinding :: Maybe Text |
| 2573 | 2573 | , inputVGBinding :: Text |
| 2574 | - , optionsVGBinding :: Maybe ([Text]) | |
| 2574 | + , optionsVGBinding :: [Text] | |
| 2575 | 2575 | , maxVGBinding :: Maybe Float |
| 2576 | 2576 | , minVGBinding :: Maybe Float |
| 2577 | 2577 | , stepVGBinding :: Maybe Float |
| @@ -3325,7 +3325,7 @@ data MarkPropDefWithCondition = MarkPropDefWithCondition | ||
| 3325 | 3325 | , scaleMarkPropDefWithCondition :: Maybe Scale |
| 3326 | 3326 | , sortMarkPropDefWithCondition :: Maybe SortUnion |
| 3327 | 3327 | , timeUnitMarkPropDefWithCondition :: Maybe TimeUnit |
| 3328 | - , markPropDefWithConditionTypeMarkPropDefWithCondition :: Maybe Type | |
| 3328 | + , markPropDefWithConditionTypeMarkPropDefWithCondition :: Type | |
| 3329 | 3329 | , valueMarkPropDefWithCondition :: Maybe ConditionalValueDefValue |
| 3330 | 3330 | } deriving (Show) |
| 3331 | 3331 | |
| @@ -3441,15 +3441,15 @@ A [selection name](selection.html), or a series of [composed | ||
| 3441 | 3441 | selections](selection.html#compose). |
| 3442 | 3442 | -} |
| 3443 | 3443 | data ConditionalValueDef = ConditionalValueDef |
| 3444 | - { testConditionalValueDef :: Maybe LogicalOperandPredicate | |
| 3444 | + { testConditionalValueDef :: LogicalOperandPredicate | |
| 3445 | 3445 | , valueConditionalValueDef :: ConditionalValueDefValue |
| 3446 | - , selectionConditionalValueDef :: Maybe SelectionOperand | |
| 3446 | + , selectionConditionalValueDef :: SelectionOperand | |
| 3447 | 3447 | } deriving (Show) |
| 3448 | 3448 | |
| 3449 | 3449 | data Selection = Selection |
| 3450 | - { notSelection :: Maybe SelectionOperand | |
| 3451 | - , andSelection :: Maybe ([SelectionOperand]) | |
| 3452 | - , orSelection :: Maybe ([SelectionOperand]) | |
| 3450 | + { notSelection :: SelectionOperand | |
| 3451 | + , andSelection :: [SelectionOperand] | |
| 3452 | + , orSelection :: [SelectionOperand] | |
| 3453 | 3453 | } deriving (Show) |
| 3454 | 3454 | |
| 3455 | 3455 | {-| Filter using a selection name. |
| @@ -3487,15 +3487,15 @@ selection: | ||
| 3487 | 3487 | Filter using a selection name. |
| 3488 | 3488 | -} |
| 3489 | 3489 | data Predicate = Predicate |
| 3490 | - { notPredicate :: Maybe LogicalOperandPredicate | |
| 3491 | - , andPredicate :: Maybe ([LogicalOperandPredicate]) | |
| 3492 | - , orPredicate :: Maybe ([LogicalOperandPredicate]) | |
| 3493 | - , equalPredicate :: Maybe Equal | |
| 3494 | - , fieldPredicate :: Maybe Text | |
| 3490 | + { notPredicate :: LogicalOperandPredicate | |
| 3491 | + , andPredicate :: [LogicalOperandPredicate] | |
| 3492 | + , orPredicate :: [LogicalOperandPredicate] | |
| 3493 | + , equalPredicate :: Equal | |
| 3494 | + , fieldPredicate :: Text | |
| 3495 | 3495 | , timeUnitPredicate :: Maybe TimeUnit |
| 3496 | - , rangePredicate :: Maybe ([RangeElement]) | |
| 3497 | - , oneOfPredicate :: Maybe ([Equal]) | |
| 3498 | - , selectionPredicate :: Maybe SelectionOperand | |
| 3496 | + , rangePredicate :: [RangeElement] | |
| 3497 | + , oneOfPredicate :: [Equal] | |
| 3498 | + , selectionPredicate :: SelectionOperand | |
| 3499 | 3499 | } deriving (Show) |
| 3500 | 3500 | |
| 3501 | 3501 | {-| The `filter` property must be one of the predicate definitions: |
| @@ -3738,9 +3738,9 @@ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | ||
| 3738 | 3738 | [geographic projection](projection.html) is applied. |
| 3739 | 3739 | -} |
| 3740 | 3740 | data ConditionalPredicateMarkPropFieldDefClass = ConditionalPredicateMarkPropFieldDefClass |
| 3741 | - { testConditionalPredicateMarkPropFieldDefClass :: Maybe LogicalOperandPredicate | |
| 3742 | - , valueConditionalPredicateMarkPropFieldDefClass :: Maybe ConditionalValueDefValue | |
| 3743 | - , selectionConditionalPredicateMarkPropFieldDefClass :: Maybe SelectionOperand | |
| 3741 | + { testConditionalPredicateMarkPropFieldDefClass :: LogicalOperandPredicate | |
| 3742 | + , valueConditionalPredicateMarkPropFieldDefClass :: ConditionalValueDefValue | |
| 3743 | + , selectionConditionalPredicateMarkPropFieldDefClass :: SelectionOperand | |
| 3744 | 3744 | , aggregateConditionalPredicateMarkPropFieldDefClass :: Maybe AggregateOp |
| 3745 | 3745 | , binConditionalPredicateMarkPropFieldDefClass :: Maybe Bin |
| 3746 | 3746 | , fieldConditionalPredicateMarkPropFieldDefClass :: Maybe Field |
| @@ -3748,7 +3748,7 @@ data ConditionalPredicateMarkPropFieldDefClass = ConditionalPredicateMarkPropFie | ||
| 3748 | 3748 | , scaleConditionalPredicateMarkPropFieldDefClass :: Maybe Scale |
| 3749 | 3749 | , sortConditionalPredicateMarkPropFieldDefClass :: Maybe SortUnion |
| 3750 | 3750 | , timeUnitConditionalPredicateMarkPropFieldDefClass :: Maybe TimeUnit |
| 3751 | - , conditionalDefTypeConditionalPredicateMarkPropFieldDefClass :: Maybe Type | |
| 3751 | + , conditionalDefTypeConditionalPredicateMarkPropFieldDefClass :: Type | |
| 3752 | 3752 | } deriving (Show) |
| 3753 | 3753 | |
| 3754 | 3754 | {-| The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or |
| @@ -4558,7 +4558,7 @@ data TextDefWithCondition = TextDefWithCondition | ||
| 4558 | 4558 | , fieldTextDefWithCondition :: Maybe Field |
| 4559 | 4559 | , formatTextDefWithCondition :: Maybe Text |
| 4560 | 4560 | , timeUnitTextDefWithCondition :: Maybe TimeUnit |
| 4561 | - , textDefWithConditionTypeTextDefWithCondition :: Maybe Type | |
| 4561 | + , textDefWithConditionTypeTextDefWithCondition :: Type | |
| 4562 | 4562 | , valueTextDefWithCondition :: Maybe ConditionalValueDefValue |
| 4563 | 4563 | } deriving (Show) |
| 4564 | 4564 | |
| @@ -4617,15 +4617,15 @@ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | ||
| 4617 | 4617 | [geographic projection](projection.html) is applied. |
| 4618 | 4618 | -} |
| 4619 | 4619 | data ConditionalPredicateTextFieldDefClass = ConditionalPredicateTextFieldDefClass |
| 4620 | - { testConditionalPredicateTextFieldDefClass :: Maybe LogicalOperandPredicate | |
| 4621 | - , valueConditionalPredicateTextFieldDefClass :: Maybe ConditionalValueDefValue | |
| 4622 | - , selectionConditionalPredicateTextFieldDefClass :: Maybe SelectionOperand | |
| 4620 | + { testConditionalPredicateTextFieldDefClass :: LogicalOperandPredicate | |
| 4621 | + , valueConditionalPredicateTextFieldDefClass :: ConditionalValueDefValue | |
| 4622 | + , selectionConditionalPredicateTextFieldDefClass :: SelectionOperand | |
| 4623 | 4623 | , aggregateConditionalPredicateTextFieldDefClass :: Maybe AggregateOp |
| 4624 | 4624 | , binConditionalPredicateTextFieldDefClass :: Maybe Bin |
| 4625 | 4625 | , fieldConditionalPredicateTextFieldDefClass :: Maybe Field |
| 4626 | 4626 | , formatConditionalPredicateTextFieldDefClass :: Maybe Text |
| 4627 | 4627 | , timeUnitConditionalPredicateTextFieldDefClass :: Maybe TimeUnit |
| 4628 | - , conditionalDefTypeConditionalPredicateTextFieldDefClass :: Maybe Type | |
| 4628 | + , conditionalDefTypeConditionalPredicateTextFieldDefClass :: Type | |
| 4629 | 4629 | } deriving (Show) |
| 4630 | 4630 | |
| 4631 | 4631 | {-| A URL to load upon mouse click. |
| @@ -4698,7 +4698,7 @@ data DefWithCondition = DefWithCondition | ||
| 4698 | 4698 | , conditionDefWithCondition :: Maybe HrefCondition |
| 4699 | 4699 | , fieldDefWithCondition :: Maybe Field |
| 4700 | 4700 | , timeUnitDefWithCondition :: Maybe TimeUnit |
| 4701 | - , defWithConditionTypeDefWithCondition :: Maybe Type | |
| 4701 | + , defWithConditionTypeDefWithCondition :: Type | |
| 4702 | 4702 | , valueDefWithCondition :: Maybe ConditionalValueDefValue |
| 4703 | 4703 | } deriving (Show) |
| 4704 | 4704 | |
| @@ -4753,14 +4753,14 @@ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | ||
| 4753 | 4753 | [geographic projection](projection.html) is applied. |
| 4754 | 4754 | -} |
| 4755 | 4755 | data ConditionalPredicateFieldDefClass = ConditionalPredicateFieldDefClass |
| 4756 | - { testConditionalPredicateFieldDefClass :: Maybe LogicalOperandPredicate | |
| 4757 | - , valueConditionalPredicateFieldDefClass :: Maybe ConditionalValueDefValue | |
| 4758 | - , selectionConditionalPredicateFieldDefClass :: Maybe SelectionOperand | |
| 4756 | + { testConditionalPredicateFieldDefClass :: LogicalOperandPredicate | |
| 4757 | + , valueConditionalPredicateFieldDefClass :: ConditionalValueDefValue | |
| 4758 | + , selectionConditionalPredicateFieldDefClass :: SelectionOperand | |
| 4759 | 4759 | , aggregateConditionalPredicateFieldDefClass :: Maybe AggregateOp |
| 4760 | 4760 | , binConditionalPredicateFieldDefClass :: Maybe Bin |
| 4761 | 4761 | , fieldConditionalPredicateFieldDefClass :: Maybe Field |
| 4762 | 4762 | , timeUnitConditionalPredicateFieldDefClass :: Maybe TimeUnit |
| 4763 | - , conditionalDefTypeConditionalPredicateFieldDefClass :: Maybe Type | |
| 4763 | + , conditionalDefTypeConditionalPredicateFieldDefClass :: Type | |
| 4764 | 4764 | } deriving (Show) |
| 4765 | 4765 | |
| 4766 | 4766 | data Order |
| @@ -4916,8 +4916,8 @@ data XClass = XClass | ||
| 4916 | 4916 | , sortXClass :: Maybe SortUnion |
| 4917 | 4917 | , stackXClass :: Maybe StackOffset |
| 4918 | 4918 | , timeUnitXClass :: Maybe TimeUnit |
| 4919 | - , defTypeXClass :: Maybe Type | |
| 4920 | - , valueXClass :: Maybe ConditionalValueDefValue | |
| 4919 | + , defTypeXClass :: Type | |
| 4920 | + , valueXClass :: ConditionalValueDefValue | |
| 4921 | 4921 | } deriving (Show) |
| 4922 | 4922 | |
| 4923 | 4923 | {-| domain: |
| @@ -5146,8 +5146,8 @@ data X2Class = X2Class | ||
| 5146 | 5146 | , binX2Class :: Maybe Bin |
| 5147 | 5147 | , fieldX2Class :: Maybe Field |
| 5148 | 5148 | , timeUnitX2Class :: Maybe TimeUnit |
| 5149 | - , defTypeX2Class :: Maybe Type | |
| 5150 | - , valueX2Class :: Maybe ConditionalValueDefValue | |
| 5149 | + , defTypeX2Class :: Type | |
| 5150 | + , valueX2Class :: ConditionalValueDefValue | |
| 5151 | 5151 | } deriving (Show) |
| 5152 | 5152 | |
| 5153 | 5153 | {-| An object that describes mappings between `row` and `column` channels and their field |
| @@ -5278,21 +5278,21 @@ data Spec = Spec | ||
| 5278 | 5278 | { specDataSpec :: Maybe Data |
| 5279 | 5279 | , descriptionSpec :: Maybe Text |
| 5280 | 5280 | , heightSpec :: Maybe Float |
| 5281 | - , layerSpec :: Maybe ([LayerSpec]) | |
| 5281 | + , layerSpec :: [LayerSpec] | |
| 5282 | 5282 | , nameSpec :: Maybe Text |
| 5283 | 5283 | , resolveSpec :: Maybe Resolve |
| 5284 | 5284 | , titleSpec :: Maybe Title |
| 5285 | 5285 | , transformSpec :: Maybe ([Transform]) |
| 5286 | 5286 | , widthSpec :: Maybe Float |
| 5287 | - , encodingSpec :: Maybe Encoding | |
| 5288 | - , markSpec :: Maybe AnyMark | |
| 5287 | + , encodingSpec :: Encoding | |
| 5288 | + , markSpec :: AnyMark | |
| 5289 | 5289 | , projectionSpec :: Maybe Projection |
| 5290 | 5290 | , selectionSpec :: Maybe (HashMap Text SelectionDef) |
| 5291 | - , facetSpec :: Maybe FacetMapping | |
| 5292 | - , specSpec :: Maybe Spec | |
| 5293 | - , repeatSpec :: Maybe Repeat | |
| 5294 | - , vconcatSpec :: Maybe ([Spec]) | |
| 5295 | - , hconcatSpec :: Maybe ([Spec]) | |
| 5291 | + , facetSpec :: FacetMapping | |
| 5292 | + , specSpec :: Spec | |
| 5293 | + , repeatSpec :: Repeat | |
| 5294 | + , vconcatSpec :: [Spec] | |
| 5295 | + , hconcatSpec :: [Spec] | |
| 5296 | 5296 | } deriving (Show) |
| 5297 | 5297 | |
| 5298 | 5298 | {-| A key-value mapping between encoding channels and definition of fields. |
| @@ -5467,14 +5467,14 @@ data LayerSpec = LayerSpec | ||
| 5467 | 5467 | { layerSpecDataLayerSpec :: Maybe Data |
| 5468 | 5468 | , descriptionLayerSpec :: Maybe Text |
| 5469 | 5469 | , heightLayerSpec :: Maybe Float |
| 5470 | - , layerLayerSpec :: Maybe ([LayerSpec]) | |
| 5470 | + , layerLayerSpec :: [LayerSpec] | |
| 5471 | 5471 | , nameLayerSpec :: Maybe Text |
| 5472 | 5472 | , resolveLayerSpec :: Maybe Resolve |
| 5473 | 5473 | , titleLayerSpec :: Maybe Title |
| 5474 | 5474 | , transformLayerSpec :: Maybe ([Transform]) |
| 5475 | 5475 | , widthLayerSpec :: Maybe Float |
| 5476 | - , encodingLayerSpec :: Maybe Encoding | |
| 5477 | - , markLayerSpec :: Maybe AnyMark | |
| 5476 | + , encodingLayerSpec :: Encoding | |
| 5477 | + , markLayerSpec :: AnyMark | |
| 5478 | 5478 | , projectionLayerSpec :: Maybe Projection |
| 5479 | 5479 | , selectionLayerSpec :: Maybe (HashMap Text SelectionDef) |
| 5480 | 5480 | } deriving (Show) |
| @@ -5505,9 +5505,9 @@ Provide a placeholder name and bind data at runtime. | ||
| 5505 | 5505 | -} |
| 5506 | 5506 | data Data = Data |
| 5507 | 5507 | { formatData :: Maybe DataFormat |
| 5508 | - , urlData :: Maybe Text | |
| 5509 | - , valuesData :: Maybe Values | |
| 5510 | - , nameData :: Maybe Text | |
| 5508 | + , urlData :: Text | |
| 5509 | + , valuesData :: Values | |
| 5510 | + , nameData :: Text | |
| 5511 | 5511 | } deriving (Show) |
| 5512 | 5512 | |
| 5513 | 5513 | {-| An object that specifies the format for parsing the data file. |
| @@ -6174,16 +6174,16 @@ The data fields to group by. If not specified, a single group containing all dat | ||
| 6174 | 6174 | will be used. |
| 6175 | 6175 | -} |
| 6176 | 6176 | data Transform = Transform |
| 6177 | - { filterTransform :: Maybe LogicalOperandPredicate | |
| 6177 | + { filterTransform :: LogicalOperandPredicate | |
| 6178 | 6178 | , transformAsTransform :: Maybe Style |
| 6179 | - , calculateTransform :: Maybe Text | |
| 6179 | + , calculateTransform :: Text | |
| 6180 | 6180 | , transformDefaultTransform :: Maybe Text |
| 6181 | - , fromTransform :: Maybe LookupData | |
| 6182 | - , lookupTransform :: Maybe Text | |
| 6183 | - , binTransform :: Maybe Bin | |
| 6184 | - , fieldTransform :: Maybe Text | |
| 6185 | - , timeUnitTransform :: Maybe TimeUnit | |
| 6186 | - , aggregateTransform :: Maybe ([AggregatedFieldDef]) | |
| 6181 | + , fromTransform :: LookupData | |
| 6182 | + , lookupTransform :: Text | |
| 6183 | + , binTransform :: Bin | |
| 6184 | + , fieldTransform :: Text | |
| 6185 | + , timeUnitTransform :: TimeUnit | |
| 6186 | + , aggregateTransform :: [AggregatedFieldDef] | |
| 6187 | 6187 | , groupbyTransform :: Maybe ([Text]) |
| 6188 | 6188 | } deriving (Show) |
| 6189 | 6189 | |
| @@ -6276,9 +6276,9 @@ instance FromJSON QuickType where | ||
| 6276 | 6276 | <*> v .:? "config" |
| 6277 | 6277 | <*> v .:? "data" |
| 6278 | 6278 | <*> v .:? "description" |
| 6279 | - <*> v .:? "encoding" | |
| 6279 | + <*> v .: "encoding" | |
| 6280 | 6280 | <*> v .:? "height" |
| 6281 | - <*> v .:? "mark" | |
| 6281 | + <*> v .: "mark" | |
| 6282 | 6282 | <*> v .:? "name" |
| 6283 | 6283 | <*> v .:? "padding" |
| 6284 | 6284 | <*> v .:? "projection" |
| @@ -6286,13 +6286,13 @@ instance FromJSON QuickType where | ||
| 6286 | 6286 | <*> v .:? "title" |
| 6287 | 6287 | <*> v .:? "transform" |
| 6288 | 6288 | <*> v .:? "width" |
| 6289 | - <*> v .:? "layer" | |
| 6289 | + <*> v .: "layer" | |
| 6290 | 6290 | <*> v .:? "resolve" |
| 6291 | - <*> v .:? "facet" | |
| 6292 | - <*> v .:? "spec" | |
| 6293 | - <*> v .:? "repeat" | |
| 6294 | - <*> v .:? "vconcat" | |
| 6295 | - <*> v .:? "hconcat" | |
| 6291 | + <*> v .: "facet" | |
| 6292 | + <*> v .: "spec" | |
| 6293 | + <*> v .: "repeat" | |
| 6294 | + <*> v .: "vconcat" | |
| 6295 | + <*> v .: "hconcat" | |
| 6296 | 6296 | |
| 6297 | 6297 | instance ToJSON Autosize where |
| 6298 | 6298 | toJSON (AutoSizeParamsInAutosize x) = toJSON x |
| @@ -7243,7 +7243,7 @@ instance FromJSON VGScheme where | ||
| 7243 | 7243 | parseJSON (Object v) = VGScheme |
| 7244 | 7244 | <$> v .:? "count" |
| 7245 | 7245 | <*> v .:? "extent" |
| 7246 | - <*> v .:? "scheme" | |
| 7246 | + <*> v .: "scheme" | |
| 7247 | 7247 | <*> v .:? "step" |
| 7248 | 7248 | |
| 7249 | 7249 | instance ToJSON ScaleConfig where |
| @@ -7483,7 +7483,7 @@ instance FromJSON VGBinding where | ||
| 7483 | 7483 | parseJSON (Object v) = VGBinding |
| 7484 | 7484 | <$> v .:? "element" |
| 7485 | 7485 | <*> v .: "input" |
| 7486 | - <*> v .:? "options" | |
| 7486 | + <*> v .: "options" | |
| 7487 | 7487 | <*> v .:? "max" |
| 7488 | 7488 | <*> v .:? "min" |
| 7489 | 7489 | <*> v .:? "step" |
| @@ -7781,7 +7781,7 @@ instance FromJSON MarkPropDefWithCondition where | ||
| 7781 | 7781 | <*> v .:? "scale" |
| 7782 | 7782 | <*> v .:? "sort" |
| 7783 | 7783 | <*> v .:? "timeUnit" |
| 7784 | - <*> v .:? "type" | |
| 7784 | + <*> v .: "type" | |
| 7785 | 7785 | <*> v .:? "value" |
| 7786 | 7786 | |
| 7787 | 7787 | instance ToJSON AggregateOp where |
| @@ -7882,9 +7882,9 @@ instance ToJSON ConditionalValueDef where | ||
| 7882 | 7882 | |
| 7883 | 7883 | instance FromJSON ConditionalValueDef where |
| 7884 | 7884 | parseJSON (Object v) = ConditionalValueDef |
| 7885 | - <$> v .:? "test" | |
| 7885 | + <$> v .: "test" | |
| 7886 | 7886 | <*> v .: "value" |
| 7887 | - <*> v .:? "selection" | |
| 7887 | + <*> v .: "selection" | |
| 7888 | 7888 | |
| 7889 | 7889 | instance ToJSON Selection where |
| 7890 | 7890 | toJSON (Selection notSelection andSelection orSelection) = |
| @@ -7896,9 +7896,9 @@ instance ToJSON Selection where | ||
| 7896 | 7896 | |
| 7897 | 7897 | instance FromJSON Selection where |
| 7898 | 7898 | parseJSON (Object v) = Selection |
| 7899 | - <$> v .:? "not" | |
| 7900 | - <*> v .:? "and" | |
| 7901 | - <*> v .:? "or" | |
| 7899 | + <$> v .: "not" | |
| 7900 | + <*> v .: "and" | |
| 7901 | + <*> v .: "or" | |
| 7902 | 7902 | |
| 7903 | 7903 | instance ToJSON SelectionOperand where |
| 7904 | 7904 | toJSON (SelectionInSelectionOperand x) = toJSON x |
| @@ -7924,15 +7924,15 @@ instance ToJSON Predicate where | ||
| 7924 | 7924 | |
| 7925 | 7925 | instance FromJSON Predicate where |
| 7926 | 7926 | parseJSON (Object v) = Predicate |
| 7927 | - <$> v .:? "not" | |
| 7928 | - <*> v .:? "and" | |
| 7929 | - <*> v .:? "or" | |
| 7930 | - <*> v .:? "equal" | |
| 7931 | - <*> v .:? "field" | |
| 7927 | + <$> v .: "not" | |
| 7928 | + <*> v .: "and" | |
| 7929 | + <*> v .: "or" | |
| 7930 | + <*> v .: "equal" | |
| 7931 | + <*> v .: "field" | |
| 7932 | 7932 | <*> v .:? "timeUnit" |
| 7933 | - <*> v .:? "range" | |
| 7934 | - <*> v .:? "oneOf" | |
| 7935 | - <*> v .:? "selection" | |
| 7933 | + <*> v .: "range" | |
| 7934 | + <*> v .: "oneOf" | |
| 7935 | + <*> v .: "selection" | |
| 7936 | 7936 | |
| 7937 | 7937 | instance ToJSON LogicalOperandPredicate where |
| 7938 | 7938 | toJSON (PredicateInLogicalOperandPredicate x) = toJSON x |
| @@ -8130,9 +8130,9 @@ instance ToJSON ConditionalPredicateMarkPropFieldDefClass where | ||
| 8130 | 8130 | |
| 8131 | 8131 | instance FromJSON ConditionalPredicateMarkPropFieldDefClass where |
| 8132 | 8132 | parseJSON (Object v) = ConditionalPredicateMarkPropFieldDefClass |
| 8133 | - <$> v .:? "test" | |
| 8134 | - <*> v .:? "value" | |
| 8135 | - <*> v .:? "selection" | |
| 8133 | + <$> v .: "test" | |
| 8134 | + <*> v .: "value" | |
| 8135 | + <*> v .: "selection" | |
| 8136 | 8136 | <*> v .:? "aggregate" |
| 8137 | 8137 | <*> v .:? "bin" |
| 8138 | 8138 | <*> v .:? "field" |
| @@ -8140,7 +8140,7 @@ instance FromJSON ConditionalPredicateMarkPropFieldDefClass where | ||
| 8140 | 8140 | <*> v .:? "scale" |
| 8141 | 8141 | <*> v .:? "sort" |
| 8142 | 8142 | <*> v .:? "timeUnit" |
| 8143 | - <*> v .:? "type" | |
| 8143 | + <*> v .: "type" | |
| 8144 | 8144 | |
| 8145 | 8145 | instance ToJSON Type where |
| 8146 | 8146 | toJSON QuantitativeType = "quantitative" |
| @@ -8559,7 +8559,7 @@ instance FromJSON TextDefWithCondition where | ||
| 8559 | 8559 | <*> v .:? "field" |
| 8560 | 8560 | <*> v .:? "format" |
| 8561 | 8561 | <*> v .:? "timeUnit" |
| 8562 | - <*> v .:? "type" | |
| 8562 | + <*> v .: "type" | |
| 8563 | 8563 | <*> v .:? "value" |
| 8564 | 8564 | |
| 8565 | 8565 | instance ToJSON TextCondition where |
| @@ -8586,15 +8586,15 @@ instance ToJSON ConditionalPredicateTextFieldDefClass where | ||
| 8586 | 8586 | |
| 8587 | 8587 | instance FromJSON ConditionalPredicateTextFieldDefClass where |
| 8588 | 8588 | parseJSON (Object v) = ConditionalPredicateTextFieldDefClass |
| 8589 | - <$> v .:? "test" | |
| 8590 | - <*> v .:? "value" | |
| 8591 | - <*> v .:? "selection" | |
| 8589 | + <$> v .: "test" | |
| 8590 | + <*> v .: "value" | |
| 8591 | + <*> v .: "selection" | |
| 8592 | 8592 | <*> v .:? "aggregate" |
| 8593 | 8593 | <*> v .:? "bin" |
| 8594 | 8594 | <*> v .:? "field" |
| 8595 | 8595 | <*> v .:? "format" |
| 8596 | 8596 | <*> v .:? "timeUnit" |
| 8597 | - <*> v .:? "type" | |
| 8597 | + <*> v .: "type" | |
| 8598 | 8598 | |
| 8599 | 8599 | instance ToJSON DefWithCondition where |
| 8600 | 8600 | toJSON (DefWithCondition aggregateDefWithCondition binDefWithCondition conditionDefWithCondition fieldDefWithCondition timeUnitDefWithCondition defWithConditionTypeDefWithCondition valueDefWithCondition) = |
| @@ -8615,7 +8615,7 @@ instance FromJSON DefWithCondition where | ||
| 8615 | 8615 | <*> v .:? "condition" |
| 8616 | 8616 | <*> v .:? "field" |
| 8617 | 8617 | <*> v .:? "timeUnit" |
| 8618 | - <*> v .:? "type" | |
| 8618 | + <*> v .: "type" | |
| 8619 | 8619 | <*> v .:? "value" |
| 8620 | 8620 | |
| 8621 | 8621 | instance ToJSON HrefCondition where |
| @@ -8641,14 +8641,14 @@ instance ToJSON ConditionalPredicateFieldDefClass where | ||
| 8641 | 8641 | |
| 8642 | 8642 | instance FromJSON ConditionalPredicateFieldDefClass where |
| 8643 | 8643 | parseJSON (Object v) = ConditionalPredicateFieldDefClass |
| 8644 | - <$> v .:? "test" | |
| 8645 | - <*> v .:? "value" | |
| 8646 | - <*> v .:? "selection" | |
| 8644 | + <$> v .: "test" | |
| 8645 | + <*> v .: "value" | |
| 8646 | + <*> v .: "selection" | |
| 8647 | 8647 | <*> v .:? "aggregate" |
| 8648 | 8648 | <*> v .:? "bin" |
| 8649 | 8649 | <*> v .:? "field" |
| 8650 | 8650 | <*> v .:? "timeUnit" |
| 8651 | - <*> v .:? "type" | |
| 8651 | + <*> v .: "type" | |
| 8652 | 8652 | |
| 8653 | 8653 | instance ToJSON Order where |
| 8654 | 8654 | toJSON (OrderFieldDefArrayInOrder x) = toJSON x |
| @@ -8703,8 +8703,8 @@ instance FromJSON XClass where | ||
| 8703 | 8703 | <*> v .:? "sort" |
| 8704 | 8704 | <*> v .:? "stack" |
| 8705 | 8705 | <*> v .:? "timeUnit" |
| 8706 | - <*> v .:? "type" | |
| 8707 | - <*> v .:? "value" | |
| 8706 | + <*> v .: "type" | |
| 8707 | + <*> v .: "value" | |
| 8708 | 8708 | |
| 8709 | 8709 | instance ToJSON Axis where |
| 8710 | 8710 | toJSON (Axis domainAxis formatAxis gridAxis labelAngleAxis labelBoundAxis labelFlushAxis labelOverlapAxis labelPaddingAxis labelsAxis maxExtentAxis minExtentAxis offsetAxis orientAxis positionAxis tickCountAxis ticksAxis tickSizeAxis titleAxis titleMaxLengthAxis titlePaddingAxis valuesAxis zindexAxis) = |
| @@ -8783,8 +8783,8 @@ instance FromJSON X2Class where | ||
| 8783 | 8783 | <*> v .:? "bin" |
| 8784 | 8784 | <*> v .:? "field" |
| 8785 | 8785 | <*> v .:? "timeUnit" |
| 8786 | - <*> v .:? "type" | |
| 8787 | - <*> v .:? "value" | |
| 8786 | + <*> v .: "type" | |
| 8787 | + <*> v .: "value" | |
| 8788 | 8788 | |
| 8789 | 8789 | instance ToJSON FacetMapping where |
| 8790 | 8790 | toJSON (FacetMapping columnFacetMapping rowFacetMapping) = |
| @@ -8826,21 +8826,21 @@ instance FromJSON Spec where | ||
| 8826 | 8826 | <$> v .:? "data" |
| 8827 | 8827 | <*> v .:? "description" |
| 8828 | 8828 | <*> v .:? "height" |
| 8829 | - <*> v .:? "layer" | |
| 8829 | + <*> v .: "layer" | |
| 8830 | 8830 | <*> v .:? "name" |
| 8831 | 8831 | <*> v .:? "resolve" |
| 8832 | 8832 | <*> v .:? "title" |
| 8833 | 8833 | <*> v .:? "transform" |
| 8834 | 8834 | <*> v .:? "width" |
| 8835 | - <*> v .:? "encoding" | |
| 8836 | - <*> v .:? "mark" | |
| 8835 | + <*> v .: "encoding" | |
| 8836 | + <*> v .: "mark" | |
| 8837 | 8837 | <*> v .:? "projection" |
| 8838 | 8838 | <*> v .:? "selection" |
| 8839 | - <*> v .:? "facet" | |
| 8840 | - <*> v .:? "spec" | |
| 8841 | - <*> v .:? "repeat" | |
| 8842 | - <*> v .:? "vconcat" | |
| 8843 | - <*> v .:? "hconcat" | |
| 8839 | + <*> v .: "facet" | |
| 8840 | + <*> v .: "spec" | |
| 8841 | + <*> v .: "repeat" | |
| 8842 | + <*> v .: "vconcat" | |
| 8843 | + <*> v .: "hconcat" | |
| 8844 | 8844 | |
| 8845 | 8845 | instance ToJSON Encoding where |
| 8846 | 8846 | toJSON (Encoding colorEncoding detailEncoding hrefEncoding opacityEncoding orderEncoding shapeEncoding sizeEncoding encodingTextEncoding tooltipEncoding xEncoding x2Encoding yEncoding y2Encoding) = |
| @@ -8899,14 +8899,14 @@ instance FromJSON LayerSpec where | ||
| 8899 | 8899 | <$> v .:? "data" |
| 8900 | 8900 | <*> v .:? "description" |
| 8901 | 8901 | <*> v .:? "height" |
| 8902 | - <*> v .:? "layer" | |
| 8902 | + <*> v .: "layer" | |
| 8903 | 8903 | <*> v .:? "name" |
| 8904 | 8904 | <*> v .:? "resolve" |
| 8905 | 8905 | <*> v .:? "title" |
| 8906 | 8906 | <*> v .:? "transform" |
| 8907 | 8907 | <*> v .:? "width" |
| 8908 | - <*> v .:? "encoding" | |
| 8909 | - <*> v .:? "mark" | |
| 8908 | + <*> v .: "encoding" | |
| 8909 | + <*> v .: "mark" | |
| 8910 | 8910 | <*> v .:? "projection" |
| 8911 | 8911 | <*> v .:? "selection" |
| 8912 | 8912 | |
| @@ -8922,9 +8922,9 @@ instance ToJSON Data where | ||
| 8922 | 8922 | instance FromJSON Data where |
| 8923 | 8923 | parseJSON (Object v) = Data |
| 8924 | 8924 | <$> v .:? "format" |
| 8925 | - <*> v .:? "url" | |
| 8926 | - <*> v .:? "values" | |
| 8927 | - <*> v .:? "name" | |
| 8925 | + <*> v .: "url" | |
| 8926 | + <*> v .: "values" | |
| 8927 | + <*> v .: "name" | |
| 8928 | 8928 | |
| 8929 | 8929 | instance ToJSON DataFormat where |
| 8930 | 8930 | toJSON (DataFormat parseDataFormat dataFormatTypeDataFormat propertyDataFormat featureDataFormat meshDataFormat) = |
| @@ -9320,16 +9320,16 @@ instance ToJSON Transform where | ||
| 9320 | 9320 | |
| 9321 | 9321 | instance FromJSON Transform where |
| 9322 | 9322 | parseJSON (Object v) = Transform |
| 9323 | - <$> v .:? "filter" | |
| 9323 | + <$> v .: "filter" | |
| 9324 | 9324 | <*> v .:? "as" |
| 9325 | - <*> v .:? "calculate" | |
| 9325 | + <*> v .: "calculate" | |
| 9326 | 9326 | <*> v .:? "default" |
| 9327 | - <*> v .:? "from" | |
| 9328 | - <*> v .:? "lookup" | |
| 9329 | - <*> v .:? "bin" | |
| 9330 | - <*> v .:? "field" | |
| 9331 | - <*> v .:? "timeUnit" | |
| 9332 | - <*> v .:? "aggregate" | |
| 9327 | + <*> v .: "from" | |
| 9328 | + <*> v .: "lookup" | |
| 9329 | + <*> v .: "bin" | |
| 9330 | + <*> v .: "field" | |
| 9331 | + <*> v .: "timeUnit" | |
| 9332 | + <*> v .: "aggregate" | |
| 9333 | 9333 | <*> v .:? "groupby" |
| 9334 | 9334 | |
| 9335 | 9335 | instance ToJSON AggregatedFieldDef where |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / AnyMark.java+1 −3
| @@ -24,8 +24,6 @@ public class AnyMark { | ||
| 24 | 24 | public AnyMark deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { |
| 25 | 25 | AnyMark value = new AnyMark(); |
| 26 | 26 | switch (jsonParser.currentToken()) { |
| 27 | - case VALUE_NULL: | |
| 28 | - break; | |
| 29 | 27 | case VALUE_STRING: |
| 30 | 28 | String string = jsonParser.readValueAs(String.class); |
| 31 | 29 | try { |
| @@ -54,7 +52,7 @@ public class AnyMark { | ||
| 54 | 52 | jsonGenerator.writeObject(obj.enumValue); |
| 55 | 53 | return; |
| 56 | 54 | } |
| 57 | - jsonGenerator.writeNull(); | |
| 55 | + throw new IOException("AnyMark must not be null"); | |
| 58 | 56 | } |
| 59 | 57 | } |
| 60 | 58 | } |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / Bin.java+0 −50
| @@ -1,50 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -@JsonDeserialize(using = Bin.Deserializer.class) | |
| 11 | -@JsonSerialize(using = Bin.Serializer.class) | |
| 12 | -public class Bin { | |
| 13 | - public Boolean boolValue; | |
| 14 | - public BinParams binParamsValue; | |
| 15 | - | |
| 16 | - static class Deserializer extends JsonDeserializer<Bin> { | |
| 17 | - @Override | |
| 18 | - public Bin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | - Bin value = new Bin(); | |
| 20 | - switch (jsonParser.currentToken()) { | |
| 21 | - case VALUE_NULL: | |
| 22 | - break; | |
| 23 | - case VALUE_TRUE: | |
| 24 | - case VALUE_FALSE: | |
| 25 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 26 | - break; | |
| 27 | - case START_OBJECT: | |
| 28 | - value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 29 | - break; | |
| 30 | - default: throw new IOException("Cannot deserialize Bin"); | |
| 31 | - } | |
| 32 | - return value; | |
| 33 | - } | |
| 34 | - } | |
| 35 | - | |
| 36 | - static class Serializer extends JsonSerializer<Bin> { | |
| 37 | - @Override | |
| 38 | - public void serialize(Bin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | - if (obj.boolValue != null) { | |
| 40 | - jsonGenerator.writeObject(obj.boolValue); | |
| 41 | - return; | |
| 42 | - } | |
| 43 | - if (obj.binParamsValue != null) { | |
| 44 | - jsonGenerator.writeObject(obj.binParamsValue); | |
| 45 | - return; | |
| 46 | - } | |
| 47 | - jsonGenerator.writeNull(); | |
| 48 | - } | |
| 49 | - } | |
| 50 | -} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / ColorBin.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = ColorBin.Deserializer.class) | |
| 11 | +@JsonSerialize(using = ColorBin.Serializer.class) | |
| 12 | +public class ColorBin { | |
| 13 | + public Boolean boolValue; | |
| 14 | + public BinParams binParamsValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<ColorBin> { | |
| 17 | + @Override | |
| 18 | + public ColorBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + ColorBin value = new ColorBin(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_TRUE: | |
| 24 | + case VALUE_FALSE: | |
| 25 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize ColorBin"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<ColorBin> { | |
| 37 | + @Override | |
| 38 | + public void serialize(ColorBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.boolValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.boolValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.binParamsValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.binParamsValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / ColorValue.java+66 −0
| @@ -0,0 +1,66 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 12 | + * `0` to `1` for opacity). | |
| 13 | + * | |
| 14 | + * A constant value in visual domain. | |
| 15 | + */ | |
| 16 | +@JsonDeserialize(using = ColorValue.Deserializer.class) | |
| 17 | +@JsonSerialize(using = ColorValue.Serializer.class) | |
| 18 | +public class ColorValue { | |
| 19 | + public Double doubleValue; | |
| 20 | + public Boolean boolValue; | |
| 21 | + public String stringValue; | |
| 22 | + | |
| 23 | + static class Deserializer extends JsonDeserializer<ColorValue> { | |
| 24 | + @Override | |
| 25 | + public ColorValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 26 | + ColorValue value = new ColorValue(); | |
| 27 | + switch (jsonParser.currentToken()) { | |
| 28 | + case VALUE_NULL: | |
| 29 | + break; | |
| 30 | + case VALUE_NUMBER_INT: | |
| 31 | + case VALUE_NUMBER_FLOAT: | |
| 32 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 33 | + break; | |
| 34 | + case VALUE_TRUE: | |
| 35 | + case VALUE_FALSE: | |
| 36 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 37 | + break; | |
| 38 | + case VALUE_STRING: | |
| 39 | + String string = jsonParser.readValueAs(String.class); | |
| 40 | + value.stringValue = string; | |
| 41 | + break; | |
| 42 | + default: throw new IOException("Cannot deserialize ColorValue"); | |
| 43 | + } | |
| 44 | + return value; | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + static class Serializer extends JsonSerializer<ColorValue> { | |
| 49 | + @Override | |
| 50 | + public void serialize(ColorValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 51 | + if (obj.doubleValue != null) { | |
| 52 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + if (obj.boolValue != null) { | |
| 56 | + jsonGenerator.writeObject(obj.boolValue); | |
| 57 | + return; | |
| 58 | + } | |
| 59 | + if (obj.stringValue != null) { | |
| 60 | + jsonGenerator.writeObject(obj.stringValue); | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + jsonGenerator.writeNull(); | |
| 64 | + } | |
| 65 | + } | |
| 66 | +} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateFieldDefClass.java+12 −12
| @@ -3,37 +3,37 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private Type type; |
| 14 | 14 | |
| 15 | 15 | @JsonProperty("test") |
| 16 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 16 | + public LogicalOperandPredicate getTest() { return test; } | |
| 17 | 17 | @JsonProperty("test") |
| 18 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 18 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 22 | 22 | * `0` to `1` for opacity). |
| 23 | 23 | */ |
| 24 | 24 | @JsonProperty("value") |
| 25 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 25 | + public ConditionalValueDefValue getValue() { return value; } | |
| 26 | 26 | @JsonProperty("value") |
| 27 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 27 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * A [selection name](selection.html), or a series of [composed |
| 31 | 31 | * selections](selection.html#compose). |
| 32 | 32 | */ |
| 33 | 33 | @JsonProperty("selection") |
| 34 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 34 | + public SelectionOperand getSelection() { return selection; } | |
| 35 | 35 | @JsonProperty("selection") |
| 36 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 36 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Aggregation function for the field |
| @@ -54,9 +54,9 @@ public class ConditionalPredicateFieldDefClass { | ||
| 54 | 54 | * __Default value:__ `false` |
| 55 | 55 | */ |
| 56 | 56 | @JsonProperty("bin") |
| 57 | - public Bin getBin() { return bin; } | |
| 57 | + public ColorBin getBin() { return bin; } | |
| 58 | 58 | @JsonProperty("bin") |
| 59 | - public void setBin(Bin value) { this.bin = value; } | |
| 59 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateMarkPropFieldDefClass.java+12 −12
| @@ -3,11 +3,11 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateMarkPropFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private Legend legend; |
| 13 | 13 | private Scale scale; |
| @@ -16,27 +16,27 @@ public class ConditionalPredicateMarkPropFieldDefClass { | ||
| 16 | 16 | private Type type; |
| 17 | 17 | |
| 18 | 18 | @JsonProperty("test") |
| 19 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 19 | + public LogicalOperandPredicate getTest() { return test; } | |
| 20 | 20 | @JsonProperty("test") |
| 21 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 21 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 25 | 25 | * `0` to `1` for opacity). |
| 26 | 26 | */ |
| 27 | 27 | @JsonProperty("value") |
| 28 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 28 | + public ConditionalValueDefValue getValue() { return value; } | |
| 29 | 29 | @JsonProperty("value") |
| 30 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 30 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * A [selection name](selection.html), or a series of [composed |
| 34 | 34 | * selections](selection.html#compose). |
| 35 | 35 | */ |
| 36 | 36 | @JsonProperty("selection") |
| 37 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 37 | + public SelectionOperand getSelection() { return selection; } | |
| 38 | 38 | @JsonProperty("selection") |
| 39 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 39 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Aggregation function for the field |
| @@ -57,9 +57,9 @@ public class ConditionalPredicateMarkPropFieldDefClass { | ||
| 57 | 57 | * __Default value:__ `false` |
| 58 | 58 | */ |
| 59 | 59 | @JsonProperty("bin") |
| 60 | - public Bin getBin() { return bin; } | |
| 60 | + public ColorBin getBin() { return bin; } | |
| 61 | 61 | @JsonProperty("bin") |
| 62 | - public void setBin(Bin value) { this.bin = value; } | |
| 62 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateTextFieldDefClass.java+12 −12
| @@ -3,38 +3,38 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateTextFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private String format; |
| 13 | 13 | private TimeUnit timeUnit; |
| 14 | 14 | private Type type; |
| 15 | 15 | |
| 16 | 16 | @JsonProperty("test") |
| 17 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 17 | + public LogicalOperandPredicate getTest() { return test; } | |
| 18 | 18 | @JsonProperty("test") |
| 19 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 19 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 23 | 23 | * `0` to `1` for opacity). |
| 24 | 24 | */ |
| 25 | 25 | @JsonProperty("value") |
| 26 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 26 | + public ConditionalValueDefValue getValue() { return value; } | |
| 27 | 27 | @JsonProperty("value") |
| 28 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 28 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * A [selection name](selection.html), or a series of [composed |
| 32 | 32 | * selections](selection.html#compose). |
| 33 | 33 | */ |
| 34 | 34 | @JsonProperty("selection") |
| 35 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 35 | + public SelectionOperand getSelection() { return selection; } | |
| 36 | 36 | @JsonProperty("selection") |
| 37 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 37 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Aggregation function for the field |
| @@ -55,9 +55,9 @@ public class ConditionalPredicateTextFieldDefClass { | ||
| 55 | 55 | * __Default value:__ `false` |
| 56 | 56 | */ |
| 57 | 57 | @JsonProperty("bin") |
| 58 | - public Bin getBin() { return bin; } | |
| 58 | + public ColorBin getBin() { return bin; } | |
| 59 | 59 | @JsonProperty("bin") |
| 60 | - public void setBin(Bin value) { this.bin = value; } | |
| 60 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * __Required.__ A string defining the name of the field from which to pull a data value |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateValueDefValue.java+0 −66
| @@ -1,66 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 12 | - * `0` to `1` for opacity). | |
| 13 | - * | |
| 14 | - * A constant value in visual domain. | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = ConditionalPredicateValueDefValue.Deserializer.class) | |
| 17 | -@JsonSerialize(using = ConditionalPredicateValueDefValue.Serializer.class) | |
| 18 | -public class ConditionalPredicateValueDefValue { | |
| 19 | - public Double doubleValue; | |
| 20 | - public Boolean boolValue; | |
| 21 | - public String stringValue; | |
| 22 | - | |
| 23 | - static class Deserializer extends JsonDeserializer<ConditionalPredicateValueDefValue> { | |
| 24 | - @Override | |
| 25 | - public ConditionalPredicateValueDefValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 26 | - ConditionalPredicateValueDefValue value = new ConditionalPredicateValueDefValue(); | |
| 27 | - switch (jsonParser.currentToken()) { | |
| 28 | - case VALUE_NULL: | |
| 29 | - break; | |
| 30 | - case VALUE_NUMBER_INT: | |
| 31 | - case VALUE_NUMBER_FLOAT: | |
| 32 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 33 | - break; | |
| 34 | - case VALUE_TRUE: | |
| 35 | - case VALUE_FALSE: | |
| 36 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 37 | - break; | |
| 38 | - case VALUE_STRING: | |
| 39 | - String string = jsonParser.readValueAs(String.class); | |
| 40 | - value.stringValue = string; | |
| 41 | - break; | |
| 42 | - default: throw new IOException("Cannot deserialize ConditionalPredicateValueDefValue"); | |
| 43 | - } | |
| 44 | - return value; | |
| 45 | - } | |
| 46 | - } | |
| 47 | - | |
| 48 | - static class Serializer extends JsonSerializer<ConditionalPredicateValueDefValue> { | |
| 49 | - @Override | |
| 50 | - public void serialize(ConditionalPredicateValueDefValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 51 | - if (obj.doubleValue != null) { | |
| 52 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 53 | - return; | |
| 54 | - } | |
| 55 | - if (obj.boolValue != null) { | |
| 56 | - jsonGenerator.writeObject(obj.boolValue); | |
| 57 | - return; | |
| 58 | - } | |
| 59 | - if (obj.stringValue != null) { | |
| 60 | - jsonGenerator.writeObject(obj.stringValue); | |
| 61 | - return; | |
| 62 | - } | |
| 63 | - jsonGenerator.writeNull(); | |
| 64 | - } | |
| 65 | - } | |
| 66 | -} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalValueDef.java+6 −6
| @@ -3,14 +3,14 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalValueDef { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | 7 | private ConditionalValueDefValue value; |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | |
| 10 | 10 | @JsonProperty("test") |
| 11 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 11 | + public LogicalOperandPredicate getTest() { return test; } | |
| 12 | 12 | @JsonProperty("test") |
| 13 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 13 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -26,7 +26,7 @@ public class ConditionalValueDef { | ||
| 26 | 26 | * selections](selection.html#compose). |
| 27 | 27 | */ |
| 28 | 28 | @JsonProperty("selection") |
| 29 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 29 | + public SelectionOperand getSelection() { return selection; } | |
| 30 | 30 | @JsonProperty("selection") |
| 31 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 31 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 32 | 32 | } |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalValueDefLogicalOperandPredicate.java+0 −60
| @@ -1,60 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The `filter` property must be one of the predicate definitions: | |
| 12 | - * (1) an [expression](types.html#expression) string, | |
| 13 | - * where `datum` can be used to refer to the current data object; | |
| 14 | - * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | - * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | - * predicate](filter.html#one-of-predicate); | |
| 17 | - * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | - * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | - */ | |
| 20 | -@JsonDeserialize(using = ConditionalValueDefLogicalOperandPredicate.Deserializer.class) | |
| 21 | -@JsonSerialize(using = ConditionalValueDefLogicalOperandPredicate.Serializer.class) | |
| 22 | -public class ConditionalValueDefLogicalOperandPredicate { | |
| 23 | - public Predicate predicateValue; | |
| 24 | - public String stringValue; | |
| 25 | - | |
| 26 | - static class Deserializer extends JsonDeserializer<ConditionalValueDefLogicalOperandPredicate> { | |
| 27 | - @Override | |
| 28 | - public ConditionalValueDefLogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | - ConditionalValueDefLogicalOperandPredicate value = new ConditionalValueDefLogicalOperandPredicate(); | |
| 30 | - switch (jsonParser.currentToken()) { | |
| 31 | - case VALUE_NULL: | |
| 32 | - break; | |
| 33 | - case VALUE_STRING: | |
| 34 | - String string = jsonParser.readValueAs(String.class); | |
| 35 | - value.stringValue = string; | |
| 36 | - break; | |
| 37 | - case START_OBJECT: | |
| 38 | - value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 39 | - break; | |
| 40 | - default: throw new IOException("Cannot deserialize ConditionalValueDefLogicalOperandPredicate"); | |
| 41 | - } | |
| 42 | - return value; | |
| 43 | - } | |
| 44 | - } | |
| 45 | - | |
| 46 | - static class Serializer extends JsonSerializer<ConditionalValueDefLogicalOperandPredicate> { | |
| 47 | - @Override | |
| 48 | - public void serialize(ConditionalValueDefLogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 49 | - if (obj.predicateValue != null) { | |
| 50 | - jsonGenerator.writeObject(obj.predicateValue); | |
| 51 | - return; | |
| 52 | - } | |
| 53 | - if (obj.stringValue != null) { | |
| 54 | - jsonGenerator.writeObject(obj.stringValue); | |
| 55 | - return; | |
| 56 | - } | |
| 57 | - jsonGenerator.writeNull(); | |
| 58 | - } | |
| 59 | - } | |
| 60 | -} |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalValueDefSelectionOperand.java+0 −56
| @@ -1,56 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Filter using a selection name. | |
| 12 | - * | |
| 13 | - * A [selection name](selection.html), or a series of [composed | |
| 14 | - * selections](selection.html#compose). | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = ConditionalValueDefSelectionOperand.Deserializer.class) | |
| 17 | -@JsonSerialize(using = ConditionalValueDefSelectionOperand.Serializer.class) | |
| 18 | -public class ConditionalValueDefSelectionOperand { | |
| 19 | - public Selection selectionValue; | |
| 20 | - public String stringValue; | |
| 21 | - | |
| 22 | - static class Deserializer extends JsonDeserializer<ConditionalValueDefSelectionOperand> { | |
| 23 | - @Override | |
| 24 | - public ConditionalValueDefSelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | - ConditionalValueDefSelectionOperand value = new ConditionalValueDefSelectionOperand(); | |
| 26 | - switch (jsonParser.currentToken()) { | |
| 27 | - case VALUE_NULL: | |
| 28 | - break; | |
| 29 | - case VALUE_STRING: | |
| 30 | - String string = jsonParser.readValueAs(String.class); | |
| 31 | - value.stringValue = string; | |
| 32 | - break; | |
| 33 | - case START_OBJECT: | |
| 34 | - value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 35 | - break; | |
| 36 | - default: throw new IOException("Cannot deserialize ConditionalValueDefSelectionOperand"); | |
| 37 | - } | |
| 38 | - return value; | |
| 39 | - } | |
| 40 | - } | |
| 41 | - | |
| 42 | - static class Serializer extends JsonSerializer<ConditionalValueDefSelectionOperand> { | |
| 43 | - @Override | |
| 44 | - public void serialize(ConditionalValueDefSelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 45 | - if (obj.selectionValue != null) { | |
| 46 | - jsonGenerator.writeObject(obj.selectionValue); | |
| 47 | - return; | |
| 48 | - } | |
| 49 | - if (obj.stringValue != null) { | |
| 50 | - jsonGenerator.writeObject(obj.stringValue); | |
| 51 | - return; | |
| 52 | - } | |
| 53 | - jsonGenerator.writeNull(); | |
| 54 | - } | |
| 55 | - } | |
| 56 | -} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / DefWithCondition.java+6 −6
| @@ -21,12 +21,12 @@ import java.util.List; | ||
| 21 | 21 | */ |
| 22 | 22 | public class DefWithCondition { |
| 23 | 23 | private AggregateOp aggregate; |
| 24 | - private Bin bin; | |
| 24 | + private ColorBin bin; | |
| 25 | 25 | private HrefCondition condition; |
| 26 | 26 | private Field field; |
| 27 | 27 | private TimeUnit timeUnit; |
| 28 | 28 | private Type type; |
| 29 | - private ConditionalPredicateValueDefValue value; | |
| 29 | + private ColorValue value; | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Aggregation function for the field |
| @@ -47,9 +47,9 @@ public class DefWithCondition { | ||
| 47 | 47 | * __Default value:__ `false` |
| 48 | 48 | */ |
| 49 | 49 | @JsonProperty("bin") |
| 50 | - public Bin getBin() { return bin; } | |
| 50 | + public ColorBin getBin() { return bin; } | |
| 51 | 51 | @JsonProperty("bin") |
| 52 | - public void setBin(Bin value) { this.bin = value; } | |
| 52 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * One or more value definition(s) with a selection predicate. |
| @@ -108,7 +108,7 @@ public class DefWithCondition { | ||
| 108 | 108 | * A constant value in visual domain. |
| 109 | 109 | */ |
| 110 | 110 | @JsonProperty("value") |
| 111 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 111 | + public ColorValue getValue() { return value; } | |
| 112 | 112 | @JsonProperty("value") |
| 113 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 113 | + public void setValue(ColorValue value) { this.value = value; } | |
| 114 | 114 | } |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / DomainUnion.java+2 −2
| @@ -29,7 +29,7 @@ import java.util.List; | ||
| 29 | 29 | @JsonDeserialize(using = DomainUnion.Deserializer.class) |
| 30 | 30 | @JsonSerialize(using = DomainUnion.Serializer.class) |
| 31 | 31 | public class DomainUnion { |
| 32 | - public List<OneOfElement> unionArrayValue; | |
| 32 | + public List<Equal> unionArrayValue; | |
| 33 | 33 | public DomainClass domainClassValue; |
| 34 | 34 | public Domain enumValue; |
| 35 | 35 | |
| @@ -49,7 +49,7 @@ public class DomainUnion { | ||
| 49 | 49 | } |
| 50 | 50 | break; |
| 51 | 51 | case START_ARRAY: |
| 52 | - value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<OneOfElement>>() {}); | |
| 52 | + value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<Equal>>() {}); | |
| 53 | 53 | break; |
| 54 | 54 | case START_OBJECT: |
| 55 | 55 | value.domainClassValue = jsonParser.readValueAs(DomainClass.class); |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / Equal.java+69 −0
| @@ -0,0 +1,69 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The value that the field should be equal to. | |
| 12 | + */ | |
| 13 | +@JsonDeserialize(using = Equal.Deserializer.class) | |
| 14 | +@JsonSerialize(using = Equal.Serializer.class) | |
| 15 | +public class Equal { | |
| 16 | + public Double doubleValue; | |
| 17 | + public Boolean boolValue; | |
| 18 | + public DateTime dateTimeValue; | |
| 19 | + public String stringValue; | |
| 20 | + | |
| 21 | + static class Deserializer extends JsonDeserializer<Equal> { | |
| 22 | + @Override | |
| 23 | + public Equal deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | + Equal value = new Equal(); | |
| 25 | + switch (jsonParser.currentToken()) { | |
| 26 | + case VALUE_NUMBER_INT: | |
| 27 | + case VALUE_NUMBER_FLOAT: | |
| 28 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 29 | + break; | |
| 30 | + case VALUE_TRUE: | |
| 31 | + case VALUE_FALSE: | |
| 32 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 33 | + break; | |
| 34 | + case VALUE_STRING: | |
| 35 | + String string = jsonParser.readValueAs(String.class); | |
| 36 | + value.stringValue = string; | |
| 37 | + break; | |
| 38 | + case START_OBJECT: | |
| 39 | + value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 40 | + break; | |
| 41 | + default: throw new IOException("Cannot deserialize Equal"); | |
| 42 | + } | |
| 43 | + return value; | |
| 44 | + } | |
| 45 | + } | |
| 46 | + | |
| 47 | + static class Serializer extends JsonSerializer<Equal> { | |
| 48 | + @Override | |
| 49 | + public void serialize(Equal obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 50 | + if (obj.doubleValue != null) { | |
| 51 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 52 | + return; | |
| 53 | + } | |
| 54 | + if (obj.boolValue != null) { | |
| 55 | + jsonGenerator.writeObject(obj.boolValue); | |
| 56 | + return; | |
| 57 | + } | |
| 58 | + if (obj.dateTimeValue != null) { | |
| 59 | + jsonGenerator.writeObject(obj.dateTimeValue); | |
| 60 | + return; | |
| 61 | + } | |
| 62 | + if (obj.stringValue != null) { | |
| 63 | + jsonGenerator.writeObject(obj.stringValue); | |
| 64 | + return; | |
| 65 | + } | |
| 66 | + throw new IOException("Equal must not be null"); | |
| 67 | + } | |
| 68 | + } | |
| 69 | +} |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / EqualUnion.java+0 −71
| @@ -1,71 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The value that the field should be equal to. | |
| 12 | - */ | |
| 13 | -@JsonDeserialize(using = EqualUnion.Deserializer.class) | |
| 14 | -@JsonSerialize(using = EqualUnion.Serializer.class) | |
| 15 | -public class EqualUnion { | |
| 16 | - public Double doubleValue; | |
| 17 | - public Boolean boolValue; | |
| 18 | - public DateTime dateTimeValue; | |
| 19 | - public String stringValue; | |
| 20 | - | |
| 21 | - static class Deserializer extends JsonDeserializer<EqualUnion> { | |
| 22 | - @Override | |
| 23 | - public EqualUnion deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | - EqualUnion value = new EqualUnion(); | |
| 25 | - switch (jsonParser.currentToken()) { | |
| 26 | - case VALUE_NULL: | |
| 27 | - break; | |
| 28 | - case VALUE_NUMBER_INT: | |
| 29 | - case VALUE_NUMBER_FLOAT: | |
| 30 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 31 | - break; | |
| 32 | - case VALUE_TRUE: | |
| 33 | - case VALUE_FALSE: | |
| 34 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 35 | - break; | |
| 36 | - case VALUE_STRING: | |
| 37 | - String string = jsonParser.readValueAs(String.class); | |
| 38 | - value.stringValue = string; | |
| 39 | - break; | |
| 40 | - case START_OBJECT: | |
| 41 | - value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 42 | - break; | |
| 43 | - default: throw new IOException("Cannot deserialize EqualUnion"); | |
| 44 | - } | |
| 45 | - return value; | |
| 46 | - } | |
| 47 | - } | |
| 48 | - | |
| 49 | - static class Serializer extends JsonSerializer<EqualUnion> { | |
| 50 | - @Override | |
| 51 | - public void serialize(EqualUnion obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 52 | - if (obj.doubleValue != null) { | |
| 53 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 54 | - return; | |
| 55 | - } | |
| 56 | - if (obj.boolValue != null) { | |
| 57 | - jsonGenerator.writeObject(obj.boolValue); | |
| 58 | - return; | |
| 59 | - } | |
| 60 | - if (obj.dateTimeValue != null) { | |
| 61 | - jsonGenerator.writeObject(obj.dateTimeValue); | |
| 62 | - return; | |
| 63 | - } | |
| 64 | - if (obj.stringValue != null) { | |
| 65 | - jsonGenerator.writeObject(obj.stringValue); | |
| 66 | - return; | |
| 67 | - } | |
| 68 | - jsonGenerator.writeNull(); | |
| 69 | - } | |
| 70 | - } | |
| 71 | -} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / FacetFieldDef.java+3 −3
| @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 9 | 9 | */ |
| 10 | 10 | public class FacetFieldDef { |
| 11 | 11 | private AggregateOp aggregate; |
| 12 | - private Bin bin; | |
| 12 | + private ColorBin bin; | |
| 13 | 13 | private Field field; |
| 14 | 14 | private Header header; |
| 15 | 15 | private SortEnum sort; |
| @@ -35,9 +35,9 @@ public class FacetFieldDef { | ||
| 35 | 35 | * __Default value:__ `false` |
| 36 | 36 | */ |
| 37 | 37 | @JsonProperty("bin") |
| 38 | - public Bin getBin() { return bin; } | |
| 38 | + public ColorBin getBin() { return bin; } | |
| 39 | 39 | @JsonProperty("bin") |
| 40 | - public void setBin(Bin value) { this.bin = value; } | |
| 40 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / FieldDef.java+3 −3
| @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 7 | 7 | */ |
| 8 | 8 | public class FieldDef { |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private Type type; |
| @@ -31,9 +31,9 @@ public class FieldDef { | ||
| 31 | 31 | * __Default value:__ `false` |
| 32 | 32 | */ |
| 33 | 33 | @JsonProperty("bin") |
| 34 | - public Bin getBin() { return bin; } | |
| 34 | + public ColorBin getBin() { return bin; } | |
| 35 | 35 | @JsonProperty("bin") |
| 36 | - public void setBin(Bin value) { this.bin = value; } | |
| 36 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * __Required.__ A string defining the name of the field from which to pull a data value |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / LogicalOperandPredicate.java+58 −0
| @@ -0,0 +1,58 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The `filter` property must be one of the predicate definitions: | |
| 12 | + * (1) an [expression](types.html#expression) string, | |
| 13 | + * where `datum` can be used to refer to the current data object; | |
| 14 | + * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | + * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | + * predicate](filter.html#one-of-predicate); | |
| 17 | + * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | + * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | + */ | |
| 20 | +@JsonDeserialize(using = LogicalOperandPredicate.Deserializer.class) | |
| 21 | +@JsonSerialize(using = LogicalOperandPredicate.Serializer.class) | |
| 22 | +public class LogicalOperandPredicate { | |
| 23 | + public Predicate predicateValue; | |
| 24 | + public String stringValue; | |
| 25 | + | |
| 26 | + static class Deserializer extends JsonDeserializer<LogicalOperandPredicate> { | |
| 27 | + @Override | |
| 28 | + public LogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | + LogicalOperandPredicate value = new LogicalOperandPredicate(); | |
| 30 | + switch (jsonParser.currentToken()) { | |
| 31 | + case VALUE_STRING: | |
| 32 | + String string = jsonParser.readValueAs(String.class); | |
| 33 | + value.stringValue = string; | |
| 34 | + break; | |
| 35 | + case START_OBJECT: | |
| 36 | + value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 37 | + break; | |
| 38 | + default: throw new IOException("Cannot deserialize LogicalOperandPredicate"); | |
| 39 | + } | |
| 40 | + return value; | |
| 41 | + } | |
| 42 | + } | |
| 43 | + | |
| 44 | + static class Serializer extends JsonSerializer<LogicalOperandPredicate> { | |
| 45 | + @Override | |
| 46 | + public void serialize(LogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 47 | + if (obj.predicateValue != null) { | |
| 48 | + jsonGenerator.writeObject(obj.predicateValue); | |
| 49 | + return; | |
| 50 | + } | |
| 51 | + if (obj.stringValue != null) { | |
| 52 | + jsonGenerator.writeObject(obj.stringValue); | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + throw new IOException("LogicalOperandPredicate must not be null"); | |
| 56 | + } | |
| 57 | + } | |
| 58 | +} |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / LogicalOperandPredicateElement.java+0 −58
| @@ -1,58 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The `filter` property must be one of the predicate definitions: | |
| 12 | - * (1) an [expression](types.html#expression) string, | |
| 13 | - * where `datum` can be used to refer to the current data object; | |
| 14 | - * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | - * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | - * predicate](filter.html#one-of-predicate); | |
| 17 | - * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | - * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | - */ | |
| 20 | -@JsonDeserialize(using = LogicalOperandPredicateElement.Deserializer.class) | |
| 21 | -@JsonSerialize(using = LogicalOperandPredicateElement.Serializer.class) | |
| 22 | -public class LogicalOperandPredicateElement { | |
| 23 | - public Predicate predicateValue; | |
| 24 | - public String stringValue; | |
| 25 | - | |
| 26 | - static class Deserializer extends JsonDeserializer<LogicalOperandPredicateElement> { | |
| 27 | - @Override | |
| 28 | - public LogicalOperandPredicateElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | - LogicalOperandPredicateElement value = new LogicalOperandPredicateElement(); | |
| 30 | - switch (jsonParser.currentToken()) { | |
| 31 | - case VALUE_STRING: | |
| 32 | - String string = jsonParser.readValueAs(String.class); | |
| 33 | - value.stringValue = string; | |
| 34 | - break; | |
| 35 | - case START_OBJECT: | |
| 36 | - value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 37 | - break; | |
| 38 | - default: throw new IOException("Cannot deserialize LogicalOperandPredicateElement"); | |
| 39 | - } | |
| 40 | - return value; | |
| 41 | - } | |
| 42 | - } | |
| 43 | - | |
| 44 | - static class Serializer extends JsonSerializer<LogicalOperandPredicateElement> { | |
| 45 | - @Override | |
| 46 | - public void serialize(LogicalOperandPredicateElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 47 | - if (obj.predicateValue != null) { | |
| 48 | - jsonGenerator.writeObject(obj.predicateValue); | |
| 49 | - return; | |
| 50 | - } | |
| 51 | - if (obj.stringValue != null) { | |
| 52 | - jsonGenerator.writeObject(obj.stringValue); | |
| 53 | - return; | |
| 54 | - } | |
| 55 | - throw new IOException("LogicalOperandPredicateElement must not be null"); | |
| 56 | - } | |
| 57 | - } | |
| 58 | -} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / MarkPropDefWithCondition.java+6 −6
| @@ -48,7 +48,7 @@ import java.util.List; | ||
| 48 | 48 | */ |
| 49 | 49 | public class MarkPropDefWithCondition { |
| 50 | 50 | private AggregateOp aggregate; |
| 51 | - private Bin bin; | |
| 51 | + private ColorBin bin; | |
| 52 | 52 | private ColorCondition condition; |
| 53 | 53 | private Field field; |
| 54 | 54 | private Legend legend; |
| @@ -56,7 +56,7 @@ public class MarkPropDefWithCondition { | ||
| 56 | 56 | private SortUnion sort; |
| 57 | 57 | private TimeUnit timeUnit; |
| 58 | 58 | private Type type; |
| 59 | - private ConditionalPredicateValueDefValue value; | |
| 59 | + private ColorValue value; | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Aggregation function for the field |
| @@ -77,9 +77,9 @@ public class MarkPropDefWithCondition { | ||
| 77 | 77 | * __Default value:__ `false` |
| 78 | 78 | */ |
| 79 | 79 | @JsonProperty("bin") |
| 80 | - public Bin getBin() { return bin; } | |
| 80 | + public ColorBin getBin() { return bin; } | |
| 81 | 81 | @JsonProperty("bin") |
| 82 | - public void setBin(Bin value) { this.bin = value; } | |
| 82 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * One or more value definition(s) with a selection predicate. |
| @@ -174,7 +174,7 @@ public class MarkPropDefWithCondition { | ||
| 174 | 174 | * A constant value in visual domain. |
| 175 | 175 | */ |
| 176 | 176 | @JsonProperty("value") |
| 177 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 177 | + public ColorValue getValue() { return value; } | |
| 178 | 178 | @JsonProperty("value") |
| 179 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 179 | + public void setValue(ColorValue value) { this.value = value; } | |
| 180 | 180 | } |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / OneOfElement.java+0 −69
| @@ -1,69 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The value that the field should be equal to. | |
| 12 | - */ | |
| 13 | -@JsonDeserialize(using = OneOfElement.Deserializer.class) | |
| 14 | -@JsonSerialize(using = OneOfElement.Serializer.class) | |
| 15 | -public class OneOfElement { | |
| 16 | - public Double doubleValue; | |
| 17 | - public Boolean boolValue; | |
| 18 | - public DateTime dateTimeValue; | |
| 19 | - public String stringValue; | |
| 20 | - | |
| 21 | - static class Deserializer extends JsonDeserializer<OneOfElement> { | |
| 22 | - @Override | |
| 23 | - public OneOfElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | - OneOfElement value = new OneOfElement(); | |
| 25 | - switch (jsonParser.currentToken()) { | |
| 26 | - case VALUE_NUMBER_INT: | |
| 27 | - case VALUE_NUMBER_FLOAT: | |
| 28 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 29 | - break; | |
| 30 | - case VALUE_TRUE: | |
| 31 | - case VALUE_FALSE: | |
| 32 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 33 | - break; | |
| 34 | - case VALUE_STRING: | |
| 35 | - String string = jsonParser.readValueAs(String.class); | |
| 36 | - value.stringValue = string; | |
| 37 | - break; | |
| 38 | - case START_OBJECT: | |
| 39 | - value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 40 | - break; | |
| 41 | - default: throw new IOException("Cannot deserialize OneOfElement"); | |
| 42 | - } | |
| 43 | - return value; | |
| 44 | - } | |
| 45 | - } | |
| 46 | - | |
| 47 | - static class Serializer extends JsonSerializer<OneOfElement> { | |
| 48 | - @Override | |
| 49 | - public void serialize(OneOfElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 50 | - if (obj.doubleValue != null) { | |
| 51 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 52 | - return; | |
| 53 | - } | |
| 54 | - if (obj.boolValue != null) { | |
| 55 | - jsonGenerator.writeObject(obj.boolValue); | |
| 56 | - return; | |
| 57 | - } | |
| 58 | - if (obj.dateTimeValue != null) { | |
| 59 | - jsonGenerator.writeObject(obj.dateTimeValue); | |
| 60 | - return; | |
| 61 | - } | |
| 62 | - if (obj.stringValue != null) { | |
| 63 | - jsonGenerator.writeObject(obj.stringValue); | |
| 64 | - return; | |
| 65 | - } | |
| 66 | - throw new IOException("OneOfElement must not be null"); | |
| 67 | - } | |
| 68 | - } | |
| 69 | -} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / OrderFieldDef.java+3 −3
| @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | |
| 5 | 5 | public class OrderFieldDef { |
| 6 | 6 | private AggregateOp aggregate; |
| 7 | - private Bin bin; | |
| 7 | + private ColorBin bin; | |
| 8 | 8 | private Field field; |
| 9 | 9 | private SortEnum sort; |
| 10 | 10 | private TimeUnit timeUnit; |
| @@ -29,9 +29,9 @@ public class OrderFieldDef { | ||
| 29 | 29 | * __Default value:__ `false` |
| 30 | 30 | */ |
| 31 | 31 | @JsonProperty("bin") |
| 32 | - public Bin getBin() { return bin; } | |
| 32 | + public ColorBin getBin() { return bin; } | |
| 33 | 33 | @JsonProperty("bin") |
| 34 | - public void setBin(Bin value) { this.bin = value; } | |
| 34 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Predicate.java+18 −18
| @@ -4,38 +4,38 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Predicate { |
| 7 | - private ConditionalValueDefLogicalOperandPredicate not; | |
| 8 | - private List<LogicalOperandPredicateElement> and; | |
| 9 | - private List<LogicalOperandPredicateElement> or; | |
| 10 | - private EqualUnion equal; | |
| 7 | + private LogicalOperandPredicate not; | |
| 8 | + private List<LogicalOperandPredicate> and; | |
| 9 | + private List<LogicalOperandPredicate> or; | |
| 10 | + private Equal equal; | |
| 11 | 11 | private String field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private List<RangeElement> range; |
| 14 | - private List<OneOfElement> oneOf; | |
| 15 | - private ConditionalValueDefSelectionOperand selection; | |
| 14 | + private List<Equal> oneOf; | |
| 15 | + private SelectionOperand selection; | |
| 16 | 16 | |
| 17 | 17 | @JsonProperty("not") |
| 18 | - public ConditionalValueDefLogicalOperandPredicate getNot() { return not; } | |
| 18 | + public LogicalOperandPredicate getNot() { return not; } | |
| 19 | 19 | @JsonProperty("not") |
| 20 | - public void setNot(ConditionalValueDefLogicalOperandPredicate value) { this.not = value; } | |
| 20 | + public void setNot(LogicalOperandPredicate value) { this.not = value; } | |
| 21 | 21 | |
| 22 | 22 | @JsonProperty("and") |
| 23 | - public List<LogicalOperandPredicateElement> getAnd() { return and; } | |
| 23 | + public List<LogicalOperandPredicate> getAnd() { return and; } | |
| 24 | 24 | @JsonProperty("and") |
| 25 | - public void setAnd(List<LogicalOperandPredicateElement> value) { this.and = value; } | |
| 25 | + public void setAnd(List<LogicalOperandPredicate> value) { this.and = value; } | |
| 26 | 26 | |
| 27 | 27 | @JsonProperty("or") |
| 28 | - public List<LogicalOperandPredicateElement> getOr() { return or; } | |
| 28 | + public List<LogicalOperandPredicate> getOr() { return or; } | |
| 29 | 29 | @JsonProperty("or") |
| 30 | - public void setOr(List<LogicalOperandPredicateElement> value) { this.or = value; } | |
| 30 | + public void setOr(List<LogicalOperandPredicate> value) { this.or = value; } | |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The value that the field should be equal to. |
| 34 | 34 | */ |
| 35 | 35 | @JsonProperty("equal") |
| 36 | - public EqualUnion getEqual() { return equal; } | |
| 36 | + public Equal getEqual() { return equal; } | |
| 37 | 37 | @JsonProperty("equal") |
| 38 | - public void setEqual(EqualUnion value) { this.equal = value; } | |
| 38 | + public void setEqual(Equal value) { this.equal = value; } | |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Field to be filtered. |
| @@ -71,15 +71,15 @@ public class Predicate { | ||
| 71 | 71 | * for a data item included in the filtered data. |
| 72 | 72 | */ |
| 73 | 73 | @JsonProperty("oneOf") |
| 74 | - public List<OneOfElement> getOneOf() { return oneOf; } | |
| 74 | + public List<Equal> getOneOf() { return oneOf; } | |
| 75 | 75 | @JsonProperty("oneOf") |
| 76 | - public void setOneOf(List<OneOfElement> value) { this.oneOf = value; } | |
| 76 | + public void setOneOf(List<Equal> value) { this.oneOf = value; } | |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Filter using a selection name. |
| 80 | 80 | */ |
| 81 | 81 | @JsonProperty("selection") |
| 82 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 82 | + public SelectionOperand getSelection() { return selection; } | |
| 83 | 83 | @JsonProperty("selection") |
| 84 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 84 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 85 | 85 | } |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Selection.java+9 −9
| @@ -4,22 +4,22 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Selection { |
| 7 | - private ConditionalValueDefSelectionOperand not; | |
| 8 | - private List<SelectionOperandElement> and; | |
| 9 | - private List<SelectionOperandElement> or; | |
| 7 | + private SelectionOperand not; | |
| 8 | + private List<SelectionOperand> and; | |
| 9 | + private List<SelectionOperand> or; | |
| 10 | 10 | |
| 11 | 11 | @JsonProperty("not") |
| 12 | - public ConditionalValueDefSelectionOperand getNot() { return not; } | |
| 12 | + public SelectionOperand getNot() { return not; } | |
| 13 | 13 | @JsonProperty("not") |
| 14 | - public void setNot(ConditionalValueDefSelectionOperand value) { this.not = value; } | |
| 14 | + public void setNot(SelectionOperand value) { this.not = value; } | |
| 15 | 15 | |
| 16 | 16 | @JsonProperty("and") |
| 17 | - public List<SelectionOperandElement> getAnd() { return and; } | |
| 17 | + public List<SelectionOperand> getAnd() { return and; } | |
| 18 | 18 | @JsonProperty("and") |
| 19 | - public void setAnd(List<SelectionOperandElement> value) { this.and = value; } | |
| 19 | + public void setAnd(List<SelectionOperand> value) { this.and = value; } | |
| 20 | 20 | |
| 21 | 21 | @JsonProperty("or") |
| 22 | - public List<SelectionOperandElement> getOr() { return or; } | |
| 22 | + public List<SelectionOperand> getOr() { return or; } | |
| 23 | 23 | @JsonProperty("or") |
| 24 | - public void setOr(List<SelectionOperandElement> value) { this.or = value; } | |
| 24 | + public void setOr(List<SelectionOperand> value) { this.or = value; } | |
| 25 | 25 | } |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / SelectionOperand.java+54 −0
| @@ -0,0 +1,54 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Filter using a selection name. | |
| 12 | + * | |
| 13 | + * A [selection name](selection.html), or a series of [composed | |
| 14 | + * selections](selection.html#compose). | |
| 15 | + */ | |
| 16 | +@JsonDeserialize(using = SelectionOperand.Deserializer.class) | |
| 17 | +@JsonSerialize(using = SelectionOperand.Serializer.class) | |
| 18 | +public class SelectionOperand { | |
| 19 | + public Selection selectionValue; | |
| 20 | + public String stringValue; | |
| 21 | + | |
| 22 | + static class Deserializer extends JsonDeserializer<SelectionOperand> { | |
| 23 | + @Override | |
| 24 | + public SelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | + SelectionOperand value = new SelectionOperand(); | |
| 26 | + switch (jsonParser.currentToken()) { | |
| 27 | + case VALUE_STRING: | |
| 28 | + String string = jsonParser.readValueAs(String.class); | |
| 29 | + value.stringValue = string; | |
| 30 | + break; | |
| 31 | + case START_OBJECT: | |
| 32 | + value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 33 | + break; | |
| 34 | + default: throw new IOException("Cannot deserialize SelectionOperand"); | |
| 35 | + } | |
| 36 | + return value; | |
| 37 | + } | |
| 38 | + } | |
| 39 | + | |
| 40 | + static class Serializer extends JsonSerializer<SelectionOperand> { | |
| 41 | + @Override | |
| 42 | + public void serialize(SelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 43 | + if (obj.selectionValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.selectionValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + if (obj.stringValue != null) { | |
| 48 | + jsonGenerator.writeObject(obj.stringValue); | |
| 49 | + return; | |
| 50 | + } | |
| 51 | + throw new IOException("SelectionOperand must not be null"); | |
| 52 | + } | |
| 53 | + } | |
| 54 | +} |
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / SelectionOperandElement.java+0 −54
| @@ -1,54 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Filter using a selection name. | |
| 12 | - * | |
| 13 | - * A [selection name](selection.html), or a series of [composed | |
| 14 | - * selections](selection.html#compose). | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = SelectionOperandElement.Deserializer.class) | |
| 17 | -@JsonSerialize(using = SelectionOperandElement.Serializer.class) | |
| 18 | -public class SelectionOperandElement { | |
| 19 | - public Selection selectionValue; | |
| 20 | - public String stringValue; | |
| 21 | - | |
| 22 | - static class Deserializer extends JsonDeserializer<SelectionOperandElement> { | |
| 23 | - @Override | |
| 24 | - public SelectionOperandElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | - SelectionOperandElement value = new SelectionOperandElement(); | |
| 26 | - switch (jsonParser.currentToken()) { | |
| 27 | - case VALUE_STRING: | |
| 28 | - String string = jsonParser.readValueAs(String.class); | |
| 29 | - value.stringValue = string; | |
| 30 | - break; | |
| 31 | - case START_OBJECT: | |
| 32 | - value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 33 | - break; | |
| 34 | - default: throw new IOException("Cannot deserialize SelectionOperandElement"); | |
| 35 | - } | |
| 36 | - return value; | |
| 37 | - } | |
| 38 | - } | |
| 39 | - | |
| 40 | - static class Serializer extends JsonSerializer<SelectionOperandElement> { | |
| 41 | - @Override | |
| 42 | - public void serialize(SelectionOperandElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 43 | - if (obj.selectionValue != null) { | |
| 44 | - jsonGenerator.writeObject(obj.selectionValue); | |
| 45 | - return; | |
| 46 | - } | |
| 47 | - if (obj.stringValue != null) { | |
| 48 | - jsonGenerator.writeObject(obj.stringValue); | |
| 49 | - return; | |
| 50 | - } | |
| 51 | - throw new IOException("SelectionOperandElement must not be null"); | |
| 52 | - } | |
| 53 | - } | |
| 54 | -} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / TextDefWithCondition.java+6 −6
| @@ -23,13 +23,13 @@ import java.util.List; | ||
| 23 | 23 | */ |
| 24 | 24 | public class TextDefWithCondition { |
| 25 | 25 | private AggregateOp aggregate; |
| 26 | - private Bin bin; | |
| 26 | + private ColorBin bin; | |
| 27 | 27 | private TextCondition condition; |
| 28 | 28 | private Field field; |
| 29 | 29 | private String format; |
| 30 | 30 | private TimeUnit timeUnit; |
| 31 | 31 | private Type type; |
| 32 | - private ConditionalPredicateValueDefValue value; | |
| 32 | + private ColorValue value; | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Aggregation function for the field |
| @@ -50,9 +50,9 @@ public class TextDefWithCondition { | ||
| 50 | 50 | * __Default value:__ `false` |
| 51 | 51 | */ |
| 52 | 52 | @JsonProperty("bin") |
| 53 | - public Bin getBin() { return bin; } | |
| 53 | + public ColorBin getBin() { return bin; } | |
| 54 | 54 | @JsonProperty("bin") |
| 55 | - public void setBin(Bin value) { this.bin = value; } | |
| 55 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * One or more value definition(s) with a selection predicate. |
| @@ -120,7 +120,7 @@ public class TextDefWithCondition { | ||
| 120 | 120 | * A constant value in visual domain. |
| 121 | 121 | */ |
| 122 | 122 | @JsonProperty("value") |
| 123 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 123 | + public ColorValue getValue() { return value; } | |
| 124 | 124 | @JsonProperty("value") |
| 125 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 125 | + public void setValue(ColorValue value) { this.value = value; } | |
| 126 | 126 | } |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Transform.java+6 −6
| @@ -4,13 +4,13 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Transform { |
| 7 | - private ConditionalValueDefLogicalOperandPredicate filter; | |
| 7 | + private LogicalOperandPredicate filter; | |
| 8 | 8 | private Style as; |
| 9 | 9 | private String calculate; |
| 10 | 10 | private String transformDefault; |
| 11 | 11 | private LookupData from; |
| 12 | 12 | private String lookup; |
| 13 | - private Bin bin; | |
| 13 | + private TransformBin bin; | |
| 14 | 14 | private String field; |
| 15 | 15 | private TimeUnit timeUnit; |
| 16 | 16 | private List<AggregatedFieldDef> aggregate; |
| @@ -27,9 +27,9 @@ public class Transform { | ||
| 27 | 27 | * or (4) a logical operand that combines (1), (2), or (3). |
| 28 | 28 | */ |
| 29 | 29 | @JsonProperty("filter") |
| 30 | - public ConditionalValueDefLogicalOperandPredicate getFilter() { return filter; } | |
| 30 | + public LogicalOperandPredicate getFilter() { return filter; } | |
| 31 | 31 | @JsonProperty("filter") |
| 32 | - public void setFilter(ConditionalValueDefLogicalOperandPredicate value) { this.filter = value; } | |
| 32 | + public void setFilter(LogicalOperandPredicate value) { this.filter = value; } | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * The field for storing the computed formula value. |
| @@ -87,9 +87,9 @@ public class Transform { | ||
| 87 | 87 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 88 | 88 | */ |
| 89 | 89 | @JsonProperty("bin") |
| 90 | - public Bin getBin() { return bin; } | |
| 90 | + public TransformBin getBin() { return bin; } | |
| 91 | 91 | @JsonProperty("bin") |
| 92 | - public void setBin(Bin value) { this.bin = value; } | |
| 92 | + public void setBin(TransformBin value) { this.bin = value; } | |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * The data field to bin. |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / TransformBin.java+48 −0
| @@ -0,0 +1,48 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = TransformBin.Deserializer.class) | |
| 11 | +@JsonSerialize(using = TransformBin.Serializer.class) | |
| 12 | +public class TransformBin { | |
| 13 | + public Boolean boolValue; | |
| 14 | + public BinParams binParamsValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<TransformBin> { | |
| 17 | + @Override | |
| 18 | + public TransformBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + TransformBin value = new TransformBin(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_TRUE: | |
| 22 | + case VALUE_FALSE: | |
| 23 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 24 | + break; | |
| 25 | + case START_OBJECT: | |
| 26 | + value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 27 | + break; | |
| 28 | + default: throw new IOException("Cannot deserialize TransformBin"); | |
| 29 | + } | |
| 30 | + return value; | |
| 31 | + } | |
| 32 | + } | |
| 33 | + | |
| 34 | + static class Serializer extends JsonSerializer<TransformBin> { | |
| 35 | + @Override | |
| 36 | + public void serialize(TransformBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 37 | + if (obj.boolValue != null) { | |
| 38 | + jsonGenerator.writeObject(obj.boolValue); | |
| 39 | + return; | |
| 40 | + } | |
| 41 | + if (obj.binParamsValue != null) { | |
| 42 | + jsonGenerator.writeObject(obj.binParamsValue); | |
| 43 | + return; | |
| 44 | + } | |
| 45 | + throw new IOException("TransformBin must not be null"); | |
| 46 | + } | |
| 47 | + } | |
| 48 | +} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Values.java+1 −3
| @@ -27,8 +27,6 @@ public class Values { | ||
| 27 | 27 | public Values deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { |
| 28 | 28 | Values value = new Values(); |
| 29 | 29 | switch (jsonParser.currentToken()) { |
| 30 | - case VALUE_NULL: | |
| 31 | - break; | |
| 32 | 30 | case VALUE_STRING: |
| 33 | 31 | String string = jsonParser.readValueAs(String.class); |
| 34 | 32 | value.stringValue = string; |
| @@ -60,7 +58,7 @@ public class Values { | ||
| 60 | 58 | jsonGenerator.writeObject(obj.stringValue); |
| 61 | 59 | return; |
| 62 | 60 | } |
| 63 | - jsonGenerator.writeNull(); | |
| 61 | + throw new IOException("Values must not be null"); | |
| 64 | 62 | } |
| 65 | 63 | } |
| 66 | 64 | } |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / X2Class.java+6 −6
| @@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.*; | ||
| 13 | 13 | */ |
| 14 | 14 | public class X2Class { |
| 15 | 15 | private AggregateOp aggregate; |
| 16 | - private Bin bin; | |
| 16 | + private ColorBin bin; | |
| 17 | 17 | private Field field; |
| 18 | 18 | private TimeUnit timeUnit; |
| 19 | 19 | private Type type; |
| 20 | - private ConditionalPredicateValueDefValue value; | |
| 20 | + private ConditionalValueDefValue value; | |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Aggregation function for the field |
| @@ -38,9 +38,9 @@ public class X2Class { | ||
| 38 | 38 | * __Default value:__ `false` |
| 39 | 39 | */ |
| 40 | 40 | @JsonProperty("bin") |
| 41 | - public Bin getBin() { return bin; } | |
| 41 | + public ColorBin getBin() { return bin; } | |
| 42 | 42 | @JsonProperty("bin") |
| 43 | - public void setBin(Bin value) { this.bin = value; } | |
| 43 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * __Required.__ A string defining the name of the field from which to pull a data value |
| @@ -86,7 +86,7 @@ public class X2Class { | ||
| 86 | 86 | * `0` to `1` for opacity). |
| 87 | 87 | */ |
| 88 | 88 | @JsonProperty("value") |
| 89 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 89 | + public ConditionalValueDefValue getValue() { return value; } | |
| 90 | 90 | @JsonProperty("value") |
| 91 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 91 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 92 | 92 | } |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / XClass.java+6 −6
| @@ -12,14 +12,14 @@ import com.fasterxml.jackson.annotation.*; | ||
| 12 | 12 | public class XClass { |
| 13 | 13 | private AggregateOp aggregate; |
| 14 | 14 | private Axis axis; |
| 15 | - private Bin bin; | |
| 15 | + private ColorBin bin; | |
| 16 | 16 | private Field field; |
| 17 | 17 | private Scale scale; |
| 18 | 18 | private SortUnion sort; |
| 19 | 19 | private StackOffset stack; |
| 20 | 20 | private TimeUnit timeUnit; |
| 21 | 21 | private Type type; |
| 22 | - private ConditionalPredicateValueDefValue value; | |
| 22 | + private ConditionalValueDefValue value; | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Aggregation function for the field |
| @@ -51,9 +51,9 @@ public class XClass { | ||
| 51 | 51 | * __Default value:__ `false` |
| 52 | 52 | */ |
| 53 | 53 | @JsonProperty("bin") |
| 54 | - public Bin getBin() { return bin; } | |
| 54 | + public ColorBin getBin() { return bin; } | |
| 55 | 55 | @JsonProperty("bin") |
| 56 | - public void setBin(Bin value) { this.bin = value; } | |
| 56 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * __Required.__ A string defining the name of the field from which to pull a data value |
| @@ -151,7 +151,7 @@ public class XClass { | ||
| 151 | 151 | * `0` to `1` for opacity). |
| 152 | 152 | */ |
| 153 | 153 | @JsonProperty("value") |
| 154 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 154 | + public ConditionalValueDefValue getValue() { return value; } | |
| 155 | 155 | @JsonProperty("value") |
| 156 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 156 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 157 | 157 | } |
Mschema-java-lombokdefault / src / main / java / io / quicktype / AnyMark.java+1 −3
| @@ -24,8 +24,6 @@ public class AnyMark { | ||
| 24 | 24 | public AnyMark deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { |
| 25 | 25 | AnyMark value = new AnyMark(); |
| 26 | 26 | switch (jsonParser.currentToken()) { |
| 27 | - case VALUE_NULL: | |
| 28 | - break; | |
| 29 | 27 | case VALUE_STRING: |
| 30 | 28 | String string = jsonParser.readValueAs(String.class); |
| 31 | 29 | try { |
| @@ -54,7 +52,7 @@ public class AnyMark { | ||
| 54 | 52 | jsonGenerator.writeObject(obj.enumValue); |
| 55 | 53 | return; |
| 56 | 54 | } |
| 57 | - jsonGenerator.writeNull(); | |
| 55 | + throw new IOException("AnyMark must not be null"); | |
| 58 | 56 | } |
| 59 | 57 | } |
| 60 | 58 | } |
Dschema-java-lombokdefault / src / main / java / io / quicktype / Bin.java+0 −50
| @@ -1,50 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -@JsonDeserialize(using = Bin.Deserializer.class) | |
| 11 | -@JsonSerialize(using = Bin.Serializer.class) | |
| 12 | -public class Bin { | |
| 13 | - public Boolean boolValue; | |
| 14 | - public BinParams binParamsValue; | |
| 15 | - | |
| 16 | - static class Deserializer extends JsonDeserializer<Bin> { | |
| 17 | - @Override | |
| 18 | - public Bin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | - Bin value = new Bin(); | |
| 20 | - switch (jsonParser.currentToken()) { | |
| 21 | - case VALUE_NULL: | |
| 22 | - break; | |
| 23 | - case VALUE_TRUE: | |
| 24 | - case VALUE_FALSE: | |
| 25 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 26 | - break; | |
| 27 | - case START_OBJECT: | |
| 28 | - value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 29 | - break; | |
| 30 | - default: throw new IOException("Cannot deserialize Bin"); | |
| 31 | - } | |
| 32 | - return value; | |
| 33 | - } | |
| 34 | - } | |
| 35 | - | |
| 36 | - static class Serializer extends JsonSerializer<Bin> { | |
| 37 | - @Override | |
| 38 | - public void serialize(Bin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | - if (obj.boolValue != null) { | |
| 40 | - jsonGenerator.writeObject(obj.boolValue); | |
| 41 | - return; | |
| 42 | - } | |
| 43 | - if (obj.binParamsValue != null) { | |
| 44 | - jsonGenerator.writeObject(obj.binParamsValue); | |
| 45 | - return; | |
| 46 | - } | |
| 47 | - jsonGenerator.writeNull(); | |
| 48 | - } | |
| 49 | - } | |
| 50 | -} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / ColorBin.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = ColorBin.Deserializer.class) | |
| 11 | +@JsonSerialize(using = ColorBin.Serializer.class) | |
| 12 | +public class ColorBin { | |
| 13 | + public Boolean boolValue; | |
| 14 | + public BinParams binParamsValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<ColorBin> { | |
| 17 | + @Override | |
| 18 | + public ColorBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + ColorBin value = new ColorBin(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_TRUE: | |
| 24 | + case VALUE_FALSE: | |
| 25 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize ColorBin"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<ColorBin> { | |
| 37 | + @Override | |
| 38 | + public void serialize(ColorBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.boolValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.boolValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.binParamsValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.binParamsValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / ColorValue.java+66 −0
| @@ -0,0 +1,66 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 12 | + * `0` to `1` for opacity). | |
| 13 | + * | |
| 14 | + * A constant value in visual domain. | |
| 15 | + */ | |
| 16 | +@JsonDeserialize(using = ColorValue.Deserializer.class) | |
| 17 | +@JsonSerialize(using = ColorValue.Serializer.class) | |
| 18 | +public class ColorValue { | |
| 19 | + public Double doubleValue; | |
| 20 | + public Boolean boolValue; | |
| 21 | + public String stringValue; | |
| 22 | + | |
| 23 | + static class Deserializer extends JsonDeserializer<ColorValue> { | |
| 24 | + @Override | |
| 25 | + public ColorValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 26 | + ColorValue value = new ColorValue(); | |
| 27 | + switch (jsonParser.currentToken()) { | |
| 28 | + case VALUE_NULL: | |
| 29 | + break; | |
| 30 | + case VALUE_NUMBER_INT: | |
| 31 | + case VALUE_NUMBER_FLOAT: | |
| 32 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 33 | + break; | |
| 34 | + case VALUE_TRUE: | |
| 35 | + case VALUE_FALSE: | |
| 36 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 37 | + break; | |
| 38 | + case VALUE_STRING: | |
| 39 | + String string = jsonParser.readValueAs(String.class); | |
| 40 | + value.stringValue = string; | |
| 41 | + break; | |
| 42 | + default: throw new IOException("Cannot deserialize ColorValue"); | |
| 43 | + } | |
| 44 | + return value; | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + static class Serializer extends JsonSerializer<ColorValue> { | |
| 49 | + @Override | |
| 50 | + public void serialize(ColorValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 51 | + if (obj.doubleValue != null) { | |
| 52 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + if (obj.boolValue != null) { | |
| 56 | + jsonGenerator.writeObject(obj.boolValue); | |
| 57 | + return; | |
| 58 | + } | |
| 59 | + if (obj.stringValue != null) { | |
| 60 | + jsonGenerator.writeObject(obj.stringValue); | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + jsonGenerator.writeNull(); | |
| 64 | + } | |
| 65 | + } | |
| 66 | +} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateFieldDefClass.java+12 −12
| @@ -3,37 +3,37 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private Type type; |
| 14 | 14 | |
| 15 | 15 | @JsonProperty("test") |
| 16 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 16 | + public LogicalOperandPredicate getTest() { return test; } | |
| 17 | 17 | @JsonProperty("test") |
| 18 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 18 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 22 | 22 | * `0` to `1` for opacity). |
| 23 | 23 | */ |
| 24 | 24 | @JsonProperty("value") |
| 25 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 25 | + public ConditionalValueDefValue getValue() { return value; } | |
| 26 | 26 | @JsonProperty("value") |
| 27 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 27 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * A [selection name](selection.html), or a series of [composed |
| 31 | 31 | * selections](selection.html#compose). |
| 32 | 32 | */ |
| 33 | 33 | @JsonProperty("selection") |
| 34 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 34 | + public SelectionOperand getSelection() { return selection; } | |
| 35 | 35 | @JsonProperty("selection") |
| 36 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 36 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Aggregation function for the field |
| @@ -54,9 +54,9 @@ public class ConditionalPredicateFieldDefClass { | ||
| 54 | 54 | * __Default value:__ `false` |
| 55 | 55 | */ |
| 56 | 56 | @JsonProperty("bin") |
| 57 | - public Bin getBin() { return bin; } | |
| 57 | + public ColorBin getBin() { return bin; } | |
| 58 | 58 | @JsonProperty("bin") |
| 59 | - public void setBin(Bin value) { this.bin = value; } | |
| 59 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateMarkPropFieldDefClass.java+12 −12
| @@ -3,11 +3,11 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateMarkPropFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private Legend legend; |
| 13 | 13 | private Scale scale; |
| @@ -16,27 +16,27 @@ public class ConditionalPredicateMarkPropFieldDefClass { | ||
| 16 | 16 | private Type type; |
| 17 | 17 | |
| 18 | 18 | @JsonProperty("test") |
| 19 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 19 | + public LogicalOperandPredicate getTest() { return test; } | |
| 20 | 20 | @JsonProperty("test") |
| 21 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 21 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 25 | 25 | * `0` to `1` for opacity). |
| 26 | 26 | */ |
| 27 | 27 | @JsonProperty("value") |
| 28 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 28 | + public ConditionalValueDefValue getValue() { return value; } | |
| 29 | 29 | @JsonProperty("value") |
| 30 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 30 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * A [selection name](selection.html), or a series of [composed |
| 34 | 34 | * selections](selection.html#compose). |
| 35 | 35 | */ |
| 36 | 36 | @JsonProperty("selection") |
| 37 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 37 | + public SelectionOperand getSelection() { return selection; } | |
| 38 | 38 | @JsonProperty("selection") |
| 39 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 39 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Aggregation function for the field |
| @@ -57,9 +57,9 @@ public class ConditionalPredicateMarkPropFieldDefClass { | ||
| 57 | 57 | * __Default value:__ `false` |
| 58 | 58 | */ |
| 59 | 59 | @JsonProperty("bin") |
| 60 | - public Bin getBin() { return bin; } | |
| 60 | + public ColorBin getBin() { return bin; } | |
| 61 | 61 | @JsonProperty("bin") |
| 62 | - public void setBin(Bin value) { this.bin = value; } | |
| 62 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateTextFieldDefClass.java+12 −12
| @@ -3,38 +3,38 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateTextFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private String format; |
| 13 | 13 | private TimeUnit timeUnit; |
| 14 | 14 | private Type type; |
| 15 | 15 | |
| 16 | 16 | @JsonProperty("test") |
| 17 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 17 | + public LogicalOperandPredicate getTest() { return test; } | |
| 18 | 18 | @JsonProperty("test") |
| 19 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 19 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 23 | 23 | * `0` to `1` for opacity). |
| 24 | 24 | */ |
| 25 | 25 | @JsonProperty("value") |
| 26 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 26 | + public ConditionalValueDefValue getValue() { return value; } | |
| 27 | 27 | @JsonProperty("value") |
| 28 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 28 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * A [selection name](selection.html), or a series of [composed |
| 32 | 32 | * selections](selection.html#compose). |
| 33 | 33 | */ |
| 34 | 34 | @JsonProperty("selection") |
| 35 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 35 | + public SelectionOperand getSelection() { return selection; } | |
| 36 | 36 | @JsonProperty("selection") |
| 37 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 37 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Aggregation function for the field |
| @@ -55,9 +55,9 @@ public class ConditionalPredicateTextFieldDefClass { | ||
| 55 | 55 | * __Default value:__ `false` |
| 56 | 56 | */ |
| 57 | 57 | @JsonProperty("bin") |
| 58 | - public Bin getBin() { return bin; } | |
| 58 | + public ColorBin getBin() { return bin; } | |
| 59 | 59 | @JsonProperty("bin") |
| 60 | - public void setBin(Bin value) { this.bin = value; } | |
| 60 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * __Required.__ A string defining the name of the field from which to pull a data value |
Dschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateValueDefValue.java+0 −66
| @@ -1,66 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 12 | - * `0` to `1` for opacity). | |
| 13 | - * | |
| 14 | - * A constant value in visual domain. | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = ConditionalPredicateValueDefValue.Deserializer.class) | |
| 17 | -@JsonSerialize(using = ConditionalPredicateValueDefValue.Serializer.class) | |
| 18 | -public class ConditionalPredicateValueDefValue { | |
| 19 | - public Double doubleValue; | |
| 20 | - public Boolean boolValue; | |
| 21 | - public String stringValue; | |
| 22 | - | |
| 23 | - static class Deserializer extends JsonDeserializer<ConditionalPredicateValueDefValue> { | |
| 24 | - @Override | |
| 25 | - public ConditionalPredicateValueDefValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 26 | - ConditionalPredicateValueDefValue value = new ConditionalPredicateValueDefValue(); | |
| 27 | - switch (jsonParser.currentToken()) { | |
| 28 | - case VALUE_NULL: | |
| 29 | - break; | |
| 30 | - case VALUE_NUMBER_INT: | |
| 31 | - case VALUE_NUMBER_FLOAT: | |
| 32 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 33 | - break; | |
| 34 | - case VALUE_TRUE: | |
| 35 | - case VALUE_FALSE: | |
| 36 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 37 | - break; | |
| 38 | - case VALUE_STRING: | |
| 39 | - String string = jsonParser.readValueAs(String.class); | |
| 40 | - value.stringValue = string; | |
| 41 | - break; | |
| 42 | - default: throw new IOException("Cannot deserialize ConditionalPredicateValueDefValue"); | |
| 43 | - } | |
| 44 | - return value; | |
| 45 | - } | |
| 46 | - } | |
| 47 | - | |
| 48 | - static class Serializer extends JsonSerializer<ConditionalPredicateValueDefValue> { | |
| 49 | - @Override | |
| 50 | - public void serialize(ConditionalPredicateValueDefValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 51 | - if (obj.doubleValue != null) { | |
| 52 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 53 | - return; | |
| 54 | - } | |
| 55 | - if (obj.boolValue != null) { | |
| 56 | - jsonGenerator.writeObject(obj.boolValue); | |
| 57 | - return; | |
| 58 | - } | |
| 59 | - if (obj.stringValue != null) { | |
| 60 | - jsonGenerator.writeObject(obj.stringValue); | |
| 61 | - return; | |
| 62 | - } | |
| 63 | - jsonGenerator.writeNull(); | |
| 64 | - } | |
| 65 | - } | |
| 66 | -} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalValueDef.java+6 −6
| @@ -3,14 +3,14 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalValueDef { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | 7 | private ConditionalValueDefValue value; |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | |
| 10 | 10 | @JsonProperty("test") |
| 11 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 11 | + public LogicalOperandPredicate getTest() { return test; } | |
| 12 | 12 | @JsonProperty("test") |
| 13 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 13 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -26,7 +26,7 @@ public class ConditionalValueDef { | ||
| 26 | 26 | * selections](selection.html#compose). |
| 27 | 27 | */ |
| 28 | 28 | @JsonProperty("selection") |
| 29 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 29 | + public SelectionOperand getSelection() { return selection; } | |
| 30 | 30 | @JsonProperty("selection") |
| 31 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 31 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 32 | 32 | } |
Dschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalValueDefLogicalOperandPredicate.java+0 −60
| @@ -1,60 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The `filter` property must be one of the predicate definitions: | |
| 12 | - * (1) an [expression](types.html#expression) string, | |
| 13 | - * where `datum` can be used to refer to the current data object; | |
| 14 | - * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | - * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | - * predicate](filter.html#one-of-predicate); | |
| 17 | - * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | - * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | - */ | |
| 20 | -@JsonDeserialize(using = ConditionalValueDefLogicalOperandPredicate.Deserializer.class) | |
| 21 | -@JsonSerialize(using = ConditionalValueDefLogicalOperandPredicate.Serializer.class) | |
| 22 | -public class ConditionalValueDefLogicalOperandPredicate { | |
| 23 | - public Predicate predicateValue; | |
| 24 | - public String stringValue; | |
| 25 | - | |
| 26 | - static class Deserializer extends JsonDeserializer<ConditionalValueDefLogicalOperandPredicate> { | |
| 27 | - @Override | |
| 28 | - public ConditionalValueDefLogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | - ConditionalValueDefLogicalOperandPredicate value = new ConditionalValueDefLogicalOperandPredicate(); | |
| 30 | - switch (jsonParser.currentToken()) { | |
| 31 | - case VALUE_NULL: | |
| 32 | - break; | |
| 33 | - case VALUE_STRING: | |
| 34 | - String string = jsonParser.readValueAs(String.class); | |
| 35 | - value.stringValue = string; | |
| 36 | - break; | |
| 37 | - case START_OBJECT: | |
| 38 | - value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 39 | - break; | |
| 40 | - default: throw new IOException("Cannot deserialize ConditionalValueDefLogicalOperandPredicate"); | |
| 41 | - } | |
| 42 | - return value; | |
| 43 | - } | |
| 44 | - } | |
| 45 | - | |
| 46 | - static class Serializer extends JsonSerializer<ConditionalValueDefLogicalOperandPredicate> { | |
| 47 | - @Override | |
| 48 | - public void serialize(ConditionalValueDefLogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 49 | - if (obj.predicateValue != null) { | |
| 50 | - jsonGenerator.writeObject(obj.predicateValue); | |
| 51 | - return; | |
| 52 | - } | |
| 53 | - if (obj.stringValue != null) { | |
| 54 | - jsonGenerator.writeObject(obj.stringValue); | |
| 55 | - return; | |
| 56 | - } | |
| 57 | - jsonGenerator.writeNull(); | |
| 58 | - } | |
| 59 | - } | |
| 60 | -} |
Dschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalValueDefSelectionOperand.java+0 −56
| @@ -1,56 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Filter using a selection name. | |
| 12 | - * | |
| 13 | - * A [selection name](selection.html), or a series of [composed | |
| 14 | - * selections](selection.html#compose). | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = ConditionalValueDefSelectionOperand.Deserializer.class) | |
| 17 | -@JsonSerialize(using = ConditionalValueDefSelectionOperand.Serializer.class) | |
| 18 | -public class ConditionalValueDefSelectionOperand { | |
| 19 | - public Selection selectionValue; | |
| 20 | - public String stringValue; | |
| 21 | - | |
| 22 | - static class Deserializer extends JsonDeserializer<ConditionalValueDefSelectionOperand> { | |
| 23 | - @Override | |
| 24 | - public ConditionalValueDefSelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | - ConditionalValueDefSelectionOperand value = new ConditionalValueDefSelectionOperand(); | |
| 26 | - switch (jsonParser.currentToken()) { | |
| 27 | - case VALUE_NULL: | |
| 28 | - break; | |
| 29 | - case VALUE_STRING: | |
| 30 | - String string = jsonParser.readValueAs(String.class); | |
| 31 | - value.stringValue = string; | |
| 32 | - break; | |
| 33 | - case START_OBJECT: | |
| 34 | - value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 35 | - break; | |
| 36 | - default: throw new IOException("Cannot deserialize ConditionalValueDefSelectionOperand"); | |
| 37 | - } | |
| 38 | - return value; | |
| 39 | - } | |
| 40 | - } | |
| 41 | - | |
| 42 | - static class Serializer extends JsonSerializer<ConditionalValueDefSelectionOperand> { | |
| 43 | - @Override | |
| 44 | - public void serialize(ConditionalValueDefSelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 45 | - if (obj.selectionValue != null) { | |
| 46 | - jsonGenerator.writeObject(obj.selectionValue); | |
| 47 | - return; | |
| 48 | - } | |
| 49 | - if (obj.stringValue != null) { | |
| 50 | - jsonGenerator.writeObject(obj.stringValue); | |
| 51 | - return; | |
| 52 | - } | |
| 53 | - jsonGenerator.writeNull(); | |
| 54 | - } | |
| 55 | - } | |
| 56 | -} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / DefWithCondition.java+6 −6
| @@ -21,12 +21,12 @@ import java.util.List; | ||
| 21 | 21 | */ |
| 22 | 22 | public class DefWithCondition { |
| 23 | 23 | private AggregateOp aggregate; |
| 24 | - private Bin bin; | |
| 24 | + private ColorBin bin; | |
| 25 | 25 | private HrefCondition condition; |
| 26 | 26 | private Field field; |
| 27 | 27 | private TimeUnit timeUnit; |
| 28 | 28 | private Type type; |
| 29 | - private ConditionalPredicateValueDefValue value; | |
| 29 | + private ColorValue value; | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Aggregation function for the field |
| @@ -47,9 +47,9 @@ public class DefWithCondition { | ||
| 47 | 47 | * __Default value:__ `false` |
| 48 | 48 | */ |
| 49 | 49 | @JsonProperty("bin") |
| 50 | - public Bin getBin() { return bin; } | |
| 50 | + public ColorBin getBin() { return bin; } | |
| 51 | 51 | @JsonProperty("bin") |
| 52 | - public void setBin(Bin value) { this.bin = value; } | |
| 52 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * One or more value definition(s) with a selection predicate. |
| @@ -108,7 +108,7 @@ public class DefWithCondition { | ||
| 108 | 108 | * A constant value in visual domain. |
| 109 | 109 | */ |
| 110 | 110 | @JsonProperty("value") |
| 111 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 111 | + public ColorValue getValue() { return value; } | |
| 112 | 112 | @JsonProperty("value") |
| 113 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 113 | + public void setValue(ColorValue value) { this.value = value; } | |
| 114 | 114 | } |
Mschema-java-lombokdefault / src / main / java / io / quicktype / DomainUnion.java+2 −2
| @@ -29,7 +29,7 @@ import java.util.List; | ||
| 29 | 29 | @JsonDeserialize(using = DomainUnion.Deserializer.class) |
| 30 | 30 | @JsonSerialize(using = DomainUnion.Serializer.class) |
| 31 | 31 | public class DomainUnion { |
| 32 | - public List<OneOfElement> unionArrayValue; | |
| 32 | + public List<Equal> unionArrayValue; | |
| 33 | 33 | public DomainClass domainClassValue; |
| 34 | 34 | public Domain enumValue; |
| 35 | 35 | |
| @@ -49,7 +49,7 @@ public class DomainUnion { | ||
| 49 | 49 | } |
| 50 | 50 | break; |
| 51 | 51 | case START_ARRAY: |
| 52 | - value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<OneOfElement>>() {}); | |
| 52 | + value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<Equal>>() {}); | |
| 53 | 53 | break; |
| 54 | 54 | case START_OBJECT: |
| 55 | 55 | value.domainClassValue = jsonParser.readValueAs(DomainClass.class); |
Aschema-java-lombokdefault / src / main / java / io / quicktype / Equal.java+69 −0
| @@ -0,0 +1,69 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The value that the field should be equal to. | |
| 12 | + */ | |
| 13 | +@JsonDeserialize(using = Equal.Deserializer.class) | |
| 14 | +@JsonSerialize(using = Equal.Serializer.class) | |
| 15 | +public class Equal { | |
| 16 | + public Double doubleValue; | |
| 17 | + public Boolean boolValue; | |
| 18 | + public DateTime dateTimeValue; | |
| 19 | + public String stringValue; | |
| 20 | + | |
| 21 | + static class Deserializer extends JsonDeserializer<Equal> { | |
| 22 | + @Override | |
| 23 | + public Equal deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | + Equal value = new Equal(); | |
| 25 | + switch (jsonParser.currentToken()) { | |
| 26 | + case VALUE_NUMBER_INT: | |
| 27 | + case VALUE_NUMBER_FLOAT: | |
| 28 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 29 | + break; | |
| 30 | + case VALUE_TRUE: | |
| 31 | + case VALUE_FALSE: | |
| 32 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 33 | + break; | |
| 34 | + case VALUE_STRING: | |
| 35 | + String string = jsonParser.readValueAs(String.class); | |
| 36 | + value.stringValue = string; | |
| 37 | + break; | |
| 38 | + case START_OBJECT: | |
| 39 | + value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 40 | + break; | |
| 41 | + default: throw new IOException("Cannot deserialize Equal"); | |
| 42 | + } | |
| 43 | + return value; | |
| 44 | + } | |
| 45 | + } | |
| 46 | + | |
| 47 | + static class Serializer extends JsonSerializer<Equal> { | |
| 48 | + @Override | |
| 49 | + public void serialize(Equal obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 50 | + if (obj.doubleValue != null) { | |
| 51 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 52 | + return; | |
| 53 | + } | |
| 54 | + if (obj.boolValue != null) { | |
| 55 | + jsonGenerator.writeObject(obj.boolValue); | |
| 56 | + return; | |
| 57 | + } | |
| 58 | + if (obj.dateTimeValue != null) { | |
| 59 | + jsonGenerator.writeObject(obj.dateTimeValue); | |
| 60 | + return; | |
| 61 | + } | |
| 62 | + if (obj.stringValue != null) { | |
| 63 | + jsonGenerator.writeObject(obj.stringValue); | |
| 64 | + return; | |
| 65 | + } | |
| 66 | + throw new IOException("Equal must not be null"); | |
| 67 | + } | |
| 68 | + } | |
| 69 | +} |
Dschema-java-lombokdefault / src / main / java / io / quicktype / EqualUnion.java+0 −71
| @@ -1,71 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The value that the field should be equal to. | |
| 12 | - */ | |
| 13 | -@JsonDeserialize(using = EqualUnion.Deserializer.class) | |
| 14 | -@JsonSerialize(using = EqualUnion.Serializer.class) | |
| 15 | -public class EqualUnion { | |
| 16 | - public Double doubleValue; | |
| 17 | - public Boolean boolValue; | |
| 18 | - public DateTime dateTimeValue; | |
| 19 | - public String stringValue; | |
| 20 | - | |
| 21 | - static class Deserializer extends JsonDeserializer<EqualUnion> { | |
| 22 | - @Override | |
| 23 | - public EqualUnion deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | - EqualUnion value = new EqualUnion(); | |
| 25 | - switch (jsonParser.currentToken()) { | |
| 26 | - case VALUE_NULL: | |
| 27 | - break; | |
| 28 | - case VALUE_NUMBER_INT: | |
| 29 | - case VALUE_NUMBER_FLOAT: | |
| 30 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 31 | - break; | |
| 32 | - case VALUE_TRUE: | |
| 33 | - case VALUE_FALSE: | |
| 34 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 35 | - break; | |
| 36 | - case VALUE_STRING: | |
| 37 | - String string = jsonParser.readValueAs(String.class); | |
| 38 | - value.stringValue = string; | |
| 39 | - break; | |
| 40 | - case START_OBJECT: | |
| 41 | - value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 42 | - break; | |
| 43 | - default: throw new IOException("Cannot deserialize EqualUnion"); | |
| 44 | - } | |
| 45 | - return value; | |
| 46 | - } | |
| 47 | - } | |
| 48 | - | |
| 49 | - static class Serializer extends JsonSerializer<EqualUnion> { | |
| 50 | - @Override | |
| 51 | - public void serialize(EqualUnion obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 52 | - if (obj.doubleValue != null) { | |
| 53 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 54 | - return; | |
| 55 | - } | |
| 56 | - if (obj.boolValue != null) { | |
| 57 | - jsonGenerator.writeObject(obj.boolValue); | |
| 58 | - return; | |
| 59 | - } | |
| 60 | - if (obj.dateTimeValue != null) { | |
| 61 | - jsonGenerator.writeObject(obj.dateTimeValue); | |
| 62 | - return; | |
| 63 | - } | |
| 64 | - if (obj.stringValue != null) { | |
| 65 | - jsonGenerator.writeObject(obj.stringValue); | |
| 66 | - return; | |
| 67 | - } | |
| 68 | - jsonGenerator.writeNull(); | |
| 69 | - } | |
| 70 | - } | |
| 71 | -} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / FacetFieldDef.java+3 −3
| @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 9 | 9 | */ |
| 10 | 10 | public class FacetFieldDef { |
| 11 | 11 | private AggregateOp aggregate; |
| 12 | - private Bin bin; | |
| 12 | + private ColorBin bin; | |
| 13 | 13 | private Field field; |
| 14 | 14 | private Header header; |
| 15 | 15 | private SortEnum sort; |
| @@ -35,9 +35,9 @@ public class FacetFieldDef { | ||
| 35 | 35 | * __Default value:__ `false` |
| 36 | 36 | */ |
| 37 | 37 | @JsonProperty("bin") |
| 38 | - public Bin getBin() { return bin; } | |
| 38 | + public ColorBin getBin() { return bin; } | |
| 39 | 39 | @JsonProperty("bin") |
| 40 | - public void setBin(Bin value) { this.bin = value; } | |
| 40 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-lombokdefault / src / main / java / io / quicktype / FieldDef.java+3 −3
| @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 7 | 7 | */ |
| 8 | 8 | public class FieldDef { |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private Type type; |
| @@ -31,9 +31,9 @@ public class FieldDef { | ||
| 31 | 31 | * __Default value:__ `false` |
| 32 | 32 | */ |
| 33 | 33 | @JsonProperty("bin") |
| 34 | - public Bin getBin() { return bin; } | |
| 34 | + public ColorBin getBin() { return bin; } | |
| 35 | 35 | @JsonProperty("bin") |
| 36 | - public void setBin(Bin value) { this.bin = value; } | |
| 36 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * __Required.__ A string defining the name of the field from which to pull a data value |
Aschema-java-lombokdefault / src / main / java / io / quicktype / LogicalOperandPredicate.java+58 −0
| @@ -0,0 +1,58 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The `filter` property must be one of the predicate definitions: | |
| 12 | + * (1) an [expression](types.html#expression) string, | |
| 13 | + * where `datum` can be used to refer to the current data object; | |
| 14 | + * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | + * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | + * predicate](filter.html#one-of-predicate); | |
| 17 | + * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | + * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | + */ | |
| 20 | +@JsonDeserialize(using = LogicalOperandPredicate.Deserializer.class) | |
| 21 | +@JsonSerialize(using = LogicalOperandPredicate.Serializer.class) | |
| 22 | +public class LogicalOperandPredicate { | |
| 23 | + public Predicate predicateValue; | |
| 24 | + public String stringValue; | |
| 25 | + | |
| 26 | + static class Deserializer extends JsonDeserializer<LogicalOperandPredicate> { | |
| 27 | + @Override | |
| 28 | + public LogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | + LogicalOperandPredicate value = new LogicalOperandPredicate(); | |
| 30 | + switch (jsonParser.currentToken()) { | |
| 31 | + case VALUE_STRING: | |
| 32 | + String string = jsonParser.readValueAs(String.class); | |
| 33 | + value.stringValue = string; | |
| 34 | + break; | |
| 35 | + case START_OBJECT: | |
| 36 | + value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 37 | + break; | |
| 38 | + default: throw new IOException("Cannot deserialize LogicalOperandPredicate"); | |
| 39 | + } | |
| 40 | + return value; | |
| 41 | + } | |
| 42 | + } | |
| 43 | + | |
| 44 | + static class Serializer extends JsonSerializer<LogicalOperandPredicate> { | |
| 45 | + @Override | |
| 46 | + public void serialize(LogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 47 | + if (obj.predicateValue != null) { | |
| 48 | + jsonGenerator.writeObject(obj.predicateValue); | |
| 49 | + return; | |
| 50 | + } | |
| 51 | + if (obj.stringValue != null) { | |
| 52 | + jsonGenerator.writeObject(obj.stringValue); | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + throw new IOException("LogicalOperandPredicate must not be null"); | |
| 56 | + } | |
| 57 | + } | |
| 58 | +} |
Dschema-java-lombokdefault / src / main / java / io / quicktype / LogicalOperandPredicateElement.java+0 −58
| @@ -1,58 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The `filter` property must be one of the predicate definitions: | |
| 12 | - * (1) an [expression](types.html#expression) string, | |
| 13 | - * where `datum` can be used to refer to the current data object; | |
| 14 | - * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | - * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | - * predicate](filter.html#one-of-predicate); | |
| 17 | - * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | - * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | - */ | |
| 20 | -@JsonDeserialize(using = LogicalOperandPredicateElement.Deserializer.class) | |
| 21 | -@JsonSerialize(using = LogicalOperandPredicateElement.Serializer.class) | |
| 22 | -public class LogicalOperandPredicateElement { | |
| 23 | - public Predicate predicateValue; | |
| 24 | - public String stringValue; | |
| 25 | - | |
| 26 | - static class Deserializer extends JsonDeserializer<LogicalOperandPredicateElement> { | |
| 27 | - @Override | |
| 28 | - public LogicalOperandPredicateElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | - LogicalOperandPredicateElement value = new LogicalOperandPredicateElement(); | |
| 30 | - switch (jsonParser.currentToken()) { | |
| 31 | - case VALUE_STRING: | |
| 32 | - String string = jsonParser.readValueAs(String.class); | |
| 33 | - value.stringValue = string; | |
| 34 | - break; | |
| 35 | - case START_OBJECT: | |
| 36 | - value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 37 | - break; | |
| 38 | - default: throw new IOException("Cannot deserialize LogicalOperandPredicateElement"); | |
| 39 | - } | |
| 40 | - return value; | |
| 41 | - } | |
| 42 | - } | |
| 43 | - | |
| 44 | - static class Serializer extends JsonSerializer<LogicalOperandPredicateElement> { | |
| 45 | - @Override | |
| 46 | - public void serialize(LogicalOperandPredicateElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 47 | - if (obj.predicateValue != null) { | |
| 48 | - jsonGenerator.writeObject(obj.predicateValue); | |
| 49 | - return; | |
| 50 | - } | |
| 51 | - if (obj.stringValue != null) { | |
| 52 | - jsonGenerator.writeObject(obj.stringValue); | |
| 53 | - return; | |
| 54 | - } | |
| 55 | - throw new IOException("LogicalOperandPredicateElement must not be null"); | |
| 56 | - } | |
| 57 | - } | |
| 58 | -} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / MarkPropDefWithCondition.java+6 −6
| @@ -48,7 +48,7 @@ import java.util.List; | ||
| 48 | 48 | */ |
| 49 | 49 | public class MarkPropDefWithCondition { |
| 50 | 50 | private AggregateOp aggregate; |
| 51 | - private Bin bin; | |
| 51 | + private ColorBin bin; | |
| 52 | 52 | private ColorCondition condition; |
| 53 | 53 | private Field field; |
| 54 | 54 | private Legend legend; |
| @@ -56,7 +56,7 @@ public class MarkPropDefWithCondition { | ||
| 56 | 56 | private SortUnion sort; |
| 57 | 57 | private TimeUnit timeUnit; |
| 58 | 58 | private Type type; |
| 59 | - private ConditionalPredicateValueDefValue value; | |
| 59 | + private ColorValue value; | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Aggregation function for the field |
| @@ -77,9 +77,9 @@ public class MarkPropDefWithCondition { | ||
| 77 | 77 | * __Default value:__ `false` |
| 78 | 78 | */ |
| 79 | 79 | @JsonProperty("bin") |
| 80 | - public Bin getBin() { return bin; } | |
| 80 | + public ColorBin getBin() { return bin; } | |
| 81 | 81 | @JsonProperty("bin") |
| 82 | - public void setBin(Bin value) { this.bin = value; } | |
| 82 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * One or more value definition(s) with a selection predicate. |
| @@ -174,7 +174,7 @@ public class MarkPropDefWithCondition { | ||
| 174 | 174 | * A constant value in visual domain. |
| 175 | 175 | */ |
| 176 | 176 | @JsonProperty("value") |
| 177 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 177 | + public ColorValue getValue() { return value; } | |
| 178 | 178 | @JsonProperty("value") |
| 179 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 179 | + public void setValue(ColorValue value) { this.value = value; } | |
| 180 | 180 | } |
Dschema-java-lombokdefault / src / main / java / io / quicktype / OneOfElement.java+0 −69
| @@ -1,69 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The value that the field should be equal to. | |
| 12 | - */ | |
| 13 | -@JsonDeserialize(using = OneOfElement.Deserializer.class) | |
| 14 | -@JsonSerialize(using = OneOfElement.Serializer.class) | |
| 15 | -public class OneOfElement { | |
| 16 | - public Double doubleValue; | |
| 17 | - public Boolean boolValue; | |
| 18 | - public DateTime dateTimeValue; | |
| 19 | - public String stringValue; | |
| 20 | - | |
| 21 | - static class Deserializer extends JsonDeserializer<OneOfElement> { | |
| 22 | - @Override | |
| 23 | - public OneOfElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | - OneOfElement value = new OneOfElement(); | |
| 25 | - switch (jsonParser.currentToken()) { | |
| 26 | - case VALUE_NUMBER_INT: | |
| 27 | - case VALUE_NUMBER_FLOAT: | |
| 28 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 29 | - break; | |
| 30 | - case VALUE_TRUE: | |
| 31 | - case VALUE_FALSE: | |
| 32 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 33 | - break; | |
| 34 | - case VALUE_STRING: | |
| 35 | - String string = jsonParser.readValueAs(String.class); | |
| 36 | - value.stringValue = string; | |
| 37 | - break; | |
| 38 | - case START_OBJECT: | |
| 39 | - value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 40 | - break; | |
| 41 | - default: throw new IOException("Cannot deserialize OneOfElement"); | |
| 42 | - } | |
| 43 | - return value; | |
| 44 | - } | |
| 45 | - } | |
| 46 | - | |
| 47 | - static class Serializer extends JsonSerializer<OneOfElement> { | |
| 48 | - @Override | |
| 49 | - public void serialize(OneOfElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 50 | - if (obj.doubleValue != null) { | |
| 51 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 52 | - return; | |
| 53 | - } | |
| 54 | - if (obj.boolValue != null) { | |
| 55 | - jsonGenerator.writeObject(obj.boolValue); | |
| 56 | - return; | |
| 57 | - } | |
| 58 | - if (obj.dateTimeValue != null) { | |
| 59 | - jsonGenerator.writeObject(obj.dateTimeValue); | |
| 60 | - return; | |
| 61 | - } | |
| 62 | - if (obj.stringValue != null) { | |
| 63 | - jsonGenerator.writeObject(obj.stringValue); | |
| 64 | - return; | |
| 65 | - } | |
| 66 | - throw new IOException("OneOfElement must not be null"); | |
| 67 | - } | |
| 68 | - } | |
| 69 | -} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / OrderFieldDef.java+3 −3
| @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | |
| 5 | 5 | public class OrderFieldDef { |
| 6 | 6 | private AggregateOp aggregate; |
| 7 | - private Bin bin; | |
| 7 | + private ColorBin bin; | |
| 8 | 8 | private Field field; |
| 9 | 9 | private SortEnum sort; |
| 10 | 10 | private TimeUnit timeUnit; |
| @@ -29,9 +29,9 @@ public class OrderFieldDef { | ||
| 29 | 29 | * __Default value:__ `false` |
| 30 | 30 | */ |
| 31 | 31 | @JsonProperty("bin") |
| 32 | - public Bin getBin() { return bin; } | |
| 32 | + public ColorBin getBin() { return bin; } | |
| 33 | 33 | @JsonProperty("bin") |
| 34 | - public void setBin(Bin value) { this.bin = value; } | |
| 34 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-java-lombokdefault / src / main / java / io / quicktype / Predicate.java+18 −18
| @@ -4,38 +4,38 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Predicate { |
| 7 | - private ConditionalValueDefLogicalOperandPredicate not; | |
| 8 | - private List<LogicalOperandPredicateElement> and; | |
| 9 | - private List<LogicalOperandPredicateElement> or; | |
| 10 | - private EqualUnion equal; | |
| 7 | + private LogicalOperandPredicate not; | |
| 8 | + private List<LogicalOperandPredicate> and; | |
| 9 | + private List<LogicalOperandPredicate> or; | |
| 10 | + private Equal equal; | |
| 11 | 11 | private String field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private List<RangeElement> range; |
| 14 | - private List<OneOfElement> oneOf; | |
| 15 | - private ConditionalValueDefSelectionOperand selection; | |
| 14 | + private List<Equal> oneOf; | |
| 15 | + private SelectionOperand selection; | |
| 16 | 16 | |
| 17 | 17 | @JsonProperty("not") |
| 18 | - public ConditionalValueDefLogicalOperandPredicate getNot() { return not; } | |
| 18 | + public LogicalOperandPredicate getNot() { return not; } | |
| 19 | 19 | @JsonProperty("not") |
| 20 | - public void setNot(ConditionalValueDefLogicalOperandPredicate value) { this.not = value; } | |
| 20 | + public void setNot(LogicalOperandPredicate value) { this.not = value; } | |
| 21 | 21 | |
| 22 | 22 | @JsonProperty("and") |
| 23 | - public List<LogicalOperandPredicateElement> getAnd() { return and; } | |
| 23 | + public List<LogicalOperandPredicate> getAnd() { return and; } | |
| 24 | 24 | @JsonProperty("and") |
| 25 | - public void setAnd(List<LogicalOperandPredicateElement> value) { this.and = value; } | |
| 25 | + public void setAnd(List<LogicalOperandPredicate> value) { this.and = value; } | |
| 26 | 26 | |
| 27 | 27 | @JsonProperty("or") |
| 28 | - public List<LogicalOperandPredicateElement> getOr() { return or; } | |
| 28 | + public List<LogicalOperandPredicate> getOr() { return or; } | |
| 29 | 29 | @JsonProperty("or") |
| 30 | - public void setOr(List<LogicalOperandPredicateElement> value) { this.or = value; } | |
| 30 | + public void setOr(List<LogicalOperandPredicate> value) { this.or = value; } | |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The value that the field should be equal to. |
| 34 | 34 | */ |
| 35 | 35 | @JsonProperty("equal") |
| 36 | - public EqualUnion getEqual() { return equal; } | |
| 36 | + public Equal getEqual() { return equal; } | |
| 37 | 37 | @JsonProperty("equal") |
| 38 | - public void setEqual(EqualUnion value) { this.equal = value; } | |
| 38 | + public void setEqual(Equal value) { this.equal = value; } | |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Field to be filtered. |
| @@ -71,15 +71,15 @@ public class Predicate { | ||
| 71 | 71 | * for a data item included in the filtered data. |
| 72 | 72 | */ |
| 73 | 73 | @JsonProperty("oneOf") |
| 74 | - public List<OneOfElement> getOneOf() { return oneOf; } | |
| 74 | + public List<Equal> getOneOf() { return oneOf; } | |
| 75 | 75 | @JsonProperty("oneOf") |
| 76 | - public void setOneOf(List<OneOfElement> value) { this.oneOf = value; } | |
| 76 | + public void setOneOf(List<Equal> value) { this.oneOf = value; } | |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Filter using a selection name. |
| 80 | 80 | */ |
| 81 | 81 | @JsonProperty("selection") |
| 82 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 82 | + public SelectionOperand getSelection() { return selection; } | |
| 83 | 83 | @JsonProperty("selection") |
| 84 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 84 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 85 | 85 | } |
Mschema-java-lombokdefault / src / main / java / io / quicktype / Selection.java+9 −9
| @@ -4,22 +4,22 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Selection { |
| 7 | - private ConditionalValueDefSelectionOperand not; | |
| 8 | - private List<SelectionOperandElement> and; | |
| 9 | - private List<SelectionOperandElement> or; | |
| 7 | + private SelectionOperand not; | |
| 8 | + private List<SelectionOperand> and; | |
| 9 | + private List<SelectionOperand> or; | |
| 10 | 10 | |
| 11 | 11 | @JsonProperty("not") |
| 12 | - public ConditionalValueDefSelectionOperand getNot() { return not; } | |
| 12 | + public SelectionOperand getNot() { return not; } | |
| 13 | 13 | @JsonProperty("not") |
| 14 | - public void setNot(ConditionalValueDefSelectionOperand value) { this.not = value; } | |
| 14 | + public void setNot(SelectionOperand value) { this.not = value; } | |
| 15 | 15 | |
| 16 | 16 | @JsonProperty("and") |
| 17 | - public List<SelectionOperandElement> getAnd() { return and; } | |
| 17 | + public List<SelectionOperand> getAnd() { return and; } | |
| 18 | 18 | @JsonProperty("and") |
| 19 | - public void setAnd(List<SelectionOperandElement> value) { this.and = value; } | |
| 19 | + public void setAnd(List<SelectionOperand> value) { this.and = value; } | |
| 20 | 20 | |
| 21 | 21 | @JsonProperty("or") |
| 22 | - public List<SelectionOperandElement> getOr() { return or; } | |
| 22 | + public List<SelectionOperand> getOr() { return or; } | |
| 23 | 23 | @JsonProperty("or") |
| 24 | - public void setOr(List<SelectionOperandElement> value) { this.or = value; } | |
| 24 | + public void setOr(List<SelectionOperand> value) { this.or = value; } | |
| 25 | 25 | } |
Aschema-java-lombokdefault / src / main / java / io / quicktype / SelectionOperand.java+54 −0
| @@ -0,0 +1,54 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Filter using a selection name. | |
| 12 | + * | |
| 13 | + * A [selection name](selection.html), or a series of [composed | |
| 14 | + * selections](selection.html#compose). | |
| 15 | + */ | |
| 16 | +@JsonDeserialize(using = SelectionOperand.Deserializer.class) | |
| 17 | +@JsonSerialize(using = SelectionOperand.Serializer.class) | |
| 18 | +public class SelectionOperand { | |
| 19 | + public Selection selectionValue; | |
| 20 | + public String stringValue; | |
| 21 | + | |
| 22 | + static class Deserializer extends JsonDeserializer<SelectionOperand> { | |
| 23 | + @Override | |
| 24 | + public SelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | + SelectionOperand value = new SelectionOperand(); | |
| 26 | + switch (jsonParser.currentToken()) { | |
| 27 | + case VALUE_STRING: | |
| 28 | + String string = jsonParser.readValueAs(String.class); | |
| 29 | + value.stringValue = string; | |
| 30 | + break; | |
| 31 | + case START_OBJECT: | |
| 32 | + value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 33 | + break; | |
| 34 | + default: throw new IOException("Cannot deserialize SelectionOperand"); | |
| 35 | + } | |
| 36 | + return value; | |
| 37 | + } | |
| 38 | + } | |
| 39 | + | |
| 40 | + static class Serializer extends JsonSerializer<SelectionOperand> { | |
| 41 | + @Override | |
| 42 | + public void serialize(SelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 43 | + if (obj.selectionValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.selectionValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + if (obj.stringValue != null) { | |
| 48 | + jsonGenerator.writeObject(obj.stringValue); | |
| 49 | + return; | |
| 50 | + } | |
| 51 | + throw new IOException("SelectionOperand must not be null"); | |
| 52 | + } | |
| 53 | + } | |
| 54 | +} |
Dschema-java-lombokdefault / src / main / java / io / quicktype / SelectionOperandElement.java+0 −54
| @@ -1,54 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Filter using a selection name. | |
| 12 | - * | |
| 13 | - * A [selection name](selection.html), or a series of [composed | |
| 14 | - * selections](selection.html#compose). | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = SelectionOperandElement.Deserializer.class) | |
| 17 | -@JsonSerialize(using = SelectionOperandElement.Serializer.class) | |
| 18 | -public class SelectionOperandElement { | |
| 19 | - public Selection selectionValue; | |
| 20 | - public String stringValue; | |
| 21 | - | |
| 22 | - static class Deserializer extends JsonDeserializer<SelectionOperandElement> { | |
| 23 | - @Override | |
| 24 | - public SelectionOperandElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | - SelectionOperandElement value = new SelectionOperandElement(); | |
| 26 | - switch (jsonParser.currentToken()) { | |
| 27 | - case VALUE_STRING: | |
| 28 | - String string = jsonParser.readValueAs(String.class); | |
| 29 | - value.stringValue = string; | |
| 30 | - break; | |
| 31 | - case START_OBJECT: | |
| 32 | - value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 33 | - break; | |
| 34 | - default: throw new IOException("Cannot deserialize SelectionOperandElement"); | |
| 35 | - } | |
| 36 | - return value; | |
| 37 | - } | |
| 38 | - } | |
| 39 | - | |
| 40 | - static class Serializer extends JsonSerializer<SelectionOperandElement> { | |
| 41 | - @Override | |
| 42 | - public void serialize(SelectionOperandElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 43 | - if (obj.selectionValue != null) { | |
| 44 | - jsonGenerator.writeObject(obj.selectionValue); | |
| 45 | - return; | |
| 46 | - } | |
| 47 | - if (obj.stringValue != null) { | |
| 48 | - jsonGenerator.writeObject(obj.stringValue); | |
| 49 | - return; | |
| 50 | - } | |
| 51 | - throw new IOException("SelectionOperandElement must not be null"); | |
| 52 | - } | |
| 53 | - } | |
| 54 | -} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / TextDefWithCondition.java+6 −6
| @@ -23,13 +23,13 @@ import java.util.List; | ||
| 23 | 23 | */ |
| 24 | 24 | public class TextDefWithCondition { |
| 25 | 25 | private AggregateOp aggregate; |
| 26 | - private Bin bin; | |
| 26 | + private ColorBin bin; | |
| 27 | 27 | private TextCondition condition; |
| 28 | 28 | private Field field; |
| 29 | 29 | private String format; |
| 30 | 30 | private TimeUnit timeUnit; |
| 31 | 31 | private Type type; |
| 32 | - private ConditionalPredicateValueDefValue value; | |
| 32 | + private ColorValue value; | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Aggregation function for the field |
| @@ -50,9 +50,9 @@ public class TextDefWithCondition { | ||
| 50 | 50 | * __Default value:__ `false` |
| 51 | 51 | */ |
| 52 | 52 | @JsonProperty("bin") |
| 53 | - public Bin getBin() { return bin; } | |
| 53 | + public ColorBin getBin() { return bin; } | |
| 54 | 54 | @JsonProperty("bin") |
| 55 | - public void setBin(Bin value) { this.bin = value; } | |
| 55 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * One or more value definition(s) with a selection predicate. |
| @@ -120,7 +120,7 @@ public class TextDefWithCondition { | ||
| 120 | 120 | * A constant value in visual domain. |
| 121 | 121 | */ |
| 122 | 122 | @JsonProperty("value") |
| 123 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 123 | + public ColorValue getValue() { return value; } | |
| 124 | 124 | @JsonProperty("value") |
| 125 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 125 | + public void setValue(ColorValue value) { this.value = value; } | |
| 126 | 126 | } |
Mschema-java-lombokdefault / src / main / java / io / quicktype / Transform.java+6 −6
| @@ -4,13 +4,13 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Transform { |
| 7 | - private ConditionalValueDefLogicalOperandPredicate filter; | |
| 7 | + private LogicalOperandPredicate filter; | |
| 8 | 8 | private Style as; |
| 9 | 9 | private String calculate; |
| 10 | 10 | private String transformDefault; |
| 11 | 11 | private LookupData from; |
| 12 | 12 | private String lookup; |
| 13 | - private Bin bin; | |
| 13 | + private TransformBin bin; | |
| 14 | 14 | private String field; |
| 15 | 15 | private TimeUnit timeUnit; |
| 16 | 16 | private List<AggregatedFieldDef> aggregate; |
| @@ -27,9 +27,9 @@ public class Transform { | ||
| 27 | 27 | * or (4) a logical operand that combines (1), (2), or (3). |
| 28 | 28 | */ |
| 29 | 29 | @JsonProperty("filter") |
| 30 | - public ConditionalValueDefLogicalOperandPredicate getFilter() { return filter; } | |
| 30 | + public LogicalOperandPredicate getFilter() { return filter; } | |
| 31 | 31 | @JsonProperty("filter") |
| 32 | - public void setFilter(ConditionalValueDefLogicalOperandPredicate value) { this.filter = value; } | |
| 32 | + public void setFilter(LogicalOperandPredicate value) { this.filter = value; } | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * The field for storing the computed formula value. |
| @@ -87,9 +87,9 @@ public class Transform { | ||
| 87 | 87 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 88 | 88 | */ |
| 89 | 89 | @JsonProperty("bin") |
| 90 | - public Bin getBin() { return bin; } | |
| 90 | + public TransformBin getBin() { return bin; } | |
| 91 | 91 | @JsonProperty("bin") |
| 92 | - public void setBin(Bin value) { this.bin = value; } | |
| 92 | + public void setBin(TransformBin value) { this.bin = value; } | |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * The data field to bin. |
Aschema-java-lombokdefault / src / main / java / io / quicktype / TransformBin.java+48 −0
| @@ -0,0 +1,48 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = TransformBin.Deserializer.class) | |
| 11 | +@JsonSerialize(using = TransformBin.Serializer.class) | |
| 12 | +public class TransformBin { | |
| 13 | + public Boolean boolValue; | |
| 14 | + public BinParams binParamsValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<TransformBin> { | |
| 17 | + @Override | |
| 18 | + public TransformBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + TransformBin value = new TransformBin(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_TRUE: | |
| 22 | + case VALUE_FALSE: | |
| 23 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 24 | + break; | |
| 25 | + case START_OBJECT: | |
| 26 | + value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 27 | + break; | |
| 28 | + default: throw new IOException("Cannot deserialize TransformBin"); | |
| 29 | + } | |
| 30 | + return value; | |
| 31 | + } | |
| 32 | + } | |
| 33 | + | |
| 34 | + static class Serializer extends JsonSerializer<TransformBin> { | |
| 35 | + @Override | |
| 36 | + public void serialize(TransformBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 37 | + if (obj.boolValue != null) { | |
| 38 | + jsonGenerator.writeObject(obj.boolValue); | |
| 39 | + return; | |
| 40 | + } | |
| 41 | + if (obj.binParamsValue != null) { | |
| 42 | + jsonGenerator.writeObject(obj.binParamsValue); | |
| 43 | + return; | |
| 44 | + } | |
| 45 | + throw new IOException("TransformBin must not be null"); | |
| 46 | + } | |
| 47 | + } | |
| 48 | +} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / Values.java+1 −3
| @@ -27,8 +27,6 @@ public class Values { | ||
| 27 | 27 | public Values deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { |
| 28 | 28 | Values value = new Values(); |
| 29 | 29 | switch (jsonParser.currentToken()) { |
| 30 | - case VALUE_NULL: | |
| 31 | - break; | |
| 32 | 30 | case VALUE_STRING: |
| 33 | 31 | String string = jsonParser.readValueAs(String.class); |
| 34 | 32 | value.stringValue = string; |
| @@ -60,7 +58,7 @@ public class Values { | ||
| 60 | 58 | jsonGenerator.writeObject(obj.stringValue); |
| 61 | 59 | return; |
| 62 | 60 | } |
| 63 | - jsonGenerator.writeNull(); | |
| 61 | + throw new IOException("Values must not be null"); | |
| 64 | 62 | } |
| 65 | 63 | } |
| 66 | 64 | } |
Mschema-java-lombokdefault / src / main / java / io / quicktype / X2Class.java+6 −6
| @@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.*; | ||
| 13 | 13 | */ |
| 14 | 14 | public class X2Class { |
| 15 | 15 | private AggregateOp aggregate; |
| 16 | - private Bin bin; | |
| 16 | + private ColorBin bin; | |
| 17 | 17 | private Field field; |
| 18 | 18 | private TimeUnit timeUnit; |
| 19 | 19 | private Type type; |
| 20 | - private ConditionalPredicateValueDefValue value; | |
| 20 | + private ConditionalValueDefValue value; | |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Aggregation function for the field |
| @@ -38,9 +38,9 @@ public class X2Class { | ||
| 38 | 38 | * __Default value:__ `false` |
| 39 | 39 | */ |
| 40 | 40 | @JsonProperty("bin") |
| 41 | - public Bin getBin() { return bin; } | |
| 41 | + public ColorBin getBin() { return bin; } | |
| 42 | 42 | @JsonProperty("bin") |
| 43 | - public void setBin(Bin value) { this.bin = value; } | |
| 43 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * __Required.__ A string defining the name of the field from which to pull a data value |
| @@ -86,7 +86,7 @@ public class X2Class { | ||
| 86 | 86 | * `0` to `1` for opacity). |
| 87 | 87 | */ |
| 88 | 88 | @JsonProperty("value") |
| 89 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 89 | + public ConditionalValueDefValue getValue() { return value; } | |
| 90 | 90 | @JsonProperty("value") |
| 91 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 91 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 92 | 92 | } |
Mschema-java-lombokdefault / src / main / java / io / quicktype / XClass.java+6 −6
| @@ -12,14 +12,14 @@ import com.fasterxml.jackson.annotation.*; | ||
| 12 | 12 | public class XClass { |
| 13 | 13 | private AggregateOp aggregate; |
| 14 | 14 | private Axis axis; |
| 15 | - private Bin bin; | |
| 15 | + private ColorBin bin; | |
| 16 | 16 | private Field field; |
| 17 | 17 | private Scale scale; |
| 18 | 18 | private SortUnion sort; |
| 19 | 19 | private StackOffset stack; |
| 20 | 20 | private TimeUnit timeUnit; |
| 21 | 21 | private Type type; |
| 22 | - private ConditionalPredicateValueDefValue value; | |
| 22 | + private ConditionalValueDefValue value; | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Aggregation function for the field |
| @@ -51,9 +51,9 @@ public class XClass { | ||
| 51 | 51 | * __Default value:__ `false` |
| 52 | 52 | */ |
| 53 | 53 | @JsonProperty("bin") |
| 54 | - public Bin getBin() { return bin; } | |
| 54 | + public ColorBin getBin() { return bin; } | |
| 55 | 55 | @JsonProperty("bin") |
| 56 | - public void setBin(Bin value) { this.bin = value; } | |
| 56 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * __Required.__ A string defining the name of the field from which to pull a data value |
| @@ -151,7 +151,7 @@ public class XClass { | ||
| 151 | 151 | * `0` to `1` for opacity). |
| 152 | 152 | */ |
| 153 | 153 | @JsonProperty("value") |
| 154 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 154 | + public ConditionalValueDefValue getValue() { return value; } | |
| 155 | 155 | @JsonProperty("value") |
| 156 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 156 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 157 | 157 | } |
Mschema-javadefault / src / main / java / io / quicktype / AnyMark.java+1 −3
| @@ -24,8 +24,6 @@ public class AnyMark { | ||
| 24 | 24 | public AnyMark deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { |
| 25 | 25 | AnyMark value = new AnyMark(); |
| 26 | 26 | switch (jsonParser.currentToken()) { |
| 27 | - case VALUE_NULL: | |
| 28 | - break; | |
| 29 | 27 | case VALUE_STRING: |
| 30 | 28 | String string = jsonParser.readValueAs(String.class); |
| 31 | 29 | try { |
| @@ -54,7 +52,7 @@ public class AnyMark { | ||
| 54 | 52 | jsonGenerator.writeObject(obj.enumValue); |
| 55 | 53 | return; |
| 56 | 54 | } |
| 57 | - jsonGenerator.writeNull(); | |
| 55 | + throw new IOException("AnyMark must not be null"); | |
| 58 | 56 | } |
| 59 | 57 | } |
| 60 | 58 | } |
Dschema-javadefault / src / main / java / io / quicktype / Bin.java+0 −50
| @@ -1,50 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -@JsonDeserialize(using = Bin.Deserializer.class) | |
| 11 | -@JsonSerialize(using = Bin.Serializer.class) | |
| 12 | -public class Bin { | |
| 13 | - public Boolean boolValue; | |
| 14 | - public BinParams binParamsValue; | |
| 15 | - | |
| 16 | - static class Deserializer extends JsonDeserializer<Bin> { | |
| 17 | - @Override | |
| 18 | - public Bin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | - Bin value = new Bin(); | |
| 20 | - switch (jsonParser.currentToken()) { | |
| 21 | - case VALUE_NULL: | |
| 22 | - break; | |
| 23 | - case VALUE_TRUE: | |
| 24 | - case VALUE_FALSE: | |
| 25 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 26 | - break; | |
| 27 | - case START_OBJECT: | |
| 28 | - value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 29 | - break; | |
| 30 | - default: throw new IOException("Cannot deserialize Bin"); | |
| 31 | - } | |
| 32 | - return value; | |
| 33 | - } | |
| 34 | - } | |
| 35 | - | |
| 36 | - static class Serializer extends JsonSerializer<Bin> { | |
| 37 | - @Override | |
| 38 | - public void serialize(Bin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | - if (obj.boolValue != null) { | |
| 40 | - jsonGenerator.writeObject(obj.boolValue); | |
| 41 | - return; | |
| 42 | - } | |
| 43 | - if (obj.binParamsValue != null) { | |
| 44 | - jsonGenerator.writeObject(obj.binParamsValue); | |
| 45 | - return; | |
| 46 | - } | |
| 47 | - jsonGenerator.writeNull(); | |
| 48 | - } | |
| 49 | - } | |
| 50 | -} |
Aschema-javadefault / src / main / java / io / quicktype / ColorBin.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = ColorBin.Deserializer.class) | |
| 11 | +@JsonSerialize(using = ColorBin.Serializer.class) | |
| 12 | +public class ColorBin { | |
| 13 | + public Boolean boolValue; | |
| 14 | + public BinParams binParamsValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<ColorBin> { | |
| 17 | + @Override | |
| 18 | + public ColorBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + ColorBin value = new ColorBin(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_TRUE: | |
| 24 | + case VALUE_FALSE: | |
| 25 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize ColorBin"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<ColorBin> { | |
| 37 | + @Override | |
| 38 | + public void serialize(ColorBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.boolValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.boolValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.binParamsValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.binParamsValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-javadefault / src / main / java / io / quicktype / ColorValue.java+66 −0
| @@ -0,0 +1,66 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 12 | + * `0` to `1` for opacity). | |
| 13 | + * | |
| 14 | + * A constant value in visual domain. | |
| 15 | + */ | |
| 16 | +@JsonDeserialize(using = ColorValue.Deserializer.class) | |
| 17 | +@JsonSerialize(using = ColorValue.Serializer.class) | |
| 18 | +public class ColorValue { | |
| 19 | + public Double doubleValue; | |
| 20 | + public Boolean boolValue; | |
| 21 | + public String stringValue; | |
| 22 | + | |
| 23 | + static class Deserializer extends JsonDeserializer<ColorValue> { | |
| 24 | + @Override | |
| 25 | + public ColorValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 26 | + ColorValue value = new ColorValue(); | |
| 27 | + switch (jsonParser.currentToken()) { | |
| 28 | + case VALUE_NULL: | |
| 29 | + break; | |
| 30 | + case VALUE_NUMBER_INT: | |
| 31 | + case VALUE_NUMBER_FLOAT: | |
| 32 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 33 | + break; | |
| 34 | + case VALUE_TRUE: | |
| 35 | + case VALUE_FALSE: | |
| 36 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 37 | + break; | |
| 38 | + case VALUE_STRING: | |
| 39 | + String string = jsonParser.readValueAs(String.class); | |
| 40 | + value.stringValue = string; | |
| 41 | + break; | |
| 42 | + default: throw new IOException("Cannot deserialize ColorValue"); | |
| 43 | + } | |
| 44 | + return value; | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + static class Serializer extends JsonSerializer<ColorValue> { | |
| 49 | + @Override | |
| 50 | + public void serialize(ColorValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 51 | + if (obj.doubleValue != null) { | |
| 52 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + if (obj.boolValue != null) { | |
| 56 | + jsonGenerator.writeObject(obj.boolValue); | |
| 57 | + return; | |
| 58 | + } | |
| 59 | + if (obj.stringValue != null) { | |
| 60 | + jsonGenerator.writeObject(obj.stringValue); | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + jsonGenerator.writeNull(); | |
| 64 | + } | |
| 65 | + } | |
| 66 | +} |
Mschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateFieldDefClass.java+12 −12
| @@ -3,37 +3,37 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private Type type; |
| 14 | 14 | |
| 15 | 15 | @JsonProperty("test") |
| 16 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 16 | + public LogicalOperandPredicate getTest() { return test; } | |
| 17 | 17 | @JsonProperty("test") |
| 18 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 18 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 22 | 22 | * `0` to `1` for opacity). |
| 23 | 23 | */ |
| 24 | 24 | @JsonProperty("value") |
| 25 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 25 | + public ConditionalValueDefValue getValue() { return value; } | |
| 26 | 26 | @JsonProperty("value") |
| 27 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 27 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * A [selection name](selection.html), or a series of [composed |
| 31 | 31 | * selections](selection.html#compose). |
| 32 | 32 | */ |
| 33 | 33 | @JsonProperty("selection") |
| 34 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 34 | + public SelectionOperand getSelection() { return selection; } | |
| 35 | 35 | @JsonProperty("selection") |
| 36 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 36 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Aggregation function for the field |
| @@ -54,9 +54,9 @@ public class ConditionalPredicateFieldDefClass { | ||
| 54 | 54 | * __Default value:__ `false` |
| 55 | 55 | */ |
| 56 | 56 | @JsonProperty("bin") |
| 57 | - public Bin getBin() { return bin; } | |
| 57 | + public ColorBin getBin() { return bin; } | |
| 58 | 58 | @JsonProperty("bin") |
| 59 | - public void setBin(Bin value) { this.bin = value; } | |
| 59 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateMarkPropFieldDefClass.java+12 −12
| @@ -3,11 +3,11 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateMarkPropFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private Legend legend; |
| 13 | 13 | private Scale scale; |
| @@ -16,27 +16,27 @@ public class ConditionalPredicateMarkPropFieldDefClass { | ||
| 16 | 16 | private Type type; |
| 17 | 17 | |
| 18 | 18 | @JsonProperty("test") |
| 19 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 19 | + public LogicalOperandPredicate getTest() { return test; } | |
| 20 | 20 | @JsonProperty("test") |
| 21 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 21 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 25 | 25 | * `0` to `1` for opacity). |
| 26 | 26 | */ |
| 27 | 27 | @JsonProperty("value") |
| 28 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 28 | + public ConditionalValueDefValue getValue() { return value; } | |
| 29 | 29 | @JsonProperty("value") |
| 30 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 30 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * A [selection name](selection.html), or a series of [composed |
| 34 | 34 | * selections](selection.html#compose). |
| 35 | 35 | */ |
| 36 | 36 | @JsonProperty("selection") |
| 37 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 37 | + public SelectionOperand getSelection() { return selection; } | |
| 38 | 38 | @JsonProperty("selection") |
| 39 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 39 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Aggregation function for the field |
| @@ -57,9 +57,9 @@ public class ConditionalPredicateMarkPropFieldDefClass { | ||
| 57 | 57 | * __Default value:__ `false` |
| 58 | 58 | */ |
| 59 | 59 | @JsonProperty("bin") |
| 60 | - public Bin getBin() { return bin; } | |
| 60 | + public ColorBin getBin() { return bin; } | |
| 61 | 61 | @JsonProperty("bin") |
| 62 | - public void setBin(Bin value) { this.bin = value; } | |
| 62 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateTextFieldDefClass.java+12 −12
| @@ -3,38 +3,38 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalPredicateTextFieldDefClass { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 7 | - private ConditionalPredicateValueDefValue value; | |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | + private ConditionalValueDefValue value; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private String format; |
| 13 | 13 | private TimeUnit timeUnit; |
| 14 | 14 | private Type type; |
| 15 | 15 | |
| 16 | 16 | @JsonProperty("test") |
| 17 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 17 | + public LogicalOperandPredicate getTest() { return test; } | |
| 18 | 18 | @JsonProperty("test") |
| 19 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 19 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 23 | 23 | * `0` to `1` for opacity). |
| 24 | 24 | */ |
| 25 | 25 | @JsonProperty("value") |
| 26 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 26 | + public ConditionalValueDefValue getValue() { return value; } | |
| 27 | 27 | @JsonProperty("value") |
| 28 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 28 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * A [selection name](selection.html), or a series of [composed |
| 32 | 32 | * selections](selection.html#compose). |
| 33 | 33 | */ |
| 34 | 34 | @JsonProperty("selection") |
| 35 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 35 | + public SelectionOperand getSelection() { return selection; } | |
| 36 | 36 | @JsonProperty("selection") |
| 37 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 37 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Aggregation function for the field |
| @@ -55,9 +55,9 @@ public class ConditionalPredicateTextFieldDefClass { | ||
| 55 | 55 | * __Default value:__ `false` |
| 56 | 56 | */ |
| 57 | 57 | @JsonProperty("bin") |
| 58 | - public Bin getBin() { return bin; } | |
| 58 | + public ColorBin getBin() { return bin; } | |
| 59 | 59 | @JsonProperty("bin") |
| 60 | - public void setBin(Bin value) { this.bin = value; } | |
| 60 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * __Required.__ A string defining the name of the field from which to pull a data value |
Dschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateValueDefValue.java+0 −66
| @@ -1,66 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 12 | - * `0` to `1` for opacity). | |
| 13 | - * | |
| 14 | - * A constant value in visual domain. | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = ConditionalPredicateValueDefValue.Deserializer.class) | |
| 17 | -@JsonSerialize(using = ConditionalPredicateValueDefValue.Serializer.class) | |
| 18 | -public class ConditionalPredicateValueDefValue { | |
| 19 | - public Double doubleValue; | |
| 20 | - public Boolean boolValue; | |
| 21 | - public String stringValue; | |
| 22 | - | |
| 23 | - static class Deserializer extends JsonDeserializer<ConditionalPredicateValueDefValue> { | |
| 24 | - @Override | |
| 25 | - public ConditionalPredicateValueDefValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 26 | - ConditionalPredicateValueDefValue value = new ConditionalPredicateValueDefValue(); | |
| 27 | - switch (jsonParser.currentToken()) { | |
| 28 | - case VALUE_NULL: | |
| 29 | - break; | |
| 30 | - case VALUE_NUMBER_INT: | |
| 31 | - case VALUE_NUMBER_FLOAT: | |
| 32 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 33 | - break; | |
| 34 | - case VALUE_TRUE: | |
| 35 | - case VALUE_FALSE: | |
| 36 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 37 | - break; | |
| 38 | - case VALUE_STRING: | |
| 39 | - String string = jsonParser.readValueAs(String.class); | |
| 40 | - value.stringValue = string; | |
| 41 | - break; | |
| 42 | - default: throw new IOException("Cannot deserialize ConditionalPredicateValueDefValue"); | |
| 43 | - } | |
| 44 | - return value; | |
| 45 | - } | |
| 46 | - } | |
| 47 | - | |
| 48 | - static class Serializer extends JsonSerializer<ConditionalPredicateValueDefValue> { | |
| 49 | - @Override | |
| 50 | - public void serialize(ConditionalPredicateValueDefValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 51 | - if (obj.doubleValue != null) { | |
| 52 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 53 | - return; | |
| 54 | - } | |
| 55 | - if (obj.boolValue != null) { | |
| 56 | - jsonGenerator.writeObject(obj.boolValue); | |
| 57 | - return; | |
| 58 | - } | |
| 59 | - if (obj.stringValue != null) { | |
| 60 | - jsonGenerator.writeObject(obj.stringValue); | |
| 61 | - return; | |
| 62 | - } | |
| 63 | - jsonGenerator.writeNull(); | |
| 64 | - } | |
| 65 | - } | |
| 66 | -} |
Mschema-javadefault / src / main / java / io / quicktype / ConditionalValueDef.java+6 −6
| @@ -3,14 +3,14 @@ package io.quicktype; | ||
| 3 | 3 | import com.fasterxml.jackson.annotation.*; |
| 4 | 4 | |
| 5 | 5 | public class ConditionalValueDef { |
| 6 | - private ConditionalValueDefLogicalOperandPredicate test; | |
| 6 | + private LogicalOperandPredicate test; | |
| 7 | 7 | private ConditionalValueDefValue value; |
| 8 | - private ConditionalValueDefSelectionOperand selection; | |
| 8 | + private SelectionOperand selection; | |
| 9 | 9 | |
| 10 | 10 | @JsonProperty("test") |
| 11 | - public ConditionalValueDefLogicalOperandPredicate getTest() { return test; } | |
| 11 | + public LogicalOperandPredicate getTest() { return test; } | |
| 12 | 12 | @JsonProperty("test") |
| 13 | - public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; } | |
| 13 | + public void setTest(LogicalOperandPredicate value) { this.test = value; } | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -26,7 +26,7 @@ public class ConditionalValueDef { | ||
| 26 | 26 | * selections](selection.html#compose). |
| 27 | 27 | */ |
| 28 | 28 | @JsonProperty("selection") |
| 29 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 29 | + public SelectionOperand getSelection() { return selection; } | |
| 30 | 30 | @JsonProperty("selection") |
| 31 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 31 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 32 | 32 | } |
Dschema-javadefault / src / main / java / io / quicktype / ConditionalValueDefLogicalOperandPredicate.java+0 −60
| @@ -1,60 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The `filter` property must be one of the predicate definitions: | |
| 12 | - * (1) an [expression](types.html#expression) string, | |
| 13 | - * where `datum` can be used to refer to the current data object; | |
| 14 | - * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | - * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | - * predicate](filter.html#one-of-predicate); | |
| 17 | - * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | - * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | - */ | |
| 20 | -@JsonDeserialize(using = ConditionalValueDefLogicalOperandPredicate.Deserializer.class) | |
| 21 | -@JsonSerialize(using = ConditionalValueDefLogicalOperandPredicate.Serializer.class) | |
| 22 | -public class ConditionalValueDefLogicalOperandPredicate { | |
| 23 | - public Predicate predicateValue; | |
| 24 | - public String stringValue; | |
| 25 | - | |
| 26 | - static class Deserializer extends JsonDeserializer<ConditionalValueDefLogicalOperandPredicate> { | |
| 27 | - @Override | |
| 28 | - public ConditionalValueDefLogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | - ConditionalValueDefLogicalOperandPredicate value = new ConditionalValueDefLogicalOperandPredicate(); | |
| 30 | - switch (jsonParser.currentToken()) { | |
| 31 | - case VALUE_NULL: | |
| 32 | - break; | |
| 33 | - case VALUE_STRING: | |
| 34 | - String string = jsonParser.readValueAs(String.class); | |
| 35 | - value.stringValue = string; | |
| 36 | - break; | |
| 37 | - case START_OBJECT: | |
| 38 | - value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 39 | - break; | |
| 40 | - default: throw new IOException("Cannot deserialize ConditionalValueDefLogicalOperandPredicate"); | |
| 41 | - } | |
| 42 | - return value; | |
| 43 | - } | |
| 44 | - } | |
| 45 | - | |
| 46 | - static class Serializer extends JsonSerializer<ConditionalValueDefLogicalOperandPredicate> { | |
| 47 | - @Override | |
| 48 | - public void serialize(ConditionalValueDefLogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 49 | - if (obj.predicateValue != null) { | |
| 50 | - jsonGenerator.writeObject(obj.predicateValue); | |
| 51 | - return; | |
| 52 | - } | |
| 53 | - if (obj.stringValue != null) { | |
| 54 | - jsonGenerator.writeObject(obj.stringValue); | |
| 55 | - return; | |
| 56 | - } | |
| 57 | - jsonGenerator.writeNull(); | |
| 58 | - } | |
| 59 | - } | |
| 60 | -} |
Dschema-javadefault / src / main / java / io / quicktype / ConditionalValueDefSelectionOperand.java+0 −56
| @@ -1,56 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Filter using a selection name. | |
| 12 | - * | |
| 13 | - * A [selection name](selection.html), or a series of [composed | |
| 14 | - * selections](selection.html#compose). | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = ConditionalValueDefSelectionOperand.Deserializer.class) | |
| 17 | -@JsonSerialize(using = ConditionalValueDefSelectionOperand.Serializer.class) | |
| 18 | -public class ConditionalValueDefSelectionOperand { | |
| 19 | - public Selection selectionValue; | |
| 20 | - public String stringValue; | |
| 21 | - | |
| 22 | - static class Deserializer extends JsonDeserializer<ConditionalValueDefSelectionOperand> { | |
| 23 | - @Override | |
| 24 | - public ConditionalValueDefSelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | - ConditionalValueDefSelectionOperand value = new ConditionalValueDefSelectionOperand(); | |
| 26 | - switch (jsonParser.currentToken()) { | |
| 27 | - case VALUE_NULL: | |
| 28 | - break; | |
| 29 | - case VALUE_STRING: | |
| 30 | - String string = jsonParser.readValueAs(String.class); | |
| 31 | - value.stringValue = string; | |
| 32 | - break; | |
| 33 | - case START_OBJECT: | |
| 34 | - value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 35 | - break; | |
| 36 | - default: throw new IOException("Cannot deserialize ConditionalValueDefSelectionOperand"); | |
| 37 | - } | |
| 38 | - return value; | |
| 39 | - } | |
| 40 | - } | |
| 41 | - | |
| 42 | - static class Serializer extends JsonSerializer<ConditionalValueDefSelectionOperand> { | |
| 43 | - @Override | |
| 44 | - public void serialize(ConditionalValueDefSelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 45 | - if (obj.selectionValue != null) { | |
| 46 | - jsonGenerator.writeObject(obj.selectionValue); | |
| 47 | - return; | |
| 48 | - } | |
| 49 | - if (obj.stringValue != null) { | |
| 50 | - jsonGenerator.writeObject(obj.stringValue); | |
| 51 | - return; | |
| 52 | - } | |
| 53 | - jsonGenerator.writeNull(); | |
| 54 | - } | |
| 55 | - } | |
| 56 | -} |
Mschema-javadefault / src / main / java / io / quicktype / DefWithCondition.java+6 −6
| @@ -21,12 +21,12 @@ import java.util.List; | ||
| 21 | 21 | */ |
| 22 | 22 | public class DefWithCondition { |
| 23 | 23 | private AggregateOp aggregate; |
| 24 | - private Bin bin; | |
| 24 | + private ColorBin bin; | |
| 25 | 25 | private HrefCondition condition; |
| 26 | 26 | private Field field; |
| 27 | 27 | private TimeUnit timeUnit; |
| 28 | 28 | private Type type; |
| 29 | - private ConditionalPredicateValueDefValue value; | |
| 29 | + private ColorValue value; | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Aggregation function for the field |
| @@ -47,9 +47,9 @@ public class DefWithCondition { | ||
| 47 | 47 | * __Default value:__ `false` |
| 48 | 48 | */ |
| 49 | 49 | @JsonProperty("bin") |
| 50 | - public Bin getBin() { return bin; } | |
| 50 | + public ColorBin getBin() { return bin; } | |
| 51 | 51 | @JsonProperty("bin") |
| 52 | - public void setBin(Bin value) { this.bin = value; } | |
| 52 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * One or more value definition(s) with a selection predicate. |
| @@ -108,7 +108,7 @@ public class DefWithCondition { | ||
| 108 | 108 | * A constant value in visual domain. |
| 109 | 109 | */ |
| 110 | 110 | @JsonProperty("value") |
| 111 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 111 | + public ColorValue getValue() { return value; } | |
| 112 | 112 | @JsonProperty("value") |
| 113 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 113 | + public void setValue(ColorValue value) { this.value = value; } | |
| 114 | 114 | } |
Mschema-javadefault / src / main / java / io / quicktype / DomainUnion.java+2 −2
| @@ -29,7 +29,7 @@ import java.util.List; | ||
| 29 | 29 | @JsonDeserialize(using = DomainUnion.Deserializer.class) |
| 30 | 30 | @JsonSerialize(using = DomainUnion.Serializer.class) |
| 31 | 31 | public class DomainUnion { |
| 32 | - public List<OneOfElement> unionArrayValue; | |
| 32 | + public List<Equal> unionArrayValue; | |
| 33 | 33 | public DomainClass domainClassValue; |
| 34 | 34 | public Domain enumValue; |
| 35 | 35 | |
| @@ -49,7 +49,7 @@ public class DomainUnion { | ||
| 49 | 49 | } |
| 50 | 50 | break; |
| 51 | 51 | case START_ARRAY: |
| 52 | - value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<OneOfElement>>() {}); | |
| 52 | + value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<Equal>>() {}); | |
| 53 | 53 | break; |
| 54 | 54 | case START_OBJECT: |
| 55 | 55 | value.domainClassValue = jsonParser.readValueAs(DomainClass.class); |
Aschema-javadefault / src / main / java / io / quicktype / Equal.java+69 −0
| @@ -0,0 +1,69 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The value that the field should be equal to. | |
| 12 | + */ | |
| 13 | +@JsonDeserialize(using = Equal.Deserializer.class) | |
| 14 | +@JsonSerialize(using = Equal.Serializer.class) | |
| 15 | +public class Equal { | |
| 16 | + public Double doubleValue; | |
| 17 | + public Boolean boolValue; | |
| 18 | + public DateTime dateTimeValue; | |
| 19 | + public String stringValue; | |
| 20 | + | |
| 21 | + static class Deserializer extends JsonDeserializer<Equal> { | |
| 22 | + @Override | |
| 23 | + public Equal deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | + Equal value = new Equal(); | |
| 25 | + switch (jsonParser.currentToken()) { | |
| 26 | + case VALUE_NUMBER_INT: | |
| 27 | + case VALUE_NUMBER_FLOAT: | |
| 28 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 29 | + break; | |
| 30 | + case VALUE_TRUE: | |
| 31 | + case VALUE_FALSE: | |
| 32 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 33 | + break; | |
| 34 | + case VALUE_STRING: | |
| 35 | + String string = jsonParser.readValueAs(String.class); | |
| 36 | + value.stringValue = string; | |
| 37 | + break; | |
| 38 | + case START_OBJECT: | |
| 39 | + value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 40 | + break; | |
| 41 | + default: throw new IOException("Cannot deserialize Equal"); | |
| 42 | + } | |
| 43 | + return value; | |
| 44 | + } | |
| 45 | + } | |
| 46 | + | |
| 47 | + static class Serializer extends JsonSerializer<Equal> { | |
| 48 | + @Override | |
| 49 | + public void serialize(Equal obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 50 | + if (obj.doubleValue != null) { | |
| 51 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 52 | + return; | |
| 53 | + } | |
| 54 | + if (obj.boolValue != null) { | |
| 55 | + jsonGenerator.writeObject(obj.boolValue); | |
| 56 | + return; | |
| 57 | + } | |
| 58 | + if (obj.dateTimeValue != null) { | |
| 59 | + jsonGenerator.writeObject(obj.dateTimeValue); | |
| 60 | + return; | |
| 61 | + } | |
| 62 | + if (obj.stringValue != null) { | |
| 63 | + jsonGenerator.writeObject(obj.stringValue); | |
| 64 | + return; | |
| 65 | + } | |
| 66 | + throw new IOException("Equal must not be null"); | |
| 67 | + } | |
| 68 | + } | |
| 69 | +} |
Dschema-javadefault / src / main / java / io / quicktype / EqualUnion.java+0 −71
| @@ -1,71 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The value that the field should be equal to. | |
| 12 | - */ | |
| 13 | -@JsonDeserialize(using = EqualUnion.Deserializer.class) | |
| 14 | -@JsonSerialize(using = EqualUnion.Serializer.class) | |
| 15 | -public class EqualUnion { | |
| 16 | - public Double doubleValue; | |
| 17 | - public Boolean boolValue; | |
| 18 | - public DateTime dateTimeValue; | |
| 19 | - public String stringValue; | |
| 20 | - | |
| 21 | - static class Deserializer extends JsonDeserializer<EqualUnion> { | |
| 22 | - @Override | |
| 23 | - public EqualUnion deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | - EqualUnion value = new EqualUnion(); | |
| 25 | - switch (jsonParser.currentToken()) { | |
| 26 | - case VALUE_NULL: | |
| 27 | - break; | |
| 28 | - case VALUE_NUMBER_INT: | |
| 29 | - case VALUE_NUMBER_FLOAT: | |
| 30 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 31 | - break; | |
| 32 | - case VALUE_TRUE: | |
| 33 | - case VALUE_FALSE: | |
| 34 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 35 | - break; | |
| 36 | - case VALUE_STRING: | |
| 37 | - String string = jsonParser.readValueAs(String.class); | |
| 38 | - value.stringValue = string; | |
| 39 | - break; | |
| 40 | - case START_OBJECT: | |
| 41 | - value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 42 | - break; | |
| 43 | - default: throw new IOException("Cannot deserialize EqualUnion"); | |
| 44 | - } | |
| 45 | - return value; | |
| 46 | - } | |
| 47 | - } | |
| 48 | - | |
| 49 | - static class Serializer extends JsonSerializer<EqualUnion> { | |
| 50 | - @Override | |
| 51 | - public void serialize(EqualUnion obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 52 | - if (obj.doubleValue != null) { | |
| 53 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 54 | - return; | |
| 55 | - } | |
| 56 | - if (obj.boolValue != null) { | |
| 57 | - jsonGenerator.writeObject(obj.boolValue); | |
| 58 | - return; | |
| 59 | - } | |
| 60 | - if (obj.dateTimeValue != null) { | |
| 61 | - jsonGenerator.writeObject(obj.dateTimeValue); | |
| 62 | - return; | |
| 63 | - } | |
| 64 | - if (obj.stringValue != null) { | |
| 65 | - jsonGenerator.writeObject(obj.stringValue); | |
| 66 | - return; | |
| 67 | - } | |
| 68 | - jsonGenerator.writeNull(); | |
| 69 | - } | |
| 70 | - } | |
| 71 | -} |
Mschema-javadefault / src / main / java / io / quicktype / FacetFieldDef.java+3 −3
| @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 9 | 9 | */ |
| 10 | 10 | public class FacetFieldDef { |
| 11 | 11 | private AggregateOp aggregate; |
| 12 | - private Bin bin; | |
| 12 | + private ColorBin bin; | |
| 13 | 13 | private Field field; |
| 14 | 14 | private Header header; |
| 15 | 15 | private SortEnum sort; |
| @@ -35,9 +35,9 @@ public class FacetFieldDef { | ||
| 35 | 35 | * __Default value:__ `false` |
| 36 | 36 | */ |
| 37 | 37 | @JsonProperty("bin") |
| 38 | - public Bin getBin() { return bin; } | |
| 38 | + public ColorBin getBin() { return bin; } | |
| 39 | 39 | @JsonProperty("bin") |
| 40 | - public void setBin(Bin value) { this.bin = value; } | |
| 40 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-javadefault / src / main / java / io / quicktype / FieldDef.java+3 −3
| @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 7 | 7 | */ |
| 8 | 8 | public class FieldDef { |
| 9 | 9 | private AggregateOp aggregate; |
| 10 | - private Bin bin; | |
| 10 | + private ColorBin bin; | |
| 11 | 11 | private Field field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private Type type; |
| @@ -31,9 +31,9 @@ public class FieldDef { | ||
| 31 | 31 | * __Default value:__ `false` |
| 32 | 32 | */ |
| 33 | 33 | @JsonProperty("bin") |
| 34 | - public Bin getBin() { return bin; } | |
| 34 | + public ColorBin getBin() { return bin; } | |
| 35 | 35 | @JsonProperty("bin") |
| 36 | - public void setBin(Bin value) { this.bin = value; } | |
| 36 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * __Required.__ A string defining the name of the field from which to pull a data value |
Aschema-javadefault / src / main / java / io / quicktype / LogicalOperandPredicate.java+58 −0
| @@ -0,0 +1,58 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The `filter` property must be one of the predicate definitions: | |
| 12 | + * (1) an [expression](types.html#expression) string, | |
| 13 | + * where `datum` can be used to refer to the current data object; | |
| 14 | + * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | + * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | + * predicate](filter.html#one-of-predicate); | |
| 17 | + * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | + * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | + */ | |
| 20 | +@JsonDeserialize(using = LogicalOperandPredicate.Deserializer.class) | |
| 21 | +@JsonSerialize(using = LogicalOperandPredicate.Serializer.class) | |
| 22 | +public class LogicalOperandPredicate { | |
| 23 | + public Predicate predicateValue; | |
| 24 | + public String stringValue; | |
| 25 | + | |
| 26 | + static class Deserializer extends JsonDeserializer<LogicalOperandPredicate> { | |
| 27 | + @Override | |
| 28 | + public LogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | + LogicalOperandPredicate value = new LogicalOperandPredicate(); | |
| 30 | + switch (jsonParser.currentToken()) { | |
| 31 | + case VALUE_STRING: | |
| 32 | + String string = jsonParser.readValueAs(String.class); | |
| 33 | + value.stringValue = string; | |
| 34 | + break; | |
| 35 | + case START_OBJECT: | |
| 36 | + value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 37 | + break; | |
| 38 | + default: throw new IOException("Cannot deserialize LogicalOperandPredicate"); | |
| 39 | + } | |
| 40 | + return value; | |
| 41 | + } | |
| 42 | + } | |
| 43 | + | |
| 44 | + static class Serializer extends JsonSerializer<LogicalOperandPredicate> { | |
| 45 | + @Override | |
| 46 | + public void serialize(LogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 47 | + if (obj.predicateValue != null) { | |
| 48 | + jsonGenerator.writeObject(obj.predicateValue); | |
| 49 | + return; | |
| 50 | + } | |
| 51 | + if (obj.stringValue != null) { | |
| 52 | + jsonGenerator.writeObject(obj.stringValue); | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + throw new IOException("LogicalOperandPredicate must not be null"); | |
| 56 | + } | |
| 57 | + } | |
| 58 | +} |
Dschema-javadefault / src / main / java / io / quicktype / LogicalOperandPredicateElement.java+0 −58
| @@ -1,58 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The `filter` property must be one of the predicate definitions: | |
| 12 | - * (1) an [expression](types.html#expression) string, | |
| 13 | - * where `datum` can be used to refer to the current data object; | |
| 14 | - * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 15 | - * [range predicate](filter.html#range-predicate), [one-of | |
| 16 | - * predicate](filter.html#one-of-predicate); | |
| 17 | - * (3) a [selection predicate](filter.html#selection-predicate); | |
| 18 | - * or (4) a logical operand that combines (1), (2), or (3). | |
| 19 | - */ | |
| 20 | -@JsonDeserialize(using = LogicalOperandPredicateElement.Deserializer.class) | |
| 21 | -@JsonSerialize(using = LogicalOperandPredicateElement.Serializer.class) | |
| 22 | -public class LogicalOperandPredicateElement { | |
| 23 | - public Predicate predicateValue; | |
| 24 | - public String stringValue; | |
| 25 | - | |
| 26 | - static class Deserializer extends JsonDeserializer<LogicalOperandPredicateElement> { | |
| 27 | - @Override | |
| 28 | - public LogicalOperandPredicateElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 29 | - LogicalOperandPredicateElement value = new LogicalOperandPredicateElement(); | |
| 30 | - switch (jsonParser.currentToken()) { | |
| 31 | - case VALUE_STRING: | |
| 32 | - String string = jsonParser.readValueAs(String.class); | |
| 33 | - value.stringValue = string; | |
| 34 | - break; | |
| 35 | - case START_OBJECT: | |
| 36 | - value.predicateValue = jsonParser.readValueAs(Predicate.class); | |
| 37 | - break; | |
| 38 | - default: throw new IOException("Cannot deserialize LogicalOperandPredicateElement"); | |
| 39 | - } | |
| 40 | - return value; | |
| 41 | - } | |
| 42 | - } | |
| 43 | - | |
| 44 | - static class Serializer extends JsonSerializer<LogicalOperandPredicateElement> { | |
| 45 | - @Override | |
| 46 | - public void serialize(LogicalOperandPredicateElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 47 | - if (obj.predicateValue != null) { | |
| 48 | - jsonGenerator.writeObject(obj.predicateValue); | |
| 49 | - return; | |
| 50 | - } | |
| 51 | - if (obj.stringValue != null) { | |
| 52 | - jsonGenerator.writeObject(obj.stringValue); | |
| 53 | - return; | |
| 54 | - } | |
| 55 | - throw new IOException("LogicalOperandPredicateElement must not be null"); | |
| 56 | - } | |
| 57 | - } | |
| 58 | -} |
Mschema-javadefault / src / main / java / io / quicktype / MarkPropDefWithCondition.java+6 −6
| @@ -48,7 +48,7 @@ import java.util.List; | ||
| 48 | 48 | */ |
| 49 | 49 | public class MarkPropDefWithCondition { |
| 50 | 50 | private AggregateOp aggregate; |
| 51 | - private Bin bin; | |
| 51 | + private ColorBin bin; | |
| 52 | 52 | private ColorCondition condition; |
| 53 | 53 | private Field field; |
| 54 | 54 | private Legend legend; |
| @@ -56,7 +56,7 @@ public class MarkPropDefWithCondition { | ||
| 56 | 56 | private SortUnion sort; |
| 57 | 57 | private TimeUnit timeUnit; |
| 58 | 58 | private Type type; |
| 59 | - private ConditionalPredicateValueDefValue value; | |
| 59 | + private ColorValue value; | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Aggregation function for the field |
| @@ -77,9 +77,9 @@ public class MarkPropDefWithCondition { | ||
| 77 | 77 | * __Default value:__ `false` |
| 78 | 78 | */ |
| 79 | 79 | @JsonProperty("bin") |
| 80 | - public Bin getBin() { return bin; } | |
| 80 | + public ColorBin getBin() { return bin; } | |
| 81 | 81 | @JsonProperty("bin") |
| 82 | - public void setBin(Bin value) { this.bin = value; } | |
| 82 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * One or more value definition(s) with a selection predicate. |
| @@ -174,7 +174,7 @@ public class MarkPropDefWithCondition { | ||
| 174 | 174 | * A constant value in visual domain. |
| 175 | 175 | */ |
| 176 | 176 | @JsonProperty("value") |
| 177 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 177 | + public ColorValue getValue() { return value; } | |
| 178 | 178 | @JsonProperty("value") |
| 179 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 179 | + public void setValue(ColorValue value) { this.value = value; } | |
| 180 | 180 | } |
Dschema-javadefault / src / main / java / io / quicktype / OneOfElement.java+0 −69
| @@ -1,69 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * The value that the field should be equal to. | |
| 12 | - */ | |
| 13 | -@JsonDeserialize(using = OneOfElement.Deserializer.class) | |
| 14 | -@JsonSerialize(using = OneOfElement.Serializer.class) | |
| 15 | -public class OneOfElement { | |
| 16 | - public Double doubleValue; | |
| 17 | - public Boolean boolValue; | |
| 18 | - public DateTime dateTimeValue; | |
| 19 | - public String stringValue; | |
| 20 | - | |
| 21 | - static class Deserializer extends JsonDeserializer<OneOfElement> { | |
| 22 | - @Override | |
| 23 | - public OneOfElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 24 | - OneOfElement value = new OneOfElement(); | |
| 25 | - switch (jsonParser.currentToken()) { | |
| 26 | - case VALUE_NUMBER_INT: | |
| 27 | - case VALUE_NUMBER_FLOAT: | |
| 28 | - value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 29 | - break; | |
| 30 | - case VALUE_TRUE: | |
| 31 | - case VALUE_FALSE: | |
| 32 | - value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 33 | - break; | |
| 34 | - case VALUE_STRING: | |
| 35 | - String string = jsonParser.readValueAs(String.class); | |
| 36 | - value.stringValue = string; | |
| 37 | - break; | |
| 38 | - case START_OBJECT: | |
| 39 | - value.dateTimeValue = jsonParser.readValueAs(DateTime.class); | |
| 40 | - break; | |
| 41 | - default: throw new IOException("Cannot deserialize OneOfElement"); | |
| 42 | - } | |
| 43 | - return value; | |
| 44 | - } | |
| 45 | - } | |
| 46 | - | |
| 47 | - static class Serializer extends JsonSerializer<OneOfElement> { | |
| 48 | - @Override | |
| 49 | - public void serialize(OneOfElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 50 | - if (obj.doubleValue != null) { | |
| 51 | - jsonGenerator.writeObject(obj.doubleValue); | |
| 52 | - return; | |
| 53 | - } | |
| 54 | - if (obj.boolValue != null) { | |
| 55 | - jsonGenerator.writeObject(obj.boolValue); | |
| 56 | - return; | |
| 57 | - } | |
| 58 | - if (obj.dateTimeValue != null) { | |
| 59 | - jsonGenerator.writeObject(obj.dateTimeValue); | |
| 60 | - return; | |
| 61 | - } | |
| 62 | - if (obj.stringValue != null) { | |
| 63 | - jsonGenerator.writeObject(obj.stringValue); | |
| 64 | - return; | |
| 65 | - } | |
| 66 | - throw new IOException("OneOfElement must not be null"); | |
| 67 | - } | |
| 68 | - } | |
| 69 | -} |
Mschema-javadefault / src / main / java / io / quicktype / OrderFieldDef.java+3 −3
| @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | |
| 5 | 5 | public class OrderFieldDef { |
| 6 | 6 | private AggregateOp aggregate; |
| 7 | - private Bin bin; | |
| 7 | + private ColorBin bin; | |
| 8 | 8 | private Field field; |
| 9 | 9 | private SortEnum sort; |
| 10 | 10 | private TimeUnit timeUnit; |
| @@ -29,9 +29,9 @@ public class OrderFieldDef { | ||
| 29 | 29 | * __Default value:__ `false` |
| 30 | 30 | */ |
| 31 | 31 | @JsonProperty("bin") |
| 32 | - public Bin getBin() { return bin; } | |
| 32 | + public ColorBin getBin() { return bin; } | |
| 33 | 33 | @JsonProperty("bin") |
| 34 | - public void setBin(Bin value) { this.bin = value; } | |
| 34 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * __Required.__ A string defining the name of the field from which to pull a data value |
Mschema-javadefault / src / main / java / io / quicktype / Predicate.java+18 −18
| @@ -4,38 +4,38 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Predicate { |
| 7 | - private ConditionalValueDefLogicalOperandPredicate not; | |
| 8 | - private List<LogicalOperandPredicateElement> and; | |
| 9 | - private List<LogicalOperandPredicateElement> or; | |
| 10 | - private EqualUnion equal; | |
| 7 | + private LogicalOperandPredicate not; | |
| 8 | + private List<LogicalOperandPredicate> and; | |
| 9 | + private List<LogicalOperandPredicate> or; | |
| 10 | + private Equal equal; | |
| 11 | 11 | private String field; |
| 12 | 12 | private TimeUnit timeUnit; |
| 13 | 13 | private List<RangeElement> range; |
| 14 | - private List<OneOfElement> oneOf; | |
| 15 | - private ConditionalValueDefSelectionOperand selection; | |
| 14 | + private List<Equal> oneOf; | |
| 15 | + private SelectionOperand selection; | |
| 16 | 16 | |
| 17 | 17 | @JsonProperty("not") |
| 18 | - public ConditionalValueDefLogicalOperandPredicate getNot() { return not; } | |
| 18 | + public LogicalOperandPredicate getNot() { return not; } | |
| 19 | 19 | @JsonProperty("not") |
| 20 | - public void setNot(ConditionalValueDefLogicalOperandPredicate value) { this.not = value; } | |
| 20 | + public void setNot(LogicalOperandPredicate value) { this.not = value; } | |
| 21 | 21 | |
| 22 | 22 | @JsonProperty("and") |
| 23 | - public List<LogicalOperandPredicateElement> getAnd() { return and; } | |
| 23 | + public List<LogicalOperandPredicate> getAnd() { return and; } | |
| 24 | 24 | @JsonProperty("and") |
| 25 | - public void setAnd(List<LogicalOperandPredicateElement> value) { this.and = value; } | |
| 25 | + public void setAnd(List<LogicalOperandPredicate> value) { this.and = value; } | |
| 26 | 26 | |
| 27 | 27 | @JsonProperty("or") |
| 28 | - public List<LogicalOperandPredicateElement> getOr() { return or; } | |
| 28 | + public List<LogicalOperandPredicate> getOr() { return or; } | |
| 29 | 29 | @JsonProperty("or") |
| 30 | - public void setOr(List<LogicalOperandPredicateElement> value) { this.or = value; } | |
| 30 | + public void setOr(List<LogicalOperandPredicate> value) { this.or = value; } | |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The value that the field should be equal to. |
| 34 | 34 | */ |
| 35 | 35 | @JsonProperty("equal") |
| 36 | - public EqualUnion getEqual() { return equal; } | |
| 36 | + public Equal getEqual() { return equal; } | |
| 37 | 37 | @JsonProperty("equal") |
| 38 | - public void setEqual(EqualUnion value) { this.equal = value; } | |
| 38 | + public void setEqual(Equal value) { this.equal = value; } | |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Field to be filtered. |
| @@ -71,15 +71,15 @@ public class Predicate { | ||
| 71 | 71 | * for a data item included in the filtered data. |
| 72 | 72 | */ |
| 73 | 73 | @JsonProperty("oneOf") |
| 74 | - public List<OneOfElement> getOneOf() { return oneOf; } | |
| 74 | + public List<Equal> getOneOf() { return oneOf; } | |
| 75 | 75 | @JsonProperty("oneOf") |
| 76 | - public void setOneOf(List<OneOfElement> value) { this.oneOf = value; } | |
| 76 | + public void setOneOf(List<Equal> value) { this.oneOf = value; } | |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Filter using a selection name. |
| 80 | 80 | */ |
| 81 | 81 | @JsonProperty("selection") |
| 82 | - public ConditionalValueDefSelectionOperand getSelection() { return selection; } | |
| 82 | + public SelectionOperand getSelection() { return selection; } | |
| 83 | 83 | @JsonProperty("selection") |
| 84 | - public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; } | |
| 84 | + public void setSelection(SelectionOperand value) { this.selection = value; } | |
| 85 | 85 | } |
Mschema-javadefault / src / main / java / io / quicktype / Selection.java+9 −9
| @@ -4,22 +4,22 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Selection { |
| 7 | - private ConditionalValueDefSelectionOperand not; | |
| 8 | - private List<SelectionOperandElement> and; | |
| 9 | - private List<SelectionOperandElement> or; | |
| 7 | + private SelectionOperand not; | |
| 8 | + private List<SelectionOperand> and; | |
| 9 | + private List<SelectionOperand> or; | |
| 10 | 10 | |
| 11 | 11 | @JsonProperty("not") |
| 12 | - public ConditionalValueDefSelectionOperand getNot() { return not; } | |
| 12 | + public SelectionOperand getNot() { return not; } | |
| 13 | 13 | @JsonProperty("not") |
| 14 | - public void setNot(ConditionalValueDefSelectionOperand value) { this.not = value; } | |
| 14 | + public void setNot(SelectionOperand value) { this.not = value; } | |
| 15 | 15 | |
| 16 | 16 | @JsonProperty("and") |
| 17 | - public List<SelectionOperandElement> getAnd() { return and; } | |
| 17 | + public List<SelectionOperand> getAnd() { return and; } | |
| 18 | 18 | @JsonProperty("and") |
| 19 | - public void setAnd(List<SelectionOperandElement> value) { this.and = value; } | |
| 19 | + public void setAnd(List<SelectionOperand> value) { this.and = value; } | |
| 20 | 20 | |
| 21 | 21 | @JsonProperty("or") |
| 22 | - public List<SelectionOperandElement> getOr() { return or; } | |
| 22 | + public List<SelectionOperand> getOr() { return or; } | |
| 23 | 23 | @JsonProperty("or") |
| 24 | - public void setOr(List<SelectionOperandElement> value) { this.or = value; } | |
| 24 | + public void setOr(List<SelectionOperand> value) { this.or = value; } | |
| 25 | 25 | } |
Aschema-javadefault / src / main / java / io / quicktype / SelectionOperand.java+54 −0
| @@ -0,0 +1,54 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Filter using a selection name. | |
| 12 | + * | |
| 13 | + * A [selection name](selection.html), or a series of [composed | |
| 14 | + * selections](selection.html#compose). | |
| 15 | + */ | |
| 16 | +@JsonDeserialize(using = SelectionOperand.Deserializer.class) | |
| 17 | +@JsonSerialize(using = SelectionOperand.Serializer.class) | |
| 18 | +public class SelectionOperand { | |
| 19 | + public Selection selectionValue; | |
| 20 | + public String stringValue; | |
| 21 | + | |
| 22 | + static class Deserializer extends JsonDeserializer<SelectionOperand> { | |
| 23 | + @Override | |
| 24 | + public SelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | + SelectionOperand value = new SelectionOperand(); | |
| 26 | + switch (jsonParser.currentToken()) { | |
| 27 | + case VALUE_STRING: | |
| 28 | + String string = jsonParser.readValueAs(String.class); | |
| 29 | + value.stringValue = string; | |
| 30 | + break; | |
| 31 | + case START_OBJECT: | |
| 32 | + value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 33 | + break; | |
| 34 | + default: throw new IOException("Cannot deserialize SelectionOperand"); | |
| 35 | + } | |
| 36 | + return value; | |
| 37 | + } | |
| 38 | + } | |
| 39 | + | |
| 40 | + static class Serializer extends JsonSerializer<SelectionOperand> { | |
| 41 | + @Override | |
| 42 | + public void serialize(SelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 43 | + if (obj.selectionValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.selectionValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + if (obj.stringValue != null) { | |
| 48 | + jsonGenerator.writeObject(obj.stringValue); | |
| 49 | + return; | |
| 50 | + } | |
| 51 | + throw new IOException("SelectionOperand must not be null"); | |
| 52 | + } | |
| 53 | + } | |
| 54 | +} |
Dschema-javadefault / src / main / java / io / quicktype / SelectionOperandElement.java+0 −54
| @@ -1,54 +0,0 @@ | ||
| 1 | -package io.quicktype; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.io.IOException; | |
| 5 | -import com.fasterxml.jackson.core.*; | |
| 6 | -import com.fasterxml.jackson.databind.*; | |
| 7 | -import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | -import com.fasterxml.jackson.core.type.*; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * Filter using a selection name. | |
| 12 | - * | |
| 13 | - * A [selection name](selection.html), or a series of [composed | |
| 14 | - * selections](selection.html#compose). | |
| 15 | - */ | |
| 16 | -@JsonDeserialize(using = SelectionOperandElement.Deserializer.class) | |
| 17 | -@JsonSerialize(using = SelectionOperandElement.Serializer.class) | |
| 18 | -public class SelectionOperandElement { | |
| 19 | - public Selection selectionValue; | |
| 20 | - public String stringValue; | |
| 21 | - | |
| 22 | - static class Deserializer extends JsonDeserializer<SelectionOperandElement> { | |
| 23 | - @Override | |
| 24 | - public SelectionOperandElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 25 | - SelectionOperandElement value = new SelectionOperandElement(); | |
| 26 | - switch (jsonParser.currentToken()) { | |
| 27 | - case VALUE_STRING: | |
| 28 | - String string = jsonParser.readValueAs(String.class); | |
| 29 | - value.stringValue = string; | |
| 30 | - break; | |
| 31 | - case START_OBJECT: | |
| 32 | - value.selectionValue = jsonParser.readValueAs(Selection.class); | |
| 33 | - break; | |
| 34 | - default: throw new IOException("Cannot deserialize SelectionOperandElement"); | |
| 35 | - } | |
| 36 | - return value; | |
| 37 | - } | |
| 38 | - } | |
| 39 | - | |
| 40 | - static class Serializer extends JsonSerializer<SelectionOperandElement> { | |
| 41 | - @Override | |
| 42 | - public void serialize(SelectionOperandElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 43 | - if (obj.selectionValue != null) { | |
| 44 | - jsonGenerator.writeObject(obj.selectionValue); | |
| 45 | - return; | |
| 46 | - } | |
| 47 | - if (obj.stringValue != null) { | |
| 48 | - jsonGenerator.writeObject(obj.stringValue); | |
| 49 | - return; | |
| 50 | - } | |
| 51 | - throw new IOException("SelectionOperandElement must not be null"); | |
| 52 | - } | |
| 53 | - } | |
| 54 | -} |
Mschema-javadefault / src / main / java / io / quicktype / TextDefWithCondition.java+6 −6
| @@ -23,13 +23,13 @@ import java.util.List; | ||
| 23 | 23 | */ |
| 24 | 24 | public class TextDefWithCondition { |
| 25 | 25 | private AggregateOp aggregate; |
| 26 | - private Bin bin; | |
| 26 | + private ColorBin bin; | |
| 27 | 27 | private TextCondition condition; |
| 28 | 28 | private Field field; |
| 29 | 29 | private String format; |
| 30 | 30 | private TimeUnit timeUnit; |
| 31 | 31 | private Type type; |
| 32 | - private ConditionalPredicateValueDefValue value; | |
| 32 | + private ColorValue value; | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Aggregation function for the field |
| @@ -50,9 +50,9 @@ public class TextDefWithCondition { | ||
| 50 | 50 | * __Default value:__ `false` |
| 51 | 51 | */ |
| 52 | 52 | @JsonProperty("bin") |
| 53 | - public Bin getBin() { return bin; } | |
| 53 | + public ColorBin getBin() { return bin; } | |
| 54 | 54 | @JsonProperty("bin") |
| 55 | - public void setBin(Bin value) { this.bin = value; } | |
| 55 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * One or more value definition(s) with a selection predicate. |
| @@ -120,7 +120,7 @@ public class TextDefWithCondition { | ||
| 120 | 120 | * A constant value in visual domain. |
| 121 | 121 | */ |
| 122 | 122 | @JsonProperty("value") |
| 123 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 123 | + public ColorValue getValue() { return value; } | |
| 124 | 124 | @JsonProperty("value") |
| 125 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 125 | + public void setValue(ColorValue value) { this.value = value; } | |
| 126 | 126 | } |
Mschema-javadefault / src / main / java / io / quicktype / Transform.java+6 −6
| @@ -4,13 +4,13 @@ import com.fasterxml.jackson.annotation.*; | ||
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | 6 | public class Transform { |
| 7 | - private ConditionalValueDefLogicalOperandPredicate filter; | |
| 7 | + private LogicalOperandPredicate filter; | |
| 8 | 8 | private Style as; |
| 9 | 9 | private String calculate; |
| 10 | 10 | private String transformDefault; |
| 11 | 11 | private LookupData from; |
| 12 | 12 | private String lookup; |
| 13 | - private Bin bin; | |
| 13 | + private TransformBin bin; | |
| 14 | 14 | private String field; |
| 15 | 15 | private TimeUnit timeUnit; |
| 16 | 16 | private List<AggregatedFieldDef> aggregate; |
| @@ -27,9 +27,9 @@ public class Transform { | ||
| 27 | 27 | * or (4) a logical operand that combines (1), (2), or (3). |
| 28 | 28 | */ |
| 29 | 29 | @JsonProperty("filter") |
| 30 | - public ConditionalValueDefLogicalOperandPredicate getFilter() { return filter; } | |
| 30 | + public LogicalOperandPredicate getFilter() { return filter; } | |
| 31 | 31 | @JsonProperty("filter") |
| 32 | - public void setFilter(ConditionalValueDefLogicalOperandPredicate value) { this.filter = value; } | |
| 32 | + public void setFilter(LogicalOperandPredicate value) { this.filter = value; } | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * The field for storing the computed formula value. |
| @@ -87,9 +87,9 @@ public class Transform { | ||
| 87 | 87 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 88 | 88 | */ |
| 89 | 89 | @JsonProperty("bin") |
| 90 | - public Bin getBin() { return bin; } | |
| 90 | + public TransformBin getBin() { return bin; } | |
| 91 | 91 | @JsonProperty("bin") |
| 92 | - public void setBin(Bin value) { this.bin = value; } | |
| 92 | + public void setBin(TransformBin value) { this.bin = value; } | |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * The data field to bin. |
Aschema-javadefault / src / main / java / io / quicktype / TransformBin.java+48 −0
| @@ -0,0 +1,48 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = TransformBin.Deserializer.class) | |
| 11 | +@JsonSerialize(using = TransformBin.Serializer.class) | |
| 12 | +public class TransformBin { | |
| 13 | + public Boolean boolValue; | |
| 14 | + public BinParams binParamsValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<TransformBin> { | |
| 17 | + @Override | |
| 18 | + public TransformBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + TransformBin value = new TransformBin(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_TRUE: | |
| 22 | + case VALUE_FALSE: | |
| 23 | + value.boolValue = jsonParser.readValueAs(Boolean.class); | |
| 24 | + break; | |
| 25 | + case START_OBJECT: | |
| 26 | + value.binParamsValue = jsonParser.readValueAs(BinParams.class); | |
| 27 | + break; | |
| 28 | + default: throw new IOException("Cannot deserialize TransformBin"); | |
| 29 | + } | |
| 30 | + return value; | |
| 31 | + } | |
| 32 | + } | |
| 33 | + | |
| 34 | + static class Serializer extends JsonSerializer<TransformBin> { | |
| 35 | + @Override | |
| 36 | + public void serialize(TransformBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 37 | + if (obj.boolValue != null) { | |
| 38 | + jsonGenerator.writeObject(obj.boolValue); | |
| 39 | + return; | |
| 40 | + } | |
| 41 | + if (obj.binParamsValue != null) { | |
| 42 | + jsonGenerator.writeObject(obj.binParamsValue); | |
| 43 | + return; | |
| 44 | + } | |
| 45 | + throw new IOException("TransformBin must not be null"); | |
| 46 | + } | |
| 47 | + } | |
| 48 | +} |
Mschema-javadefault / src / main / java / io / quicktype / Values.java+1 −3
| @@ -27,8 +27,6 @@ public class Values { | ||
| 27 | 27 | public Values deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { |
| 28 | 28 | Values value = new Values(); |
| 29 | 29 | switch (jsonParser.currentToken()) { |
| 30 | - case VALUE_NULL: | |
| 31 | - break; | |
| 32 | 30 | case VALUE_STRING: |
| 33 | 31 | String string = jsonParser.readValueAs(String.class); |
| 34 | 32 | value.stringValue = string; |
| @@ -60,7 +58,7 @@ public class Values { | ||
| 60 | 58 | jsonGenerator.writeObject(obj.stringValue); |
| 61 | 59 | return; |
| 62 | 60 | } |
| 63 | - jsonGenerator.writeNull(); | |
| 61 | + throw new IOException("Values must not be null"); | |
| 64 | 62 | } |
| 65 | 63 | } |
| 66 | 64 | } |
Mschema-javadefault / src / main / java / io / quicktype / X2Class.java+6 −6
| @@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.*; | ||
| 13 | 13 | */ |
| 14 | 14 | public class X2Class { |
| 15 | 15 | private AggregateOp aggregate; |
| 16 | - private Bin bin; | |
| 16 | + private ColorBin bin; | |
| 17 | 17 | private Field field; |
| 18 | 18 | private TimeUnit timeUnit; |
| 19 | 19 | private Type type; |
| 20 | - private ConditionalPredicateValueDefValue value; | |
| 20 | + private ConditionalValueDefValue value; | |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Aggregation function for the field |
| @@ -38,9 +38,9 @@ public class X2Class { | ||
| 38 | 38 | * __Default value:__ `false` |
| 39 | 39 | */ |
| 40 | 40 | @JsonProperty("bin") |
| 41 | - public Bin getBin() { return bin; } | |
| 41 | + public ColorBin getBin() { return bin; } | |
| 42 | 42 | @JsonProperty("bin") |
| 43 | - public void setBin(Bin value) { this.bin = value; } | |
| 43 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * __Required.__ A string defining the name of the field from which to pull a data value |
| @@ -86,7 +86,7 @@ public class X2Class { | ||
| 86 | 86 | * `0` to `1` for opacity). |
| 87 | 87 | */ |
| 88 | 88 | @JsonProperty("value") |
| 89 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 89 | + public ConditionalValueDefValue getValue() { return value; } | |
| 90 | 90 | @JsonProperty("value") |
| 91 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 91 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 92 | 92 | } |
Mschema-javadefault / src / main / java / io / quicktype / XClass.java+6 −6
| @@ -12,14 +12,14 @@ import com.fasterxml.jackson.annotation.*; | ||
| 12 | 12 | public class XClass { |
| 13 | 13 | private AggregateOp aggregate; |
| 14 | 14 | private Axis axis; |
| 15 | - private Bin bin; | |
| 15 | + private ColorBin bin; | |
| 16 | 16 | private Field field; |
| 17 | 17 | private Scale scale; |
| 18 | 18 | private SortUnion sort; |
| 19 | 19 | private StackOffset stack; |
| 20 | 20 | private TimeUnit timeUnit; |
| 21 | 21 | private Type type; |
| 22 | - private ConditionalPredicateValueDefValue value; | |
| 22 | + private ConditionalValueDefValue value; | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Aggregation function for the field |
| @@ -51,9 +51,9 @@ public class XClass { | ||
| 51 | 51 | * __Default value:__ `false` |
| 52 | 52 | */ |
| 53 | 53 | @JsonProperty("bin") |
| 54 | - public Bin getBin() { return bin; } | |
| 54 | + public ColorBin getBin() { return bin; } | |
| 55 | 55 | @JsonProperty("bin") |
| 56 | - public void setBin(Bin value) { this.bin = value; } | |
| 56 | + public void setBin(ColorBin value) { this.bin = value; } | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * __Required.__ A string defining the name of the field from which to pull a data value |
| @@ -151,7 +151,7 @@ public class XClass { | ||
| 151 | 151 | * `0` to `1` for opacity). |
| 152 | 152 | */ |
| 153 | 153 | @JsonProperty("value") |
| 154 | - public ConditionalPredicateValueDefValue getValue() { return value; } | |
| 154 | + public ConditionalValueDefValue getValue() { return value; } | |
| 155 | 155 | @JsonProperty("value") |
| 156 | - public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; } | |
| 156 | + public void setValue(ConditionalValueDefValue value) { this.value = value; } | |
| 157 | 157 | } |
Mschema-javascriptdefault / TopLevel.js+65 −65
| @@ -178,9 +178,9 @@ const typeMap = { | ||
| 178 | 178 | { json: "config", js: "config", typ: u(undefined, r("Config")) }, |
| 179 | 179 | { json: "data", js: "data", typ: u(undefined, r("Data")) }, |
| 180 | 180 | { 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") }, | |
| 182 | 182 | { 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")) }, | |
| 184 | 184 | { json: "name", js: "name", typ: u(undefined, "") }, |
| 185 | 185 | { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) }, |
| 186 | 186 | { json: "projection", js: "projection", typ: u(undefined, r("Projection")) }, |
| @@ -188,13 +188,13 @@ const typeMap = { | ||
| 188 | 188 | { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) }, |
| 189 | 189 | { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) }, |
| 190 | 190 | { json: "width", js: "width", typ: u(undefined, 3.14) }, |
| 191 | - { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) }, | |
| 191 | + { json: "layer", js: "layer", typ: a(r("LayerSpec")) }, | |
| 192 | 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"))) }, | |
| 193 | + { json: "facet", js: "facet", typ: r("FacetMapping") }, | |
| 194 | + { json: "spec", js: "spec", typ: r("Spec") }, | |
| 195 | + { json: "repeat", js: "repeat", typ: r("Repeat") }, | |
| 196 | + { json: "vconcat", js: "vconcat", typ: a(r("Spec")) }, | |
| 197 | + { json: "hconcat", js: "hconcat", typ: a(r("Spec")) }, | |
| 198 | 198 | ], false), |
| 199 | 199 | "AutoSizeParams": o([ |
| 200 | 200 | { json: "contains", js: "contains", typ: u(undefined, r("Contains")) }, |
| @@ -468,8 +468,8 @@ const typeMap = { | ||
| 468 | 468 | "RangeConfigValueVGScheme": o([ |
| 469 | 469 | { json: "count", js: "count", typ: u(undefined, 3.14) }, |
| 470 | 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) }, | |
| 471 | + { json: "scheme", js: "scheme", typ: "" }, | |
| 472 | + { json: "step", js: "step", typ: 3.14 }, | |
| 473 | 473 | ], false), |
| 474 | 474 | "ScaleConfig": o([ |
| 475 | 475 | { json: "bandPaddingInner", js: "bandPaddingInner", typ: u(undefined, 3.14) }, |
| @@ -538,7 +538,7 @@ const typeMap = { | ||
| 538 | 538 | "VGBinding": o([ |
| 539 | 539 | { json: "element", js: "element", typ: u(undefined, "") }, |
| 540 | 540 | { json: "input", js: "input", typ: "" }, |
| 541 | - { json: "options", js: "options", typ: u(undefined, a("")) }, | |
| 541 | + { json: "options", js: "options", typ: a("") }, | |
| 542 | 542 | { json: "max", js: "max", typ: u(undefined, 3.14) }, |
| 543 | 543 | { json: "min", js: "min", typ: u(undefined, 3.14) }, |
| 544 | 544 | { json: "step", js: "step", typ: u(undefined, 3.14) }, |
| @@ -666,9 +666,9 @@ const typeMap = { | ||
| 666 | 666 | ], false), |
| 667 | 667 | "Data": o([ |
| 668 | 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, "") }, | |
| 669 | + { json: "url", js: "url", typ: "" }, | |
| 670 | + { json: "values", js: "values", typ: u(a(u(true, 3.14, m("any"), "")), m("any"), "") }, | |
| 671 | + { json: "name", js: "name", typ: "" }, | |
| 672 | 672 | ], false), |
| 673 | 673 | "DataFormat": o([ |
| 674 | 674 | { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) }, |
| @@ -703,7 +703,7 @@ const typeMap = { | ||
| 703 | 703 | { json: "scale", js: "scale", typ: u(undefined, r("Scale")) }, |
| 704 | 704 | { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) }, |
| 705 | 705 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 706 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 706 | + { json: "type", js: "type", typ: r("Type") }, | |
| 707 | 707 | { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, |
| 708 | 708 | ], false), |
| 709 | 709 | "BinParams": o([ |
| @@ -717,25 +717,25 @@ const typeMap = { | ||
| 717 | 717 | { json: "steps", js: "steps", typ: u(undefined, a(3.14)) }, |
| 718 | 718 | ], false), |
| 719 | 719 | "ConditionalValueDef": o([ |
| 720 | - { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 720 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 721 | 721 | { json: "value", js: "value", typ: u(true, 3.14, "") }, |
| 722 | - { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) }, | |
| 722 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 723 | 723 | ], false), |
| 724 | 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"), ""))) }, | |
| 725 | + { json: "not", js: "not", typ: u(r("Selection"), "") }, | |
| 726 | + { json: "and", js: "and", typ: a(u(r("Selection"), "")) }, | |
| 727 | + { json: "or", js: "or", typ: a(u(r("Selection"), "")) }, | |
| 728 | 728 | ], false), |
| 729 | 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, "") }, | |
| 730 | + { json: "not", js: "not", typ: u(r("Predicate"), "") }, | |
| 731 | + { json: "and", js: "and", typ: a(u(r("Predicate"), "")) }, | |
| 732 | + { json: "or", js: "or", typ: a(u(r("Predicate"), "")) }, | |
| 733 | + { json: "equal", js: "equal", typ: u(true, r("DateTime"), 3.14, "") }, | |
| 734 | + { json: "field", js: "field", typ: "" }, | |
| 735 | 735 | { 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"), "")) }, | |
| 736 | + { json: "range", js: "range", typ: a(u(r("DateTime"), 3.14, null)) }, | |
| 737 | + { json: "oneOf", js: "oneOf", typ: a(u(true, r("DateTime"), 3.14, "")) }, | |
| 738 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 739 | 739 | ], false), |
| 740 | 740 | "DateTime": o([ |
| 741 | 741 | { json: "date", js: "date", typ: u(undefined, 3.14) }, |
| @@ -750,9 +750,9 @@ const typeMap = { | ||
| 750 | 750 | { json: "year", js: "year", typ: u(undefined, 3.14) }, |
| 751 | 751 | ], false), |
| 752 | 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"), "")) }, | |
| 753 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 754 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 755 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 756 | 756 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| 757 | 757 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 758 | 758 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| @@ -760,7 +760,7 @@ const typeMap = { | ||
| 760 | 760 | { json: "scale", js: "scale", typ: u(undefined, r("Scale")) }, |
| 761 | 761 | { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) }, |
| 762 | 762 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 763 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 763 | + { json: "type", js: "type", typ: r("Type") }, | |
| 764 | 764 | ], false), |
| 765 | 765 | "RepeatRef": o([ |
| 766 | 766 | { json: "repeat", js: "repeat", typ: r("RepeatEnum") }, |
| @@ -843,18 +843,18 @@ const typeMap = { | ||
| 843 | 843 | { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateFieldDefClass"))) }, |
| 844 | 844 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 845 | 845 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 846 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 846 | + { json: "type", js: "type", typ: r("Type") }, | |
| 847 | 847 | { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, |
| 848 | 848 | ], false), |
| 849 | 849 | "ConditionalPredicateFieldDefClass": o([ |
| 850 | - { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 851 | - { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, | |
| 852 | - { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) }, | |
| 850 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 851 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 852 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 853 | 853 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| 854 | 854 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 855 | 855 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 856 | 856 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 857 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 857 | + { json: "type", js: "type", typ: r("Type") }, | |
| 858 | 858 | ], false), |
| 859 | 859 | "OrderFieldDef": o([ |
| 860 | 860 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| @@ -871,19 +871,19 @@ const typeMap = { | ||
| 871 | 871 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 872 | 872 | { json: "format", js: "format", typ: u(undefined, "") }, |
| 873 | 873 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 874 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 874 | + { json: "type", js: "type", typ: r("Type") }, | |
| 875 | 875 | { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, |
| 876 | 876 | ], false), |
| 877 | 877 | "ConditionalPredicateTextFieldDefClass": o([ |
| 878 | - { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 879 | - { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) }, | |
| 880 | - { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) }, | |
| 878 | + { json: "test", js: "test", typ: u(r("Predicate"), "") }, | |
| 879 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 880 | + { json: "selection", js: "selection", typ: u(r("Selection"), "") }, | |
| 881 | 881 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| 882 | 882 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 883 | 883 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 884 | 884 | { json: "format", js: "format", typ: u(undefined, "") }, |
| 885 | 885 | { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) }, |
| 886 | - { json: "type", js: "type", typ: u(undefined, r("Type")) }, | |
| 886 | + { json: "type", js: "type", typ: r("Type") }, | |
| 887 | 887 | ], false), |
| 888 | 888 | "XClass": o([ |
| 889 | 889 | { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) }, |
| @@ -894,8 +894,8 @@ const typeMap = { | ||
| 894 | 894 | { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) }, |
| 895 | 895 | { json: "stack", js: "stack", typ: u(undefined, u(r("StackOffset"), null)) }, |
| 896 | 896 | { 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, "")) }, | |
| 897 | + { json: "type", js: "type", typ: r("Type") }, | |
| 898 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 899 | 899 | ], false), |
| 900 | 900 | "Axis": o([ |
| 901 | 901 | { json: "domain", js: "domain", typ: u(undefined, true) }, |
| @@ -926,8 +926,8 @@ const typeMap = { | ||
| 926 | 926 | { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) }, |
| 927 | 927 | { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) }, |
| 928 | 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, "")) }, | |
| 929 | + { json: "type", js: "type", typ: r("Type") }, | |
| 930 | + { json: "value", js: "value", typ: u(true, 3.14, "") }, | |
| 931 | 931 | ], false), |
| 932 | 932 | "FacetMapping": o([ |
| 933 | 933 | { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) }, |
| @@ -937,21 +937,21 @@ const typeMap = { | ||
| 937 | 937 | { json: "data", js: "data", typ: u(undefined, r("Data")) }, |
| 938 | 938 | { json: "description", js: "description", typ: u(undefined, "") }, |
| 939 | 939 | { json: "height", js: "height", typ: u(undefined, 3.14) }, |
| 940 | - { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) }, | |
| 940 | + { json: "layer", js: "layer", typ: a(r("LayerSpec")) }, | |
| 941 | 941 | { json: "name", js: "name", typ: u(undefined, "") }, |
| 942 | 942 | { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) }, |
| 943 | 943 | { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) }, |
| 944 | 944 | { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) }, |
| 945 | 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"))) }, | |
| 946 | + { json: "encoding", js: "encoding", typ: r("Encoding") }, | |
| 947 | + { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) }, | |
| 948 | 948 | { json: "projection", js: "projection", typ: u(undefined, r("Projection")) }, |
| 949 | 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"))) }, | |
| 950 | + { json: "facet", js: "facet", typ: r("FacetMapping") }, | |
| 951 | + { json: "spec", js: "spec", typ: r("Spec") }, | |
| 952 | + { json: "repeat", js: "repeat", typ: r("Repeat") }, | |
| 953 | + { json: "vconcat", js: "vconcat", typ: a(r("Spec")) }, | |
| 954 | + { json: "hconcat", js: "hconcat", typ: a(r("Spec")) }, | |
| 955 | 955 | ], false), |
| 956 | 956 | "Encoding": o([ |
| 957 | 957 | { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) }, |
| @@ -972,14 +972,14 @@ const typeMap = { | ||
| 972 | 972 | { json: "data", js: "data", typ: u(undefined, r("Data")) }, |
| 973 | 973 | { json: "description", js: "description", typ: u(undefined, "") }, |
| 974 | 974 | { json: "height", js: "height", typ: u(undefined, 3.14) }, |
| 975 | - { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) }, | |
| 975 | + { json: "layer", js: "layer", typ: a(r("LayerSpec")) }, | |
| 976 | 976 | { json: "name", js: "name", typ: u(undefined, "") }, |
| 977 | 977 | { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) }, |
| 978 | 978 | { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) }, |
| 979 | 979 | { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) }, |
| 980 | 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"))) }, | |
| 981 | + { json: "encoding", js: "encoding", typ: r("Encoding") }, | |
| 982 | + { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) }, | |
| 983 | 983 | { json: "projection", js: "projection", typ: u(undefined, r("Projection")) }, |
| 984 | 984 | { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) }, |
| 985 | 985 | ], false), |
| @@ -1083,16 +1083,16 @@ const typeMap = { | ||
| 1083 | 1083 | { json: "text", js: "text", typ: "" }, |
| 1084 | 1084 | ], false), |
| 1085 | 1085 | "Transform": o([ |
| 1086 | - { json: "filter", js: "filter", typ: u(undefined, u(r("Predicate"), "")) }, | |
| 1086 | + { json: "filter", js: "filter", typ: u(r("Predicate"), "") }, | |
| 1087 | 1087 | { json: "as", js: "as", typ: u(undefined, u(a(""), "")) }, |
| 1088 | - { json: "calculate", js: "calculate", typ: u(undefined, "") }, | |
| 1088 | + { json: "calculate", js: "calculate", typ: "" }, | |
| 1089 | 1089 | { 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"))) }, | |
| 1090 | + { json: "from", js: "from", typ: r("LookupData") }, | |
| 1091 | + { json: "lookup", js: "lookup", typ: "" }, | |
| 1092 | + { json: "bin", js: "bin", typ: u(true, r("BinParams")) }, | |
| 1093 | + { json: "field", js: "field", typ: "" }, | |
| 1094 | + { json: "timeUnit", js: "timeUnit", typ: r("TimeUnit") }, | |
| 1095 | + { json: "aggregate", js: "aggregate", typ: a(r("AggregatedFieldDef")) }, | |
| 1096 | 1096 | { json: "groupby", js: "groupby", typ: u(undefined, a("")) }, |
| 1097 | 1097 | ], false), |
| 1098 | 1098 | "AggregatedFieldDef": o([ |
Mschema-kotlin-jacksondefault / TopLevel.kt+135 −64
| @@ -149,7 +149,8 @@ data class TopLevel ( | ||
| 149 | 149 | /** |
| 150 | 150 | * A key-value mapping between encoding channels and definition of fields. |
| 151 | 151 | */ |
| 152 | - val encoding: EncodingWithFacet? = null, | |
| 152 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 153 | + val encoding: EncodingWithFacet, | |
| 153 | 154 | |
| 154 | 155 | /** |
| 155 | 156 | * The height of a visualization. |
| @@ -178,7 +179,8 @@ data class TopLevel ( | ||
| 178 | 179 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 179 | 180 | * object](mark.html#mark-def). |
| 180 | 181 | */ |
| 181 | - val mark: AnyMark? = null, | |
| 182 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 183 | + val mark: AnyMark, | |
| 182 | 184 | |
| 183 | 185 | /** |
| 184 | 186 | * Name of the visualization for later reference. |
| @@ -248,7 +250,8 @@ data class TopLevel ( | ||
| 248 | 250 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 249 | 251 | * layering facet specifications is not allowed. |
| 250 | 252 | */ |
| 251 | - val layer: List<LayerSpec>? = null, | |
| 253 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 254 | + val layer: List<LayerSpec>, | |
| 252 | 255 | |
| 253 | 256 | /** |
| 254 | 257 | * Scale, axis, and legend resolutions for layers. |
| @@ -267,28 +270,33 @@ data class TopLevel ( | ||
| 267 | 270 | * An object that describes mappings between `row` and `column` channels and their field |
| 268 | 271 | * definitions. |
| 269 | 272 | */ |
| 270 | - val facet: FacetMapping? = null, | |
| 273 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 274 | + val facet: FacetMapping, | |
| 271 | 275 | |
| 272 | 276 | /** |
| 273 | 277 | * A specification of the view that gets faceted. |
| 274 | 278 | */ |
| 275 | - val spec: Spec? = null, | |
| 279 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 280 | + val spec: Spec, | |
| 276 | 281 | |
| 277 | 282 | /** |
| 278 | 283 | * An object that describes what fields should be repeated into views that are laid out as a |
| 279 | 284 | * `row` or `column`. |
| 280 | 285 | */ |
| 281 | - val repeat: Repeat? = null, | |
| 286 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 287 | + val repeat: Repeat, | |
| 282 | 288 | |
| 283 | 289 | /** |
| 284 | 290 | * A list of views that should be concatenated and put into a column. |
| 285 | 291 | */ |
| 286 | - val vconcat: List<Spec>? = null, | |
| 292 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 293 | + val vconcat: List<Spec>, | |
| 287 | 294 | |
| 288 | 295 | /** |
| 289 | 296 | * A list of views that should be concatenated and put into a row. |
| 290 | 297 | */ |
| 291 | - val hconcat: List<Spec>? = null | |
| 298 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 299 | + val hconcat: List<Spec> | |
| 292 | 300 | ) { |
| 293 | 301 | fun toJson() = mapper.writeValueAsString(this) |
| 294 | 302 | |
| @@ -2400,7 +2408,10 @@ sealed class RangeConfigValue { | ||
| 2400 | 2408 | data class VGScheme ( |
| 2401 | 2409 | val count: Double? = null, |
| 2402 | 2410 | val extent: List<Double>? = null, |
| 2403 | - val scheme: String? = null, | |
| 2411 | + | |
| 2412 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2413 | + val scheme: String, | |
| 2414 | + | |
| 2404 | 2415 | val step: Double? = null |
| 2405 | 2416 | ) |
| 2406 | 2417 | |
| @@ -2980,7 +2991,9 @@ data class VGBinding ( | ||
| 2980 | 2991 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2981 | 2992 | val input: String, |
| 2982 | 2993 | |
| 2983 | - val options: List<String>? = null, | |
| 2994 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2995 | + val options: List<String>, | |
| 2996 | + | |
| 2984 | 2997 | val max: Double? = null, |
| 2985 | 2998 | val min: Double? = null, |
| 2986 | 2999 | val step: Double? = null |
| @@ -3875,7 +3888,8 @@ data class Data ( | ||
| 3875 | 3888 | * An URL from which to load the data set. Use the `format.type` property |
| 3876 | 3889 | * to ensure the loaded data is correctly parsed. |
| 3877 | 3890 | */ |
| 3878 | - val url: String? = null, | |
| 3891 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 3892 | + val url: String, | |
| 3879 | 3893 | |
| 3880 | 3894 | /** |
| 3881 | 3895 | * The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3883,12 +3897,14 @@ data class Data ( | ||
| 3883 | 3897 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3884 | 3898 | * parsed according to the specified format type. |
| 3885 | 3899 | */ |
| 3886 | - val values: Values? = null, | |
| 3900 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 3901 | + val values: Values, | |
| 3887 | 3902 | |
| 3888 | 3903 | /** |
| 3889 | 3904 | * Provide a placeholder name and bind data at runtime. |
| 3890 | 3905 | */ |
| 3891 | - val name: String? = null | |
| 3906 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 3907 | + val name: String | |
| 3892 | 3908 | ) |
| 3893 | 3909 | |
| 3894 | 3910 | /** |
| @@ -4289,7 +4305,8 @@ data class MarkPropDefWithCondition ( | ||
| 4289 | 4305 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4290 | 4306 | * [geographic projection](projection.html) is applied. |
| 4291 | 4307 | */ |
| 4292 | - val type: Type? = null, | |
| 4308 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4309 | + val type: Type, | |
| 4293 | 4310 | |
| 4294 | 4311 | /** |
| 4295 | 4312 | * A constant value in visual domain. |
| @@ -4463,7 +4480,8 @@ sealed class ColorCondition { | ||
| 4463 | 4480 | } |
| 4464 | 4481 | |
| 4465 | 4482 | data class ConditionalValueDef ( |
| 4466 | - val test: LogicalOperandPredicate? = null, | |
| 4483 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4484 | + val test: LogicalOperandPredicate, | |
| 4467 | 4485 | |
| 4468 | 4486 | /** |
| 4469 | 4487 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4476,13 +4494,19 @@ data class ConditionalValueDef ( | ||
| 4476 | 4494 | * A [selection name](selection.html), or a series of [composed |
| 4477 | 4495 | * selections](selection.html#compose). |
| 4478 | 4496 | */ |
| 4479 | - val selection: SelectionOperand? = null | |
| 4497 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4498 | + val selection: SelectionOperand | |
| 4480 | 4499 | ) |
| 4481 | 4500 | |
| 4482 | 4501 | data class Selection ( |
| 4483 | - val not: SelectionOperand? = null, | |
| 4484 | - val and: List<SelectionOperand>? = null, | |
| 4485 | - val or: List<SelectionOperand>? = null | |
| 4502 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4503 | + val not: SelectionOperand, | |
| 4504 | + | |
| 4505 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4506 | + val and: List<SelectionOperand>, | |
| 4507 | + | |
| 4508 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4509 | + val or: List<SelectionOperand> | |
| 4486 | 4510 | ) |
| 4487 | 4511 | |
| 4488 | 4512 | /** |
| @@ -4510,21 +4534,28 @@ sealed class SelectionOperand { | ||
| 4510 | 4534 | } |
| 4511 | 4535 | |
| 4512 | 4536 | data class Predicate ( |
| 4513 | - val not: LogicalOperandPredicate? = null, | |
| 4514 | - val and: List<LogicalOperandPredicate>? = null, | |
| 4515 | - val or: List<LogicalOperandPredicate>? = null, | |
| 4537 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4538 | + val not: LogicalOperandPredicate, | |
| 4539 | + | |
| 4540 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4541 | + val and: List<LogicalOperandPredicate>, | |
| 4542 | + | |
| 4543 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4544 | + val or: List<LogicalOperandPredicate>, | |
| 4516 | 4545 | |
| 4517 | 4546 | /** |
| 4518 | 4547 | * The value that the field should be equal to. |
| 4519 | 4548 | */ |
| 4520 | - val equal: Equal? = null, | |
| 4549 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4550 | + val equal: Equal, | |
| 4521 | 4551 | |
| 4522 | 4552 | /** |
| 4523 | 4553 | * Field to be filtered. |
| 4524 | 4554 | * |
| 4525 | 4555 | * Field to be filtered |
| 4526 | 4556 | */ |
| 4527 | - val field: String? = null, | |
| 4557 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4558 | + val field: String, | |
| 4528 | 4559 | |
| 4529 | 4560 | /** |
| 4530 | 4561 | * Time unit for the field to be filtered. |
| @@ -4537,18 +4568,21 @@ data class Predicate ( | ||
| 4537 | 4568 | * An array of inclusive minimum and maximum values |
| 4538 | 4569 | * for a field value of a data item to be included in the filtered data. |
| 4539 | 4570 | */ |
| 4540 | - val range: List<RangeElement>? = null, | |
| 4571 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4572 | + val range: List<RangeElement>, | |
| 4541 | 4573 | |
| 4542 | 4574 | /** |
| 4543 | 4575 | * A set of values that the `field`'s value should be a member of, |
| 4544 | 4576 | * for a data item included in the filtered data. |
| 4545 | 4577 | */ |
| 4546 | - val oneOf: List<Equal>? = null, | |
| 4578 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4579 | + val oneOf: List<Equal>, | |
| 4547 | 4580 | |
| 4548 | 4581 | /** |
| 4549 | 4582 | * Filter using a selection name. |
| 4550 | 4583 | */ |
| 4551 | - val selection: SelectionOperand? = null | |
| 4584 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4585 | + val selection: SelectionOperand | |
| 4552 | 4586 | ) |
| 4553 | 4587 | |
| 4554 | 4588 | /** |
| @@ -4877,19 +4911,22 @@ sealed class ConditionalValueDefValue { | ||
| 4877 | 4911 | } |
| 4878 | 4912 | |
| 4879 | 4913 | data class ConditionalPredicateMarkPropFieldDefClass ( |
| 4880 | - val test: LogicalOperandPredicate? = null, | |
| 4914 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4915 | + val test: LogicalOperandPredicate, | |
| 4881 | 4916 | |
| 4882 | 4917 | /** |
| 4883 | 4918 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4884 | 4919 | * `0` to `1` for opacity). |
| 4885 | 4920 | */ |
| 4886 | - val value: ConditionalValueDefValue? = null, | |
| 4921 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4922 | + val value: ConditionalValueDefValue, | |
| 4887 | 4923 | |
| 4888 | 4924 | /** |
| 4889 | 4925 | * A [selection name](selection.html), or a series of [composed |
| 4890 | 4926 | * selections](selection.html#compose). |
| 4891 | 4927 | */ |
| 4892 | - val selection: SelectionOperand? = null, | |
| 4928 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 4929 | + val selection: SelectionOperand, | |
| 4893 | 4930 | |
| 4894 | 4931 | /** |
| 4895 | 4932 | * Aggregation function for the field |
| @@ -4963,7 +5000,8 @@ data class ConditionalPredicateMarkPropFieldDefClass ( | ||
| 4963 | 5000 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4964 | 5001 | * [geographic projection](projection.html) is applied. |
| 4965 | 5002 | */ |
| 4966 | - val type: Type? = null | |
| 5003 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 5004 | + val type: Type | |
| 4967 | 5005 | ) |
| 4968 | 5006 | |
| 4969 | 5007 | sealed class Field { |
| @@ -6045,7 +6083,8 @@ data class DefWithCondition ( | ||
| 6045 | 6083 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6046 | 6084 | * [geographic projection](projection.html) is applied. |
| 6047 | 6085 | */ |
| 6048 | - val type: Type? = null, | |
| 6086 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6087 | + val type: Type, | |
| 6049 | 6088 | |
| 6050 | 6089 | /** |
| 6051 | 6090 | * A constant value in visual domain. |
| @@ -6072,19 +6111,22 @@ sealed class HrefCondition { | ||
| 6072 | 6111 | } |
| 6073 | 6112 | |
| 6074 | 6113 | data class ConditionalPredicateFieldDefClass ( |
| 6075 | - val test: LogicalOperandPredicate? = null, | |
| 6114 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6115 | + val test: LogicalOperandPredicate, | |
| 6076 | 6116 | |
| 6077 | 6117 | /** |
| 6078 | 6118 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6079 | 6119 | * `0` to `1` for opacity). |
| 6080 | 6120 | */ |
| 6081 | - val value: ConditionalValueDefValue? = null, | |
| 6121 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6122 | + val value: ConditionalValueDefValue, | |
| 6082 | 6123 | |
| 6083 | 6124 | /** |
| 6084 | 6125 | * A [selection name](selection.html), or a series of [composed |
| 6085 | 6126 | * selections](selection.html#compose). |
| 6086 | 6127 | */ |
| 6087 | - val selection: SelectionOperand? = null, | |
| 6128 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6129 | + val selection: SelectionOperand, | |
| 6088 | 6130 | |
| 6089 | 6131 | /** |
| 6090 | 6132 | * Aggregation function for the field |
| @@ -6131,7 +6173,8 @@ data class ConditionalPredicateFieldDefClass ( | ||
| 6131 | 6173 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6132 | 6174 | * [geographic projection](projection.html) is applied. |
| 6133 | 6175 | */ |
| 6134 | - val type: Type? = null | |
| 6176 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6177 | + val type: Type | |
| 6135 | 6178 | ) |
| 6136 | 6179 | |
| 6137 | 6180 | sealed class Order { |
| @@ -6288,7 +6331,8 @@ data class TextDefWithCondition ( | ||
| 6288 | 6331 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6289 | 6332 | * [geographic projection](projection.html) is applied. |
| 6290 | 6333 | */ |
| 6291 | - val type: Type? = null, | |
| 6334 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6335 | + val type: Type, | |
| 6292 | 6336 | |
| 6293 | 6337 | /** |
| 6294 | 6338 | * A constant value in visual domain. |
| @@ -6315,19 +6359,22 @@ sealed class TextCondition { | ||
| 6315 | 6359 | } |
| 6316 | 6360 | |
| 6317 | 6361 | data class ConditionalPredicateTextFieldDefClass ( |
| 6318 | - val test: LogicalOperandPredicate? = null, | |
| 6362 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6363 | + val test: LogicalOperandPredicate, | |
| 6319 | 6364 | |
| 6320 | 6365 | /** |
| 6321 | 6366 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6322 | 6367 | * `0` to `1` for opacity). |
| 6323 | 6368 | */ |
| 6324 | - val value: ConditionalValueDefValue? = null, | |
| 6369 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6370 | + val value: ConditionalValueDefValue, | |
| 6325 | 6371 | |
| 6326 | 6372 | /** |
| 6327 | 6373 | * A [selection name](selection.html), or a series of [composed |
| 6328 | 6374 | * selections](selection.html#compose). |
| 6329 | 6375 | */ |
| 6330 | - val selection: SelectionOperand? = null, | |
| 6376 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6377 | + val selection: SelectionOperand, | |
| 6331 | 6378 | |
| 6332 | 6379 | /** |
| 6333 | 6380 | * Aggregation function for the field |
| @@ -6380,7 +6427,8 @@ data class ConditionalPredicateTextFieldDefClass ( | ||
| 6380 | 6427 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6381 | 6428 | * [geographic projection](projection.html) is applied. |
| 6382 | 6429 | */ |
| 6383 | - val type: Type? = null | |
| 6430 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6431 | + val type: Type | |
| 6384 | 6432 | ) |
| 6385 | 6433 | |
| 6386 | 6434 | /** |
| @@ -6487,13 +6535,15 @@ data class XClass ( | ||
| 6487 | 6535 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6488 | 6536 | * [geographic projection](projection.html) is applied. |
| 6489 | 6537 | */ |
| 6490 | - val type: Type? = null, | |
| 6538 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6539 | + val type: Type, | |
| 6491 | 6540 | |
| 6492 | 6541 | /** |
| 6493 | 6542 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6494 | 6543 | * `0` to `1` for opacity). |
| 6495 | 6544 | */ |
| 6496 | - val value: ConditionalValueDefValue? = null | |
| 6545 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6546 | + val value: ConditionalValueDefValue | |
| 6497 | 6547 | ) |
| 6498 | 6548 | |
| 6499 | 6549 | data class Axis ( |
| @@ -6757,13 +6807,15 @@ data class X2Class ( | ||
| 6757 | 6807 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6758 | 6808 | * [geographic projection](projection.html) is applied. |
| 6759 | 6809 | */ |
| 6760 | - val type: Type? = null, | |
| 6810 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6811 | + val type: Type, | |
| 6761 | 6812 | |
| 6762 | 6813 | /** |
| 6763 | 6814 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6764 | 6815 | * `0` to `1` for opacity). |
| 6765 | 6816 | */ |
| 6766 | - val value: ConditionalValueDefValue? = null | |
| 6817 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6818 | + val value: ConditionalValueDefValue | |
| 6767 | 6819 | ) |
| 6768 | 6820 | |
| 6769 | 6821 | /** |
| @@ -6823,7 +6875,8 @@ data class Spec ( | ||
| 6823 | 6875 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6824 | 6876 | * layering facet specifications is not allowed. |
| 6825 | 6877 | */ |
| 6826 | - val layer: List<LayerSpec>? = null, | |
| 6878 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6879 | + val layer: List<LayerSpec>, | |
| 6827 | 6880 | |
| 6828 | 6881 | /** |
| 6829 | 6882 | * Name of the visualization for later reference. |
| @@ -6880,7 +6933,8 @@ data class Spec ( | ||
| 6880 | 6933 | /** |
| 6881 | 6934 | * A key-value mapping between encoding channels and definition of fields. |
| 6882 | 6935 | */ |
| 6883 | - val encoding: Encoding? = null, | |
| 6936 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6937 | + val encoding: Encoding, | |
| 6884 | 6938 | |
| 6885 | 6939 | /** |
| 6886 | 6940 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6888,7 +6942,8 @@ data class Spec ( | ||
| 6888 | 6942 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6889 | 6943 | * object](mark.html#mark-def). |
| 6890 | 6944 | */ |
| 6891 | - val mark: AnyMark? = null, | |
| 6945 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6946 | + val mark: AnyMark, | |
| 6892 | 6947 | |
| 6893 | 6948 | /** |
| 6894 | 6949 | * An object defining properties of geographic projection. |
| @@ -6907,28 +6962,33 @@ data class Spec ( | ||
| 6907 | 6962 | * An object that describes mappings between `row` and `column` channels and their field |
| 6908 | 6963 | * definitions. |
| 6909 | 6964 | */ |
| 6910 | - val facet: FacetMapping? = null, | |
| 6965 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6966 | + val facet: FacetMapping, | |
| 6911 | 6967 | |
| 6912 | 6968 | /** |
| 6913 | 6969 | * A specification of the view that gets faceted. |
| 6914 | 6970 | */ |
| 6915 | - val spec: Spec? = null, | |
| 6971 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6972 | + val spec: Spec, | |
| 6916 | 6973 | |
| 6917 | 6974 | /** |
| 6918 | 6975 | * An object that describes what fields should be repeated into views that are laid out as a |
| 6919 | 6976 | * `row` or `column`. |
| 6920 | 6977 | */ |
| 6921 | - val repeat: Repeat? = null, | |
| 6978 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6979 | + val repeat: Repeat, | |
| 6922 | 6980 | |
| 6923 | 6981 | /** |
| 6924 | 6982 | * A list of views that should be concatenated and put into a column. |
| 6925 | 6983 | */ |
| 6926 | - val vconcat: List<Spec>? = null, | |
| 6984 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6985 | + val vconcat: List<Spec>, | |
| 6927 | 6986 | |
| 6928 | 6987 | /** |
| 6929 | 6988 | * A list of views that should be concatenated and put into a row. |
| 6930 | 6989 | */ |
| 6931 | - val hconcat: List<Spec>? = null | |
| 6990 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 6991 | + val hconcat: List<Spec> | |
| 6932 | 6992 | ) |
| 6933 | 6993 | |
| 6934 | 6994 | /** |
| @@ -7068,7 +7128,8 @@ data class LayerSpec ( | ||
| 7068 | 7128 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 7069 | 7129 | * layering facet specifications is not allowed. |
| 7070 | 7130 | */ |
| 7071 | - val layer: List<LayerSpec>? = null, | |
| 7131 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7132 | + val layer: List<LayerSpec>, | |
| 7072 | 7133 | |
| 7073 | 7134 | /** |
| 7074 | 7135 | * Name of the visualization for later reference. |
| @@ -7117,7 +7178,8 @@ data class LayerSpec ( | ||
| 7117 | 7178 | /** |
| 7118 | 7179 | * A key-value mapping between encoding channels and definition of fields. |
| 7119 | 7180 | */ |
| 7120 | - val encoding: Encoding? = null, | |
| 7181 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7182 | + val encoding: Encoding, | |
| 7121 | 7183 | |
| 7122 | 7184 | /** |
| 7123 | 7185 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -7125,7 +7187,8 @@ data class LayerSpec ( | ||
| 7125 | 7187 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 7126 | 7188 | * object](mark.html#mark-def). |
| 7127 | 7189 | */ |
| 7128 | - val mark: AnyMark? = null, | |
| 7190 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7191 | + val mark: AnyMark, | |
| 7129 | 7192 | |
| 7130 | 7193 | /** |
| 7131 | 7194 | * An object defining properties of geographic projection. |
| @@ -7813,7 +7876,8 @@ data class Transform ( | ||
| 7813 | 7876 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 7814 | 7877 | * or (4) a logical operand that combines (1), (2), or (3). |
| 7815 | 7878 | */ |
| 7816 | - val filter: LogicalOperandPredicate? = null, | |
| 7879 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7880 | + val filter: LogicalOperandPredicate, | |
| 7817 | 7881 | |
| 7818 | 7882 | /** |
| 7819 | 7883 | * The field for storing the computed formula value. |
| @@ -7834,7 +7898,8 @@ data class Transform ( | ||
| 7834 | 7898 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 7835 | 7899 | * current data object. |
| 7836 | 7900 | */ |
| 7837 | - val calculate: String? = null, | |
| 7901 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7902 | + val calculate: String, | |
| 7838 | 7903 | |
| 7839 | 7904 | /** |
| 7840 | 7905 | * The default value to use if lookup fails. |
| @@ -7846,34 +7911,40 @@ data class Transform ( | ||
| 7846 | 7911 | /** |
| 7847 | 7912 | * Secondary data reference. |
| 7848 | 7913 | */ |
| 7849 | - val from: LookupData? = null, | |
| 7914 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7915 | + val from: LookupData, | |
| 7850 | 7916 | |
| 7851 | 7917 | /** |
| 7852 | 7918 | * Key in primary data source. |
| 7853 | 7919 | */ |
| 7854 | - val lookup: String? = null, | |
| 7920 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7921 | + val lookup: String, | |
| 7855 | 7922 | |
| 7856 | 7923 | /** |
| 7857 | 7924 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 7858 | 7925 | */ |
| 7859 | - val bin: Bin? = null, | |
| 7926 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7927 | + val bin: Bin, | |
| 7860 | 7928 | |
| 7861 | 7929 | /** |
| 7862 | 7930 | * The data field to bin. |
| 7863 | 7931 | * |
| 7864 | 7932 | * The data field to apply time unit. |
| 7865 | 7933 | */ |
| 7866 | - val field: String? = null, | |
| 7934 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7935 | + val field: String, | |
| 7867 | 7936 | |
| 7868 | 7937 | /** |
| 7869 | 7938 | * The timeUnit. |
| 7870 | 7939 | */ |
| 7871 | - val timeUnit: TimeUnit? = null, | |
| 7940 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7941 | + val timeUnit: TimeUnit, | |
| 7872 | 7942 | |
| 7873 | 7943 | /** |
| 7874 | 7944 | * Array of objects that define fields to aggregate. |
| 7875 | 7945 | */ |
| 7876 | - val aggregate: List<AggregatedFieldDef>? = null, | |
| 7946 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 7947 | + val aggregate: List<AggregatedFieldDef>, | |
| 7877 | 7948 | |
| 7878 | 7949 | /** |
| 7879 | 7950 | * The data fields to group by. If not specified, a single group containing all data objects |
Mschema-kotlindefault / TopLevel.kt+64 −64
| @@ -136,7 +136,7 @@ data class TopLevel ( | ||
| 136 | 136 | /** |
| 137 | 137 | * A key-value mapping between encoding channels and definition of fields. |
| 138 | 138 | */ |
| 139 | - val encoding: EncodingWithFacet? = null, | |
| 139 | + val encoding: EncodingWithFacet, | |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * The height of a visualization. |
| @@ -165,7 +165,7 @@ data class TopLevel ( | ||
| 165 | 165 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 166 | 166 | * object](mark.html#mark-def). |
| 167 | 167 | */ |
| 168 | - val mark: AnyMark? = null, | |
| 168 | + val mark: AnyMark, | |
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | 171 | * Name of the visualization for later reference. |
| @@ -235,7 +235,7 @@ data class TopLevel ( | ||
| 235 | 235 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 236 | 236 | * layering facet specifications is not allowed. |
| 237 | 237 | */ |
| 238 | - val layer: List<LayerSpec>? = null, | |
| 238 | + val layer: List<LayerSpec>, | |
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | 241 | * Scale, axis, and legend resolutions for layers. |
| @@ -254,28 +254,28 @@ data class TopLevel ( | ||
| 254 | 254 | * An object that describes mappings between `row` and `column` channels and their field |
| 255 | 255 | * definitions. |
| 256 | 256 | */ |
| 257 | - val facet: FacetMapping? = null, | |
| 257 | + val facet: FacetMapping, | |
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * A specification of the view that gets faceted. |
| 261 | 261 | */ |
| 262 | - val spec: Spec? = null, | |
| 262 | + val spec: Spec, | |
| 263 | 263 | |
| 264 | 264 | /** |
| 265 | 265 | * An object that describes what fields should be repeated into views that are laid out as a |
| 266 | 266 | * `row` or `column`. |
| 267 | 267 | */ |
| 268 | - val repeat: Repeat? = null, | |
| 268 | + val repeat: Repeat, | |
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * A list of views that should be concatenated and put into a column. |
| 272 | 272 | */ |
| 273 | - val vconcat: List<Spec>? = null, | |
| 273 | + val vconcat: List<Spec>, | |
| 274 | 274 | |
| 275 | 275 | /** |
| 276 | 276 | * A list of views that should be concatenated and put into a row. |
| 277 | 277 | */ |
| 278 | - val hconcat: List<Spec>? = null | |
| 278 | + val hconcat: List<Spec> | |
| 279 | 279 | ) { |
| 280 | 280 | public fun toJson() = klaxon.toJsonString(this) |
| 281 | 281 | |
| @@ -2387,7 +2387,7 @@ sealed class RangeConfigValue { | ||
| 2387 | 2387 | data class VGScheme ( |
| 2388 | 2388 | val count: Double? = null, |
| 2389 | 2389 | val extent: List<Double>? = null, |
| 2390 | - val scheme: String? = null, | |
| 2390 | + val scheme: String, | |
| 2391 | 2391 | val step: Double? = null |
| 2392 | 2392 | ) |
| 2393 | 2393 | |
| @@ -2964,7 +2964,7 @@ data class SingleSelectionConfig ( | ||
| 2964 | 2964 | data class VGBinding ( |
| 2965 | 2965 | val element: String? = null, |
| 2966 | 2966 | val input: String, |
| 2967 | - val options: List<String>? = null, | |
| 2967 | + val options: List<String>, | |
| 2968 | 2968 | val max: Double? = null, |
| 2969 | 2969 | val min: Double? = null, |
| 2970 | 2970 | val step: Double? = null |
| @@ -3859,7 +3859,7 @@ data class Data ( | ||
| 3859 | 3859 | * An URL from which to load the data set. Use the `format.type` property |
| 3860 | 3860 | * to ensure the loaded data is correctly parsed. |
| 3861 | 3861 | */ |
| 3862 | - val url: String? = null, | |
| 3862 | + val url: String, | |
| 3863 | 3863 | |
| 3864 | 3864 | /** |
| 3865 | 3865 | * The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3867,12 +3867,12 @@ data class Data ( | ||
| 3867 | 3867 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3868 | 3868 | * parsed according to the specified format type. |
| 3869 | 3869 | */ |
| 3870 | - val values: Values? = null, | |
| 3870 | + val values: Values, | |
| 3871 | 3871 | |
| 3872 | 3872 | /** |
| 3873 | 3873 | * Provide a placeholder name and bind data at runtime. |
| 3874 | 3874 | */ |
| 3875 | - val name: String? = null | |
| 3875 | + val name: String | |
| 3876 | 3876 | ) |
| 3877 | 3877 | |
| 3878 | 3878 | /** |
| @@ -4273,7 +4273,7 @@ data class MarkPropDefWithCondition ( | ||
| 4273 | 4273 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4274 | 4274 | * [geographic projection](projection.html) is applied. |
| 4275 | 4275 | */ |
| 4276 | - val type: Type? = null, | |
| 4276 | + val type: Type, | |
| 4277 | 4277 | |
| 4278 | 4278 | /** |
| 4279 | 4279 | * A constant value in visual domain. |
| @@ -4447,7 +4447,7 @@ sealed class ColorCondition { | ||
| 4447 | 4447 | } |
| 4448 | 4448 | |
| 4449 | 4449 | data class ConditionalValueDef ( |
| 4450 | - val test: LogicalOperandPredicate? = null, | |
| 4450 | + val test: LogicalOperandPredicate, | |
| 4451 | 4451 | |
| 4452 | 4452 | /** |
| 4453 | 4453 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4459,13 +4459,13 @@ data class ConditionalValueDef ( | ||
| 4459 | 4459 | * A [selection name](selection.html), or a series of [composed |
| 4460 | 4460 | * selections](selection.html#compose). |
| 4461 | 4461 | */ |
| 4462 | - val selection: SelectionOperand? = null | |
| 4462 | + val selection: SelectionOperand | |
| 4463 | 4463 | ) |
| 4464 | 4464 | |
| 4465 | 4465 | data class Selection ( |
| 4466 | - val not: SelectionOperand? = null, | |
| 4467 | - val and: List<SelectionOperand>? = null, | |
| 4468 | - val or: List<SelectionOperand>? = null | |
| 4466 | + val not: SelectionOperand, | |
| 4467 | + val and: List<SelectionOperand>, | |
| 4468 | + val or: List<SelectionOperand> | |
| 4469 | 4469 | ) |
| 4470 | 4470 | |
| 4471 | 4471 | /** |
| @@ -4493,21 +4493,21 @@ sealed class SelectionOperand { | ||
| 4493 | 4493 | } |
| 4494 | 4494 | |
| 4495 | 4495 | data class Predicate ( |
| 4496 | - val not: LogicalOperandPredicate? = null, | |
| 4497 | - val and: List<LogicalOperandPredicate>? = null, | |
| 4498 | - val or: List<LogicalOperandPredicate>? = null, | |
| 4496 | + val not: LogicalOperandPredicate, | |
| 4497 | + val and: List<LogicalOperandPredicate>, | |
| 4498 | + val or: List<LogicalOperandPredicate>, | |
| 4499 | 4499 | |
| 4500 | 4500 | /** |
| 4501 | 4501 | * The value that the field should be equal to. |
| 4502 | 4502 | */ |
| 4503 | - val equal: Equal? = null, | |
| 4503 | + val equal: Equal, | |
| 4504 | 4504 | |
| 4505 | 4505 | /** |
| 4506 | 4506 | * Field to be filtered. |
| 4507 | 4507 | * |
| 4508 | 4508 | * Field to be filtered |
| 4509 | 4509 | */ |
| 4510 | - val field: String? = null, | |
| 4510 | + val field: String, | |
| 4511 | 4511 | |
| 4512 | 4512 | /** |
| 4513 | 4513 | * Time unit for the field to be filtered. |
| @@ -4520,18 +4520,18 @@ data class Predicate ( | ||
| 4520 | 4520 | * An array of inclusive minimum and maximum values |
| 4521 | 4521 | * for a field value of a data item to be included in the filtered data. |
| 4522 | 4522 | */ |
| 4523 | - val range: List<RangeElement>? = null, | |
| 4523 | + val range: List<RangeElement>, | |
| 4524 | 4524 | |
| 4525 | 4525 | /** |
| 4526 | 4526 | * A set of values that the `field`'s value should be a member of, |
| 4527 | 4527 | * for a data item included in the filtered data. |
| 4528 | 4528 | */ |
| 4529 | - val oneOf: List<Equal>? = null, | |
| 4529 | + val oneOf: List<Equal>, | |
| 4530 | 4530 | |
| 4531 | 4531 | /** |
| 4532 | 4532 | * Filter using a selection name. |
| 4533 | 4533 | */ |
| 4534 | - val selection: SelectionOperand? = null | |
| 4534 | + val selection: SelectionOperand | |
| 4535 | 4535 | ) |
| 4536 | 4536 | |
| 4537 | 4537 | /** |
| @@ -4860,19 +4860,19 @@ sealed class ConditionalValueDefValue { | ||
| 4860 | 4860 | } |
| 4861 | 4861 | |
| 4862 | 4862 | data class ConditionalPredicateMarkPropFieldDefClass ( |
| 4863 | - val test: LogicalOperandPredicate? = null, | |
| 4863 | + val test: LogicalOperandPredicate, | |
| 4864 | 4864 | |
| 4865 | 4865 | /** |
| 4866 | 4866 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4867 | 4867 | * `0` to `1` for opacity). |
| 4868 | 4868 | */ |
| 4869 | - val value: ConditionalValueDefValue? = null, | |
| 4869 | + val value: ConditionalValueDefValue, | |
| 4870 | 4870 | |
| 4871 | 4871 | /** |
| 4872 | 4872 | * A [selection name](selection.html), or a series of [composed |
| 4873 | 4873 | * selections](selection.html#compose). |
| 4874 | 4874 | */ |
| 4875 | - val selection: SelectionOperand? = null, | |
| 4875 | + val selection: SelectionOperand, | |
| 4876 | 4876 | |
| 4877 | 4877 | /** |
| 4878 | 4878 | * Aggregation function for the field |
| @@ -4946,7 +4946,7 @@ data class ConditionalPredicateMarkPropFieldDefClass ( | ||
| 4946 | 4946 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4947 | 4947 | * [geographic projection](projection.html) is applied. |
| 4948 | 4948 | */ |
| 4949 | - val type: Type? = null | |
| 4949 | + val type: Type | |
| 4950 | 4950 | ) |
| 4951 | 4951 | |
| 4952 | 4952 | sealed class Field { |
| @@ -6017,7 +6017,7 @@ data class DefWithCondition ( | ||
| 6017 | 6017 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6018 | 6018 | * [geographic projection](projection.html) is applied. |
| 6019 | 6019 | */ |
| 6020 | - val type: Type? = null, | |
| 6020 | + val type: Type, | |
| 6021 | 6021 | |
| 6022 | 6022 | /** |
| 6023 | 6023 | * A constant value in visual domain. |
| @@ -6044,19 +6044,19 @@ sealed class HrefCondition { | ||
| 6044 | 6044 | } |
| 6045 | 6045 | |
| 6046 | 6046 | data class ConditionalPredicateFieldDefClass ( |
| 6047 | - val test: LogicalOperandPredicate? = null, | |
| 6047 | + val test: LogicalOperandPredicate, | |
| 6048 | 6048 | |
| 6049 | 6049 | /** |
| 6050 | 6050 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6051 | 6051 | * `0` to `1` for opacity). |
| 6052 | 6052 | */ |
| 6053 | - val value: ConditionalValueDefValue? = null, | |
| 6053 | + val value: ConditionalValueDefValue, | |
| 6054 | 6054 | |
| 6055 | 6055 | /** |
| 6056 | 6056 | * A [selection name](selection.html), or a series of [composed |
| 6057 | 6057 | * selections](selection.html#compose). |
| 6058 | 6058 | */ |
| 6059 | - val selection: SelectionOperand? = null, | |
| 6059 | + val selection: SelectionOperand, | |
| 6060 | 6060 | |
| 6061 | 6061 | /** |
| 6062 | 6062 | * Aggregation function for the field |
| @@ -6103,7 +6103,7 @@ data class ConditionalPredicateFieldDefClass ( | ||
| 6103 | 6103 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6104 | 6104 | * [geographic projection](projection.html) is applied. |
| 6105 | 6105 | */ |
| 6106 | - val type: Type? = null | |
| 6106 | + val type: Type | |
| 6107 | 6107 | ) |
| 6108 | 6108 | |
| 6109 | 6109 | sealed class Order { |
| @@ -6259,7 +6259,7 @@ data class TextDefWithCondition ( | ||
| 6259 | 6259 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6260 | 6260 | * [geographic projection](projection.html) is applied. |
| 6261 | 6261 | */ |
| 6262 | - val type: Type? = null, | |
| 6262 | + val type: Type, | |
| 6263 | 6263 | |
| 6264 | 6264 | /** |
| 6265 | 6265 | * A constant value in visual domain. |
| @@ -6286,19 +6286,19 @@ sealed class TextCondition { | ||
| 6286 | 6286 | } |
| 6287 | 6287 | |
| 6288 | 6288 | data class ConditionalPredicateTextFieldDefClass ( |
| 6289 | - val test: LogicalOperandPredicate? = null, | |
| 6289 | + val test: LogicalOperandPredicate, | |
| 6290 | 6290 | |
| 6291 | 6291 | /** |
| 6292 | 6292 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6293 | 6293 | * `0` to `1` for opacity). |
| 6294 | 6294 | */ |
| 6295 | - val value: ConditionalValueDefValue? = null, | |
| 6295 | + val value: ConditionalValueDefValue, | |
| 6296 | 6296 | |
| 6297 | 6297 | /** |
| 6298 | 6298 | * A [selection name](selection.html), or a series of [composed |
| 6299 | 6299 | * selections](selection.html#compose). |
| 6300 | 6300 | */ |
| 6301 | - val selection: SelectionOperand? = null, | |
| 6301 | + val selection: SelectionOperand, | |
| 6302 | 6302 | |
| 6303 | 6303 | /** |
| 6304 | 6304 | * Aggregation function for the field |
| @@ -6351,7 +6351,7 @@ data class ConditionalPredicateTextFieldDefClass ( | ||
| 6351 | 6351 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6352 | 6352 | * [geographic projection](projection.html) is applied. |
| 6353 | 6353 | */ |
| 6354 | - val type: Type? = null | |
| 6354 | + val type: Type | |
| 6355 | 6355 | ) |
| 6356 | 6356 | |
| 6357 | 6357 | /** |
| @@ -6458,13 +6458,13 @@ data class XClass ( | ||
| 6458 | 6458 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6459 | 6459 | * [geographic projection](projection.html) is applied. |
| 6460 | 6460 | */ |
| 6461 | - val type: Type? = null, | |
| 6461 | + val type: Type, | |
| 6462 | 6462 | |
| 6463 | 6463 | /** |
| 6464 | 6464 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6465 | 6465 | * `0` to `1` for opacity). |
| 6466 | 6466 | */ |
| 6467 | - val value: ConditionalValueDefValue? = null | |
| 6467 | + val value: ConditionalValueDefValue | |
| 6468 | 6468 | ) |
| 6469 | 6469 | |
| 6470 | 6470 | data class Axis ( |
| @@ -6728,13 +6728,13 @@ data class X2Class ( | ||
| 6728 | 6728 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6729 | 6729 | * [geographic projection](projection.html) is applied. |
| 6730 | 6730 | */ |
| 6731 | - val type: Type? = null, | |
| 6731 | + val type: Type, | |
| 6732 | 6732 | |
| 6733 | 6733 | /** |
| 6734 | 6734 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6735 | 6735 | * `0` to `1` for opacity). |
| 6736 | 6736 | */ |
| 6737 | - val value: ConditionalValueDefValue? = null | |
| 6737 | + val value: ConditionalValueDefValue | |
| 6738 | 6738 | ) |
| 6739 | 6739 | |
| 6740 | 6740 | /** |
| @@ -6794,7 +6794,7 @@ data class Spec ( | ||
| 6794 | 6794 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6795 | 6795 | * layering facet specifications is not allowed. |
| 6796 | 6796 | */ |
| 6797 | - val layer: List<LayerSpec>? = null, | |
| 6797 | + val layer: List<LayerSpec>, | |
| 6798 | 6798 | |
| 6799 | 6799 | /** |
| 6800 | 6800 | * Name of the visualization for later reference. |
| @@ -6851,7 +6851,7 @@ data class Spec ( | ||
| 6851 | 6851 | /** |
| 6852 | 6852 | * A key-value mapping between encoding channels and definition of fields. |
| 6853 | 6853 | */ |
| 6854 | - val encoding: Encoding? = null, | |
| 6854 | + val encoding: Encoding, | |
| 6855 | 6855 | |
| 6856 | 6856 | /** |
| 6857 | 6857 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6859,7 +6859,7 @@ data class Spec ( | ||
| 6859 | 6859 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6860 | 6860 | * object](mark.html#mark-def). |
| 6861 | 6861 | */ |
| 6862 | - val mark: AnyMark? = null, | |
| 6862 | + val mark: AnyMark, | |
| 6863 | 6863 | |
| 6864 | 6864 | /** |
| 6865 | 6865 | * An object defining properties of geographic projection. |
| @@ -6878,28 +6878,28 @@ data class Spec ( | ||
| 6878 | 6878 | * An object that describes mappings between `row` and `column` channels and their field |
| 6879 | 6879 | * definitions. |
| 6880 | 6880 | */ |
| 6881 | - val facet: FacetMapping? = null, | |
| 6881 | + val facet: FacetMapping, | |
| 6882 | 6882 | |
| 6883 | 6883 | /** |
| 6884 | 6884 | * A specification of the view that gets faceted. |
| 6885 | 6885 | */ |
| 6886 | - val spec: Spec? = null, | |
| 6886 | + val spec: Spec, | |
| 6887 | 6887 | |
| 6888 | 6888 | /** |
| 6889 | 6889 | * An object that describes what fields should be repeated into views that are laid out as a |
| 6890 | 6890 | * `row` or `column`. |
| 6891 | 6891 | */ |
| 6892 | - val repeat: Repeat? = null, | |
| 6892 | + val repeat: Repeat, | |
| 6893 | 6893 | |
| 6894 | 6894 | /** |
| 6895 | 6895 | * A list of views that should be concatenated and put into a column. |
| 6896 | 6896 | */ |
| 6897 | - val vconcat: List<Spec>? = null, | |
| 6897 | + val vconcat: List<Spec>, | |
| 6898 | 6898 | |
| 6899 | 6899 | /** |
| 6900 | 6900 | * A list of views that should be concatenated and put into a row. |
| 6901 | 6901 | */ |
| 6902 | - val hconcat: List<Spec>? = null | |
| 6902 | + val hconcat: List<Spec> | |
| 6903 | 6903 | ) |
| 6904 | 6904 | |
| 6905 | 6905 | /** |
| @@ -7039,7 +7039,7 @@ data class LayerSpec ( | ||
| 7039 | 7039 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 7040 | 7040 | * layering facet specifications is not allowed. |
| 7041 | 7041 | */ |
| 7042 | - val layer: List<LayerSpec>? = null, | |
| 7042 | + val layer: List<LayerSpec>, | |
| 7043 | 7043 | |
| 7044 | 7044 | /** |
| 7045 | 7045 | * Name of the visualization for later reference. |
| @@ -7088,7 +7088,7 @@ data class LayerSpec ( | ||
| 7088 | 7088 | /** |
| 7089 | 7089 | * A key-value mapping between encoding channels and definition of fields. |
| 7090 | 7090 | */ |
| 7091 | - val encoding: Encoding? = null, | |
| 7091 | + val encoding: Encoding, | |
| 7092 | 7092 | |
| 7093 | 7093 | /** |
| 7094 | 7094 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -7096,7 +7096,7 @@ data class LayerSpec ( | ||
| 7096 | 7096 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 7097 | 7097 | * object](mark.html#mark-def). |
| 7098 | 7098 | */ |
| 7099 | - val mark: AnyMark? = null, | |
| 7099 | + val mark: AnyMark, | |
| 7100 | 7100 | |
| 7101 | 7101 | /** |
| 7102 | 7102 | * An object defining properties of geographic projection. |
| @@ -7781,7 +7781,7 @@ data class Transform ( | ||
| 7781 | 7781 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 7782 | 7782 | * or (4) a logical operand that combines (1), (2), or (3). |
| 7783 | 7783 | */ |
| 7784 | - val filter: LogicalOperandPredicate? = null, | |
| 7784 | + val filter: LogicalOperandPredicate, | |
| 7785 | 7785 | |
| 7786 | 7786 | /** |
| 7787 | 7787 | * The field for storing the computed formula value. |
| @@ -7802,7 +7802,7 @@ data class Transform ( | ||
| 7802 | 7802 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 7803 | 7803 | * current data object. |
| 7804 | 7804 | */ |
| 7805 | - val calculate: String? = null, | |
| 7805 | + val calculate: String, | |
| 7806 | 7806 | |
| 7807 | 7807 | /** |
| 7808 | 7808 | * The default value to use if lookup fails. |
| @@ -7814,34 +7814,34 @@ data class Transform ( | ||
| 7814 | 7814 | /** |
| 7815 | 7815 | * Secondary data reference. |
| 7816 | 7816 | */ |
| 7817 | - val from: LookupData? = null, | |
| 7817 | + val from: LookupData, | |
| 7818 | 7818 | |
| 7819 | 7819 | /** |
| 7820 | 7820 | * Key in primary data source. |
| 7821 | 7821 | */ |
| 7822 | - val lookup: String? = null, | |
| 7822 | + val lookup: String, | |
| 7823 | 7823 | |
| 7824 | 7824 | /** |
| 7825 | 7825 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 7826 | 7826 | */ |
| 7827 | - val bin: Bin? = null, | |
| 7827 | + val bin: Bin, | |
| 7828 | 7828 | |
| 7829 | 7829 | /** |
| 7830 | 7830 | * The data field to bin. |
| 7831 | 7831 | * |
| 7832 | 7832 | * The data field to apply time unit. |
| 7833 | 7833 | */ |
| 7834 | - val field: String? = null, | |
| 7834 | + val field: String, | |
| 7835 | 7835 | |
| 7836 | 7836 | /** |
| 7837 | 7837 | * The timeUnit. |
| 7838 | 7838 | */ |
| 7839 | - val timeUnit: TimeUnit? = null, | |
| 7839 | + val timeUnit: TimeUnit, | |
| 7840 | 7840 | |
| 7841 | 7841 | /** |
| 7842 | 7842 | * Array of objects that define fields to aggregate. |
| 7843 | 7843 | */ |
| 7844 | - val aggregate: List<AggregatedFieldDef>? = null, | |
| 7844 | + val aggregate: List<AggregatedFieldDef>, | |
| 7845 | 7845 | |
| 7846 | 7846 | /** |
| 7847 | 7847 | * The data fields to group by. If not specified, a single group containing all data objects |
Mschema-kotlinxdefault / TopLevel.kt+64 −64
| @@ -58,7 +58,7 @@ data class TopLevel ( | ||
| 58 | 58 | /** |
| 59 | 59 | * A key-value mapping between encoding channels and definition of fields. |
| 60 | 60 | */ |
| 61 | - val encoding: EncodingWithFacet? = null, | |
| 61 | + val encoding: EncodingWithFacet, | |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * The height of a visualization. |
| @@ -87,7 +87,7 @@ data class TopLevel ( | ||
| 87 | 87 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 88 | 88 | * object](mark.html#mark-def). |
| 89 | 89 | */ |
| 90 | - val mark: AnyMark? = null, | |
| 90 | + val mark: AnyMark, | |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * Name of the visualization for later reference. |
| @@ -157,7 +157,7 @@ data class TopLevel ( | ||
| 157 | 157 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 158 | 158 | * layering facet specifications is not allowed. |
| 159 | 159 | */ |
| 160 | - val layer: List<LayerSpec>? = null, | |
| 160 | + val layer: List<LayerSpec>, | |
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | 163 | * Scale, axis, and legend resolutions for layers. |
| @@ -176,28 +176,28 @@ data class TopLevel ( | ||
| 176 | 176 | * An object that describes mappings between `row` and `column` channels and their field |
| 177 | 177 | * definitions. |
| 178 | 178 | */ |
| 179 | - val facet: FacetMapping? = null, | |
| 179 | + val facet: FacetMapping, | |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | 182 | * A specification of the view that gets faceted. |
| 183 | 183 | */ |
| 184 | - val spec: Spec? = null, | |
| 184 | + val spec: Spec, | |
| 185 | 185 | |
| 186 | 186 | /** |
| 187 | 187 | * An object that describes what fields should be repeated into views that are laid out as a |
| 188 | 188 | * `row` or `column`. |
| 189 | 189 | */ |
| 190 | - val repeat: Repeat? = null, | |
| 190 | + val repeat: Repeat, | |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | 193 | * A list of views that should be concatenated and put into a column. |
| 194 | 194 | */ |
| 195 | - val vconcat: List<Spec>? = null, | |
| 195 | + val vconcat: List<Spec>, | |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | 198 | * A list of views that should be concatenated and put into a row. |
| 199 | 199 | */ |
| 200 | - val hconcat: List<Spec>? = null | |
| 200 | + val hconcat: List<Spec> | |
| 201 | 201 | ) |
| 202 | 202 | |
| 203 | 203 | /** |
| @@ -2067,7 +2067,7 @@ sealed class RangeConfigValue { | ||
| 2067 | 2067 | data class VGScheme ( |
| 2068 | 2068 | val count: Double? = null, |
| 2069 | 2069 | val extent: List<Double>? = null, |
| 2070 | - val scheme: String? = null, | |
| 2070 | + val scheme: String, | |
| 2071 | 2071 | val step: Double? = null |
| 2072 | 2072 | ) |
| 2073 | 2073 | |
| @@ -2600,7 +2600,7 @@ data class SingleSelectionConfig ( | ||
| 2600 | 2600 | data class VGBinding ( |
| 2601 | 2601 | val element: String? = null, |
| 2602 | 2602 | val input: String, |
| 2603 | - val options: List<String>? = null, | |
| 2603 | + val options: List<String>, | |
| 2604 | 2604 | val max: Double? = null, |
| 2605 | 2605 | val min: Double? = null, |
| 2606 | 2606 | val step: Double? = null |
| @@ -3476,7 +3476,7 @@ data class Data ( | ||
| 3476 | 3476 | * An URL from which to load the data set. Use the `format.type` property |
| 3477 | 3477 | * to ensure the loaded data is correctly parsed. |
| 3478 | 3478 | */ |
| 3479 | - val url: String? = null, | |
| 3479 | + val url: String, | |
| 3480 | 3480 | |
| 3481 | 3481 | /** |
| 3482 | 3482 | * The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3484,12 +3484,12 @@ data class Data ( | ||
| 3484 | 3484 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3485 | 3485 | * parsed according to the specified format type. |
| 3486 | 3486 | */ |
| 3487 | - val values: Values? = null, | |
| 3487 | + val values: Values, | |
| 3488 | 3488 | |
| 3489 | 3489 | /** |
| 3490 | 3490 | * Provide a placeholder name and bind data at runtime. |
| 3491 | 3491 | */ |
| 3492 | - val name: String? = null | |
| 3492 | + val name: String | |
| 3493 | 3493 | ) |
| 3494 | 3494 | |
| 3495 | 3495 | /** |
| @@ -3836,7 +3836,7 @@ data class MarkPropDefWithCondition ( | ||
| 3836 | 3836 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3837 | 3837 | * [geographic projection](projection.html) is applied. |
| 3838 | 3838 | */ |
| 3839 | - val type: Type? = null, | |
| 3839 | + val type: Type, | |
| 3840 | 3840 | |
| 3841 | 3841 | /** |
| 3842 | 3842 | * A constant value in visual domain. |
| @@ -3962,7 +3962,7 @@ sealed class ColorCondition { | ||
| 3962 | 3962 | |
| 3963 | 3963 | @Serializable |
| 3964 | 3964 | data class ConditionalValueDef ( |
| 3965 | - val test: LogicalOperandPredicate? = null, | |
| 3965 | + val test: LogicalOperandPredicate, | |
| 3966 | 3966 | |
| 3967 | 3967 | /** |
| 3968 | 3968 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -3974,14 +3974,14 @@ data class ConditionalValueDef ( | ||
| 3974 | 3974 | * A [selection name](selection.html), or a series of [composed |
| 3975 | 3975 | * selections](selection.html#compose). |
| 3976 | 3976 | */ |
| 3977 | - val selection: SelectionOperand? = null | |
| 3977 | + val selection: SelectionOperand | |
| 3978 | 3978 | ) |
| 3979 | 3979 | |
| 3980 | 3980 | @Serializable |
| 3981 | 3981 | data class Selection ( |
| 3982 | - val not: SelectionOperand? = null, | |
| 3983 | - val and: List<SelectionOperand>? = null, | |
| 3984 | - val or: List<SelectionOperand>? = null | |
| 3982 | + val not: SelectionOperand, | |
| 3983 | + val and: List<SelectionOperand>, | |
| 3984 | + val or: List<SelectionOperand> | |
| 3985 | 3985 | ) |
| 3986 | 3986 | |
| 3987 | 3987 | /** |
| @@ -3998,21 +3998,21 @@ sealed class SelectionOperand { | ||
| 3998 | 3998 | |
| 3999 | 3999 | @Serializable |
| 4000 | 4000 | data class Predicate ( |
| 4001 | - val not: LogicalOperandPredicate? = null, | |
| 4002 | - val and: List<LogicalOperandPredicate>? = null, | |
| 4003 | - val or: List<LogicalOperandPredicate>? = null, | |
| 4001 | + val not: LogicalOperandPredicate, | |
| 4002 | + val and: List<LogicalOperandPredicate>, | |
| 4003 | + val or: List<LogicalOperandPredicate>, | |
| 4004 | 4004 | |
| 4005 | 4005 | /** |
| 4006 | 4006 | * The value that the field should be equal to. |
| 4007 | 4007 | */ |
| 4008 | - val equal: Equal? = null, | |
| 4008 | + val equal: Equal, | |
| 4009 | 4009 | |
| 4010 | 4010 | /** |
| 4011 | 4011 | * Field to be filtered. |
| 4012 | 4012 | * |
| 4013 | 4013 | * Field to be filtered |
| 4014 | 4014 | */ |
| 4015 | - val field: String? = null, | |
| 4015 | + val field: String, | |
| 4016 | 4016 | |
| 4017 | 4017 | /** |
| 4018 | 4018 | * Time unit for the field to be filtered. |
| @@ -4025,18 +4025,18 @@ data class Predicate ( | ||
| 4025 | 4025 | * An array of inclusive minimum and maximum values |
| 4026 | 4026 | * for a field value of a data item to be included in the filtered data. |
| 4027 | 4027 | */ |
| 4028 | - val range: List<RangeElement>? = null, | |
| 4028 | + val range: List<RangeElement>, | |
| 4029 | 4029 | |
| 4030 | 4030 | /** |
| 4031 | 4031 | * A set of values that the `field`'s value should be a member of, |
| 4032 | 4032 | * for a data item included in the filtered data. |
| 4033 | 4033 | */ |
| 4034 | - val oneOf: List<Equal>? = null, | |
| 4034 | + val oneOf: List<Equal>, | |
| 4035 | 4035 | |
| 4036 | 4036 | /** |
| 4037 | 4037 | * Filter using a selection name. |
| 4038 | 4038 | */ |
| 4039 | - val selection: SelectionOperand? = null | |
| 4039 | + val selection: SelectionOperand | |
| 4040 | 4040 | ) |
| 4041 | 4041 | |
| 4042 | 4042 | /** |
| @@ -4238,19 +4238,19 @@ sealed class ConditionalValueDefValue { | ||
| 4238 | 4238 | |
| 4239 | 4239 | @Serializable |
| 4240 | 4240 | data class ConditionalPredicateMarkPropFieldDefClass ( |
| 4241 | - val test: LogicalOperandPredicate? = null, | |
| 4241 | + val test: LogicalOperandPredicate, | |
| 4242 | 4242 | |
| 4243 | 4243 | /** |
| 4244 | 4244 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4245 | 4245 | * `0` to `1` for opacity). |
| 4246 | 4246 | */ |
| 4247 | - val value: ConditionalValueDefValue? = null, | |
| 4247 | + val value: ConditionalValueDefValue, | |
| 4248 | 4248 | |
| 4249 | 4249 | /** |
| 4250 | 4250 | * A [selection name](selection.html), or a series of [composed |
| 4251 | 4251 | * selections](selection.html#compose). |
| 4252 | 4252 | */ |
| 4253 | - val selection: SelectionOperand? = null, | |
| 4253 | + val selection: SelectionOperand, | |
| 4254 | 4254 | |
| 4255 | 4255 | /** |
| 4256 | 4256 | * Aggregation function for the field |
| @@ -4324,7 +4324,7 @@ data class ConditionalPredicateMarkPropFieldDefClass ( | ||
| 4324 | 4324 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4325 | 4325 | * [geographic projection](projection.html) is applied. |
| 4326 | 4326 | */ |
| 4327 | - val type: Type? = null | |
| 4327 | + val type: Type | |
| 4328 | 4328 | ) |
| 4329 | 4329 | |
| 4330 | 4330 | @Serializable |
| @@ -5213,7 +5213,7 @@ data class DefWithCondition ( | ||
| 5213 | 5213 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5214 | 5214 | * [geographic projection](projection.html) is applied. |
| 5215 | 5215 | */ |
| 5216 | - val type: Type? = null, | |
| 5216 | + val type: Type, | |
| 5217 | 5217 | |
| 5218 | 5218 | /** |
| 5219 | 5219 | * A constant value in visual domain. |
| @@ -5229,19 +5229,19 @@ sealed class HrefCondition { | ||
| 5229 | 5229 | |
| 5230 | 5230 | @Serializable |
| 5231 | 5231 | data class ConditionalPredicateFieldDefClass ( |
| 5232 | - val test: LogicalOperandPredicate? = null, | |
| 5232 | + val test: LogicalOperandPredicate, | |
| 5233 | 5233 | |
| 5234 | 5234 | /** |
| 5235 | 5235 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5236 | 5236 | * `0` to `1` for opacity). |
| 5237 | 5237 | */ |
| 5238 | - val value: ConditionalValueDefValue? = null, | |
| 5238 | + val value: ConditionalValueDefValue, | |
| 5239 | 5239 | |
| 5240 | 5240 | /** |
| 5241 | 5241 | * A [selection name](selection.html), or a series of [composed |
| 5242 | 5242 | * selections](selection.html#compose). |
| 5243 | 5243 | */ |
| 5244 | - val selection: SelectionOperand? = null, | |
| 5244 | + val selection: SelectionOperand, | |
| 5245 | 5245 | |
| 5246 | 5246 | /** |
| 5247 | 5247 | * Aggregation function for the field |
| @@ -5288,7 +5288,7 @@ data class ConditionalPredicateFieldDefClass ( | ||
| 5288 | 5288 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5289 | 5289 | * [geographic projection](projection.html) is applied. |
| 5290 | 5290 | */ |
| 5291 | - val type: Type? = null | |
| 5291 | + val type: Type | |
| 5292 | 5292 | ) |
| 5293 | 5293 | |
| 5294 | 5294 | @Serializable |
| @@ -5434,7 +5434,7 @@ data class TextDefWithCondition ( | ||
| 5434 | 5434 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5435 | 5435 | * [geographic projection](projection.html) is applied. |
| 5436 | 5436 | */ |
| 5437 | - val type: Type? = null, | |
| 5437 | + val type: Type, | |
| 5438 | 5438 | |
| 5439 | 5439 | /** |
| 5440 | 5440 | * A constant value in visual domain. |
| @@ -5450,19 +5450,19 @@ sealed class TextCondition { | ||
| 5450 | 5450 | |
| 5451 | 5451 | @Serializable |
| 5452 | 5452 | data class ConditionalPredicateTextFieldDefClass ( |
| 5453 | - val test: LogicalOperandPredicate? = null, | |
| 5453 | + val test: LogicalOperandPredicate, | |
| 5454 | 5454 | |
| 5455 | 5455 | /** |
| 5456 | 5456 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5457 | 5457 | * `0` to `1` for opacity). |
| 5458 | 5458 | */ |
| 5459 | - val value: ConditionalValueDefValue? = null, | |
| 5459 | + val value: ConditionalValueDefValue, | |
| 5460 | 5460 | |
| 5461 | 5461 | /** |
| 5462 | 5462 | * A [selection name](selection.html), or a series of [composed |
| 5463 | 5463 | * selections](selection.html#compose). |
| 5464 | 5464 | */ |
| 5465 | - val selection: SelectionOperand? = null, | |
| 5465 | + val selection: SelectionOperand, | |
| 5466 | 5466 | |
| 5467 | 5467 | /** |
| 5468 | 5468 | * Aggregation function for the field |
| @@ -5515,7 +5515,7 @@ data class ConditionalPredicateTextFieldDefClass ( | ||
| 5515 | 5515 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5516 | 5516 | * [geographic projection](projection.html) is applied. |
| 5517 | 5517 | */ |
| 5518 | - val type: Type? = null | |
| 5518 | + val type: Type | |
| 5519 | 5519 | ) |
| 5520 | 5520 | |
| 5521 | 5521 | /** |
| @@ -5623,13 +5623,13 @@ data class XClass ( | ||
| 5623 | 5623 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5624 | 5624 | * [geographic projection](projection.html) is applied. |
| 5625 | 5625 | */ |
| 5626 | - val type: Type? = null, | |
| 5626 | + val type: Type, | |
| 5627 | 5627 | |
| 5628 | 5628 | /** |
| 5629 | 5629 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5630 | 5630 | * `0` to `1` for opacity). |
| 5631 | 5631 | */ |
| 5632 | - val value: ConditionalValueDefValue? = null | |
| 5632 | + val value: ConditionalValueDefValue | |
| 5633 | 5633 | ) |
| 5634 | 5634 | |
| 5635 | 5635 | @Serializable |
| @@ -5883,13 +5883,13 @@ data class X2Class ( | ||
| 5883 | 5883 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5884 | 5884 | * [geographic projection](projection.html) is applied. |
| 5885 | 5885 | */ |
| 5886 | - val type: Type? = null, | |
| 5886 | + val type: Type, | |
| 5887 | 5887 | |
| 5888 | 5888 | /** |
| 5889 | 5889 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5890 | 5890 | * `0` to `1` for opacity). |
| 5891 | 5891 | */ |
| 5892 | - val value: ConditionalValueDefValue? = null | |
| 5892 | + val value: ConditionalValueDefValue | |
| 5893 | 5893 | ) |
| 5894 | 5894 | |
| 5895 | 5895 | /** |
| @@ -5951,7 +5951,7 @@ data class Spec ( | ||
| 5951 | 5951 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5952 | 5952 | * layering facet specifications is not allowed. |
| 5953 | 5953 | */ |
| 5954 | - val layer: List<LayerSpec>? = null, | |
| 5954 | + val layer: List<LayerSpec>, | |
| 5955 | 5955 | |
| 5956 | 5956 | /** |
| 5957 | 5957 | * Name of the visualization for later reference. |
| @@ -6008,7 +6008,7 @@ data class Spec ( | ||
| 6008 | 6008 | /** |
| 6009 | 6009 | * A key-value mapping between encoding channels and definition of fields. |
| 6010 | 6010 | */ |
| 6011 | - val encoding: Encoding? = null, | |
| 6011 | + val encoding: Encoding, | |
| 6012 | 6012 | |
| 6013 | 6013 | /** |
| 6014 | 6014 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6016,7 +6016,7 @@ data class Spec ( | ||
| 6016 | 6016 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6017 | 6017 | * object](mark.html#mark-def). |
| 6018 | 6018 | */ |
| 6019 | - val mark: AnyMark? = null, | |
| 6019 | + val mark: AnyMark, | |
| 6020 | 6020 | |
| 6021 | 6021 | /** |
| 6022 | 6022 | * An object defining properties of geographic projection. |
| @@ -6035,28 +6035,28 @@ data class Spec ( | ||
| 6035 | 6035 | * An object that describes mappings between `row` and `column` channels and their field |
| 6036 | 6036 | * definitions. |
| 6037 | 6037 | */ |
| 6038 | - val facet: FacetMapping? = null, | |
| 6038 | + val facet: FacetMapping, | |
| 6039 | 6039 | |
| 6040 | 6040 | /** |
| 6041 | 6041 | * A specification of the view that gets faceted. |
| 6042 | 6042 | */ |
| 6043 | - val spec: Spec? = null, | |
| 6043 | + val spec: Spec, | |
| 6044 | 6044 | |
| 6045 | 6045 | /** |
| 6046 | 6046 | * An object that describes what fields should be repeated into views that are laid out as a |
| 6047 | 6047 | * `row` or `column`. |
| 6048 | 6048 | */ |
| 6049 | - val repeat: Repeat? = null, | |
| 6049 | + val repeat: Repeat, | |
| 6050 | 6050 | |
| 6051 | 6051 | /** |
| 6052 | 6052 | * A list of views that should be concatenated and put into a column. |
| 6053 | 6053 | */ |
| 6054 | - val vconcat: List<Spec>? = null, | |
| 6054 | + val vconcat: List<Spec>, | |
| 6055 | 6055 | |
| 6056 | 6056 | /** |
| 6057 | 6057 | * A list of views that should be concatenated and put into a row. |
| 6058 | 6058 | */ |
| 6059 | - val hconcat: List<Spec>? = null | |
| 6059 | + val hconcat: List<Spec> | |
| 6060 | 6060 | ) |
| 6061 | 6061 | |
| 6062 | 6062 | /** |
| @@ -6198,7 +6198,7 @@ data class LayerSpec ( | ||
| 6198 | 6198 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6199 | 6199 | * layering facet specifications is not allowed. |
| 6200 | 6200 | */ |
| 6201 | - val layer: List<LayerSpec>? = null, | |
| 6201 | + val layer: List<LayerSpec>, | |
| 6202 | 6202 | |
| 6203 | 6203 | /** |
| 6204 | 6204 | * Name of the visualization for later reference. |
| @@ -6247,7 +6247,7 @@ data class LayerSpec ( | ||
| 6247 | 6247 | /** |
| 6248 | 6248 | * A key-value mapping between encoding channels and definition of fields. |
| 6249 | 6249 | */ |
| 6250 | - val encoding: Encoding? = null, | |
| 6250 | + val encoding: Encoding, | |
| 6251 | 6251 | |
| 6252 | 6252 | /** |
| 6253 | 6253 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6255,7 +6255,7 @@ data class LayerSpec ( | ||
| 6255 | 6255 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6256 | 6256 | * object](mark.html#mark-def). |
| 6257 | 6257 | */ |
| 6258 | - val mark: AnyMark? = null, | |
| 6258 | + val mark: AnyMark, | |
| 6259 | 6259 | |
| 6260 | 6260 | /** |
| 6261 | 6261 | * An object defining properties of geographic projection. |
| @@ -6870,7 +6870,7 @@ data class Transform ( | ||
| 6870 | 6870 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 6871 | 6871 | * or (4) a logical operand that combines (1), (2), or (3). |
| 6872 | 6872 | */ |
| 6873 | - val filter: LogicalOperandPredicate? = null, | |
| 6873 | + val filter: LogicalOperandPredicate, | |
| 6874 | 6874 | |
| 6875 | 6875 | /** |
| 6876 | 6876 | * The field for storing the computed formula value. |
| @@ -6891,7 +6891,7 @@ data class Transform ( | ||
| 6891 | 6891 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 6892 | 6892 | * current data object. |
| 6893 | 6893 | */ |
| 6894 | - val calculate: String? = null, | |
| 6894 | + val calculate: String, | |
| 6895 | 6895 | |
| 6896 | 6896 | /** |
| 6897 | 6897 | * The default value to use if lookup fails. |
| @@ -6903,34 +6903,34 @@ data class Transform ( | ||
| 6903 | 6903 | /** |
| 6904 | 6904 | * Secondary data reference. |
| 6905 | 6905 | */ |
| 6906 | - val from: LookupData? = null, | |
| 6906 | + val from: LookupData, | |
| 6907 | 6907 | |
| 6908 | 6908 | /** |
| 6909 | 6909 | * Key in primary data source. |
| 6910 | 6910 | */ |
| 6911 | - val lookup: String? = null, | |
| 6911 | + val lookup: String, | |
| 6912 | 6912 | |
| 6913 | 6913 | /** |
| 6914 | 6914 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 6915 | 6915 | */ |
| 6916 | - val bin: Bin? = null, | |
| 6916 | + val bin: Bin, | |
| 6917 | 6917 | |
| 6918 | 6918 | /** |
| 6919 | 6919 | * The data field to bin. |
| 6920 | 6920 | * |
| 6921 | 6921 | * The data field to apply time unit. |
| 6922 | 6922 | */ |
| 6923 | - val field: String? = null, | |
| 6923 | + val field: String, | |
| 6924 | 6924 | |
| 6925 | 6925 | /** |
| 6926 | 6926 | * The timeUnit. |
| 6927 | 6927 | */ |
| 6928 | - val timeUnit: TimeUnit? = null, | |
| 6928 | + val timeUnit: TimeUnit, | |
| 6929 | 6929 | |
| 6930 | 6930 | /** |
| 6931 | 6931 | * Array of objects that define fields to aggregate. |
| 6932 | 6932 | */ |
| 6933 | - val aggregate: List<AggregatedFieldDef>? = null, | |
| 6933 | + val aggregate: List<AggregatedFieldDef>, | |
| 6934 | 6934 | |
| 6935 | 6935 | /** |
| 6936 | 6936 | * The data fields to group by. If not specified, a single group containing all data objects |
Mschema-phpdefault / TopLevel.php+1,294 −1,888
| @@ -10,9 +10,9 @@ class TopLevel { | ||
| 10 | 10 | private ?Config $config; // json:config Optional |
| 11 | 11 | private ?Data $data; // json:data Optional |
| 12 | 12 | private ?string $description; // json:description Optional |
| 13 | - private ?EncodingWithFacet $encoding; // json:encoding Optional | |
| 13 | + private EncodingWithFacet $encoding; // json:encoding Required | |
| 14 | 14 | private ?float $height; // json:height Optional |
| 15 | - private MarkDef|Mark|null $mark; // json:mark Optional | |
| 15 | + private MarkDef|Mark $mark; // json:mark Required | |
| 16 | 16 | private ?string $name; // json:name Optional |
| 17 | 17 | private Padding|float|null $padding; // json:padding Optional |
| 18 | 18 | private ?Projection $projection; // json:projection Optional |
| @@ -20,13 +20,13 @@ class TopLevel { | ||
| 20 | 20 | private TitleParams|string|null $title; // json:title Optional |
| 21 | 21 | private ?array $transform; // json:transform Optional |
| 22 | 22 | private ?float $width; // json:width Optional |
| 23 | - private ?array $layer; // json:layer Optional | |
| 23 | + private array $layer; // json:layer Required | |
| 24 | 24 | private ?Resolve $resolve; // json:resolve Optional |
| 25 | - private ?FacetMapping $facet; // json:facet Optional | |
| 26 | - private ?Spec $spec; // json:spec Optional | |
| 27 | - private ?Repeat $repeat; // json:repeat Optional | |
| 28 | - private ?array $vconcat; // json:vconcat Optional | |
| 29 | - private ?array $hconcat; // json:hconcat Optional | |
| 25 | + private FacetMapping $facet; // json:facet Required | |
| 26 | + private Spec $spec; // json:spec Required | |
| 27 | + private Repeat $repeat; // json:repeat Required | |
| 28 | + private array $vconcat; // json:vconcat Required | |
| 29 | + private array $hconcat; // json:hconcat Required | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @param string|null $schema |
| @@ -35,9 +35,9 @@ class TopLevel { | ||
| 35 | 35 | * @param Config|null $config |
| 36 | 36 | * @param Data|null $data |
| 37 | 37 | * @param string|null $description |
| 38 | - * @param EncodingWithFacet|null $encoding | |
| 38 | + * @param EncodingWithFacet $encoding | |
| 39 | 39 | * @param float|null $height |
| 40 | - * @param MarkDef|Mark|null $mark | |
| 40 | + * @param MarkDef|Mark $mark | |
| 41 | 41 | * @param string|null $name |
| 42 | 42 | * @param Padding|float|null $padding |
| 43 | 43 | * @param Projection|null $projection |
| @@ -45,15 +45,15 @@ class TopLevel { | ||
| 45 | 45 | * @param TitleParams|string|null $title |
| 46 | 46 | * @param array|null $transform |
| 47 | 47 | * @param float|null $width |
| 48 | - * @param array|null $layer | |
| 48 | + * @param array $layer | |
| 49 | 49 | * @param Resolve|null $resolve |
| 50 | - * @param FacetMapping|null $facet | |
| 51 | - * @param Spec|null $spec | |
| 52 | - * @param Repeat|null $repeat | |
| 53 | - * @param array|null $vconcat | |
| 54 | - * @param array|null $hconcat | |
| 50 | + * @param FacetMapping $facet | |
| 51 | + * @param Spec $spec | |
| 52 | + * @param Repeat $repeat | |
| 53 | + * @param array $vconcat | |
| 54 | + * @param array $hconcat | |
| 55 | 55 | */ |
| 56 | - public function __construct(?string $schema, AutoSizeParams|AutosizeType|null $autosize, ?string $background, ?Config $config, ?Data $data, ?string $description, ?EncodingWithFacet $encoding, ?float $height, MarkDef|Mark|null $mark, ?string $name, Padding|float|null $padding, ?Projection $projection, ?stdClass $selection, TitleParams|string|null $title, ?array $transform, ?float $width, ?array $layer, ?Resolve $resolve, ?FacetMapping $facet, ?Spec $spec, ?Repeat $repeat, ?array $vconcat, ?array $hconcat) { | |
| 56 | + public function __construct(?string $schema, AutoSizeParams|AutosizeType|null $autosize, ?string $background, ?Config $config, ?Data $data, ?string $description, EncodingWithFacet $encoding, ?float $height, MarkDef|Mark $mark, ?string $name, Padding|float|null $padding, ?Projection $projection, ?stdClass $selection, TitleParams|string|null $title, ?array $transform, ?float $width, array $layer, ?Resolve $resolve, FacetMapping $facet, Spec $spec, Repeat $repeat, array $vconcat, array $hconcat) { | |
| 57 | 57 | $this->schema = $schema; |
| 58 | 58 | $this->autosize = $autosize; |
| 59 | 59 | $this->background = $background; |
| @@ -563,31 +563,23 @@ class TopLevel { | ||
| 563 | 563 | /** |
| 564 | 564 | * A key-value mapping between encoding channels and definition of fields. |
| 565 | 565 | * |
| 566 | - * @param ?stdClass $value | |
| 566 | + * @param stdClass $value | |
| 567 | 567 | * @throws Exception |
| 568 | - * @return ?EncodingWithFacet | |
| 568 | + * @return EncodingWithFacet | |
| 569 | 569 | */ |
| 570 | - public static function fromEncoding(?stdClass $value): ?EncodingWithFacet { | |
| 571 | - if (!is_null($value)) { | |
| 572 | - return EncodingWithFacet::from($value); /*class*/ | |
| 573 | - } else { | |
| 574 | - return null; | |
| 575 | - } | |
| 570 | + public static function fromEncoding(stdClass $value): EncodingWithFacet { | |
| 571 | + return EncodingWithFacet::from($value); /*class*/ | |
| 576 | 572 | } |
| 577 | 573 | |
| 578 | 574 | /** |
| 579 | 575 | * A key-value mapping between encoding channels and definition of fields. |
| 580 | 576 | * |
| 581 | 577 | * @throws Exception |
| 582 | - * @return ?stdClass | |
| 578 | + * @return stdClass | |
| 583 | 579 | */ |
| 584 | - public function toEncoding(): ?stdClass { | |
| 580 | + public function toEncoding(): stdClass { | |
| 585 | 581 | if (TopLevel::validateEncoding($this->encoding)) { |
| 586 | - if (!is_null($this->encoding)) { | |
| 587 | - return $this->encoding->to(); /*class*/ | |
| 588 | - } else { | |
| 589 | - return null; | |
| 590 | - } | |
| 582 | + return $this->encoding->to(); /*class*/ | |
| 591 | 583 | } |
| 592 | 584 | throw new Exception('never get to this TopLevel::encoding'); |
| 593 | 585 | } |
| @@ -595,14 +587,12 @@ class TopLevel { | ||
| 595 | 587 | /** |
| 596 | 588 | * A key-value mapping between encoding channels and definition of fields. |
| 597 | 589 | * |
| 598 | - * @param EncodingWithFacet|null | |
| 590 | + * @param EncodingWithFacet | |
| 599 | 591 | * @return bool |
| 600 | 592 | * @throws Exception |
| 601 | 593 | */ |
| 602 | - public static function validateEncoding(?EncodingWithFacet $value): bool { | |
| 603 | - if (!is_null($value)) { | |
| 604 | - $value->validate(); | |
| 605 | - } | |
| 594 | + public static function validateEncoding(EncodingWithFacet $value): bool { | |
| 595 | + $value->validate(); | |
| 606 | 596 | return true; |
| 607 | 597 | } |
| 608 | 598 | |
| @@ -610,9 +600,9 @@ class TopLevel { | ||
| 610 | 600 | * A key-value mapping between encoding channels and definition of fields. |
| 611 | 601 | * |
| 612 | 602 | * @throws Exception |
| 613 | - * @return ?EncodingWithFacet | |
| 603 | + * @return EncodingWithFacet | |
| 614 | 604 | */ |
| 615 | - public function getEncoding(): ?EncodingWithFacet { | |
| 605 | + public function getEncoding(): EncodingWithFacet { | |
| 616 | 606 | if (TopLevel::validateEncoding($this->encoding)) { |
| 617 | 607 | return $this->encoding; |
| 618 | 608 | } |
| @@ -622,9 +612,9 @@ class TopLevel { | ||
| 622 | 612 | /** |
| 623 | 613 | * A key-value mapping between encoding channels and definition of fields. |
| 624 | 614 | * |
| 625 | - * @return ?EncodingWithFacet | |
| 615 | + * @return EncodingWithFacet | |
| 626 | 616 | */ |
| 627 | - public static function sampleEncoding(): ?EncodingWithFacet { | |
| 617 | + public static function sampleEncoding(): EncodingWithFacet { | |
| 628 | 618 | return EncodingWithFacet::sample(); /*37:encoding*/ |
| 629 | 619 | } |
| 630 | 620 | |
| @@ -781,14 +771,12 @@ class TopLevel { | ||
| 781 | 771 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 782 | 772 | * object](mark.html#mark-def). |
| 783 | 773 | * |
| 784 | - * @param stdClass|string|null $value | |
| 774 | + * @param stdClass|string $value | |
| 785 | 775 | * @throws Exception |
| 786 | - * @return MarkDef|Mark|null | |
| 776 | + * @return MarkDef|Mark | |
| 787 | 777 | */ |
| 788 | - public static function fromMark(stdClass|string|null $value): MarkDef|Mark|null { | |
| 789 | - if (is_null($value)) { | |
| 790 | - return $value; /*null*/ | |
| 791 | - } elseif (is_object($value)) { | |
| 778 | + public static function fromMark(stdClass|string $value): MarkDef|Mark { | |
| 779 | + if (is_object($value)) { | |
| 792 | 780 | return MarkDef::from($value); /*class*/ |
| 793 | 781 | } elseif (is_string($value) && in_array($value, ['area', 'bar', 'line', 'point', 'text', 'tick', 'rect', 'rule', 'circle', 'square', 'geoshape'], true)) { |
| 794 | 782 | return Mark::from($value); /*enum*/ |
| @@ -804,13 +792,11 @@ class TopLevel { | ||
| 804 | 792 | * object](mark.html#mark-def). |
| 805 | 793 | * |
| 806 | 794 | * @throws Exception |
| 807 | - * @return stdClass|string|null | |
| 795 | + * @return stdClass|string | |
| 808 | 796 | */ |
| 809 | - public function toMark(): stdClass|string|null { | |
| 797 | + public function toMark(): stdClass|string { | |
| 810 | 798 | if (TopLevel::validateMark($this->mark)) { |
| 811 | - if (is_null($this->mark)) { | |
| 812 | - return $this->mark; /*null*/ | |
| 813 | - } elseif ($this->mark instanceof MarkDef) { | |
| 799 | + if ($this->mark instanceof MarkDef) { | |
| 814 | 800 | return $this->mark->to(); /*class*/ |
| 815 | 801 | } elseif ($this->mark instanceof Mark) { |
| 816 | 802 | return Mark::to($this->mark); /*enum*/ |
| @@ -827,16 +813,12 @@ class TopLevel { | ||
| 827 | 813 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 828 | 814 | * object](mark.html#mark-def). |
| 829 | 815 | * |
| 830 | - * @param MarkDef|Mark|null | |
| 816 | + * @param MarkDef|Mark | |
| 831 | 817 | * @return bool |
| 832 | 818 | * @throws Exception |
| 833 | 819 | */ |
| 834 | - public static function validateMark(MarkDef|Mark|null $value): bool { | |
| 835 | - if (is_null($value)) { | |
| 836 | - if (!is_null($value)) { | |
| 837 | - throw new Exception("Attribute Error:TopLevel::mark"); | |
| 838 | - } | |
| 839 | - } elseif ($value instanceof MarkDef) { | |
| 820 | + public static function validateMark(MarkDef|Mark $value): bool { | |
| 821 | + if ($value instanceof MarkDef) { | |
| 840 | 822 | $value->validate(); |
| 841 | 823 | } elseif ($value instanceof Mark) { |
| 842 | 824 | Mark::to($value); |
| @@ -853,9 +835,9 @@ class TopLevel { | ||
| 853 | 835 | * object](mark.html#mark-def). |
| 854 | 836 | * |
| 855 | 837 | * @throws Exception |
| 856 | - * @return MarkDef|Mark|null | |
| 838 | + * @return MarkDef|Mark | |
| 857 | 839 | */ |
| 858 | - public function getMark(): MarkDef|Mark|null { | |
| 840 | + public function getMark(): MarkDef|Mark { | |
| 859 | 841 | if (TopLevel::validateMark($this->mark)) { |
| 860 | 842 | return $this->mark; |
| 861 | 843 | } |
| @@ -868,9 +850,9 @@ class TopLevel { | ||
| 868 | 850 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 869 | 851 | * object](mark.html#mark-def). |
| 870 | 852 | * |
| 871 | - * @return MarkDef|Mark|null | |
| 853 | + * @return MarkDef|Mark | |
| 872 | 854 | */ |
| 873 | - public static function sampleMark(): MarkDef|Mark|null { | |
| 855 | + public static function sampleMark(): MarkDef|Mark { | |
| 874 | 856 | return MarkDef::sample(); /*39:mark*/ |
| 875 | 857 | } |
| 876 | 858 | |
| @@ -1550,18 +1532,14 @@ class TopLevel { | ||
| 1550 | 1532 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 1551 | 1533 | * layering facet specifications is not allowed. |
| 1552 | 1534 | * |
| 1553 | - * @param ?array $value | |
| 1535 | + * @param array $value | |
| 1554 | 1536 | * @throws Exception |
| 1555 | - * @return ?array | |
| 1537 | + * @return array | |
| 1556 | 1538 | */ |
| 1557 | - public static function fromLayer(?array $value): ?array { | |
| 1558 | - if (!is_null($value)) { | |
| 1559 | - return array_map(function ($value) { | |
| 1560 | - return LayerSpec::from($value); /*class*/ | |
| 1561 | - }, $value); | |
| 1562 | - } else { | |
| 1563 | - return null; | |
| 1564 | - } | |
| 1539 | + public static function fromLayer(array $value): array { | |
| 1540 | + return array_map(function ($value) { | |
| 1541 | + return LayerSpec::from($value); /*class*/ | |
| 1542 | + }, $value); | |
| 1565 | 1543 | } |
| 1566 | 1544 | |
| 1567 | 1545 | /** |
| @@ -1571,17 +1549,13 @@ class TopLevel { | ||
| 1571 | 1549 | * layering facet specifications is not allowed. |
| 1572 | 1550 | * |
| 1573 | 1551 | * @throws Exception |
| 1574 | - * @return ?array | |
| 1552 | + * @return array | |
| 1575 | 1553 | */ |
| 1576 | - public function toLayer(): ?array { | |
| 1554 | + public function toLayer(): array { | |
| 1577 | 1555 | if (TopLevel::validateLayer($this->layer)) { |
| 1578 | - if (!is_null($this->layer)) { | |
| 1579 | - return array_map(function ($value) { | |
| 1580 | - return $value->to(); /*class*/ | |
| 1581 | - }, $this->layer); | |
| 1582 | - } else { | |
| 1583 | - return null; | |
| 1584 | - } | |
| 1556 | + return array_map(function ($value) { | |
| 1557 | + return $value->to(); /*class*/ | |
| 1558 | + }, $this->layer); | |
| 1585 | 1559 | } |
| 1586 | 1560 | throw new Exception('never get to this TopLevel::layer'); |
| 1587 | 1561 | } |
| @@ -1592,19 +1566,17 @@ class TopLevel { | ||
| 1592 | 1566 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 1593 | 1567 | * layering facet specifications is not allowed. |
| 1594 | 1568 | * |
| 1595 | - * @param array|null | |
| 1569 | + * @param array | |
| 1596 | 1570 | * @return bool |
| 1597 | 1571 | * @throws Exception |
| 1598 | 1572 | */ |
| 1599 | - public static function validateLayer(?array $value): bool { | |
| 1600 | - if (!is_null($value)) { | |
| 1601 | - if (!is_array($value)) { | |
| 1602 | - throw new Exception("Attribute Error:TopLevel::layer"); | |
| 1603 | - } | |
| 1604 | - array_walk($value, function($value_v) { | |
| 1605 | - $value_v->validate(); | |
| 1606 | - }); | |
| 1573 | + public static function validateLayer(array $value): bool { | |
| 1574 | + if (!is_array($value)) { | |
| 1575 | + throw new Exception("Attribute Error:TopLevel::layer"); | |
| 1607 | 1576 | } |
| 1577 | + array_walk($value, function($value_v) { | |
| 1578 | + $value_v->validate(); | |
| 1579 | + }); | |
| 1608 | 1580 | return true; |
| 1609 | 1581 | } |
| 1610 | 1582 | |
| @@ -1615,9 +1587,9 @@ class TopLevel { | ||
| 1615 | 1587 | * layering facet specifications is not allowed. |
| 1616 | 1588 | * |
| 1617 | 1589 | * @throws Exception |
| 1618 | - * @return ?array | |
| 1590 | + * @return array | |
| 1619 | 1591 | */ |
| 1620 | - public function getLayer(): ?array { | |
| 1592 | + public function getLayer(): array { | |
| 1621 | 1593 | if (TopLevel::validateLayer($this->layer)) { |
| 1622 | 1594 | return $this->layer; |
| 1623 | 1595 | } |
| @@ -1630,9 +1602,9 @@ class TopLevel { | ||
| 1630 | 1602 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 1631 | 1603 | * layering facet specifications is not allowed. |
| 1632 | 1604 | * |
| 1633 | - * @return ?array | |
| 1605 | + * @return array | |
| 1634 | 1606 | */ |
| 1635 | - public static function sampleLayer(): ?array { | |
| 1607 | + public static function sampleLayer(): array { | |
| 1636 | 1608 | return array( |
| 1637 | 1609 | LayerSpec::sample() /*47:*/ |
| 1638 | 1610 | ); /* 47:layer*/ |
| @@ -1750,16 +1722,12 @@ class TopLevel { | ||
| 1750 | 1722 | * An object that describes mappings between `row` and `column` channels and their field |
| 1751 | 1723 | * definitions. |
| 1752 | 1724 | * |
| 1753 | - * @param ?stdClass $value | |
| 1725 | + * @param stdClass $value | |
| 1754 | 1726 | * @throws Exception |
| 1755 | - * @return ?FacetMapping | |
| 1727 | + * @return FacetMapping | |
| 1756 | 1728 | */ |
| 1757 | - public static function fromFacet(?stdClass $value): ?FacetMapping { | |
| 1758 | - if (!is_null($value)) { | |
| 1759 | - return FacetMapping::from($value); /*class*/ | |
| 1760 | - } else { | |
| 1761 | - return null; | |
| 1762 | - } | |
| 1729 | + public static function fromFacet(stdClass $value): FacetMapping { | |
| 1730 | + return FacetMapping::from($value); /*class*/ | |
| 1763 | 1731 | } |
| 1764 | 1732 | |
| 1765 | 1733 | /** |
| @@ -1767,15 +1735,11 @@ class TopLevel { | ||
| 1767 | 1735 | * definitions. |
| 1768 | 1736 | * |
| 1769 | 1737 | * @throws Exception |
| 1770 | - * @return ?stdClass | |
| 1738 | + * @return stdClass | |
| 1771 | 1739 | */ |
| 1772 | - public function toFacet(): ?stdClass { | |
| 1740 | + public function toFacet(): stdClass { | |
| 1773 | 1741 | if (TopLevel::validateFacet($this->facet)) { |
| 1774 | - if (!is_null($this->facet)) { | |
| 1775 | - return $this->facet->to(); /*class*/ | |
| 1776 | - } else { | |
| 1777 | - return null; | |
| 1778 | - } | |
| 1742 | + return $this->facet->to(); /*class*/ | |
| 1779 | 1743 | } |
| 1780 | 1744 | throw new Exception('never get to this TopLevel::facet'); |
| 1781 | 1745 | } |
| @@ -1784,14 +1748,12 @@ class TopLevel { | ||
| 1784 | 1748 | * An object that describes mappings between `row` and `column` channels and their field |
| 1785 | 1749 | * definitions. |
| 1786 | 1750 | * |
| 1787 | - * @param FacetMapping|null | |
| 1751 | + * @param FacetMapping | |
| 1788 | 1752 | * @return bool |
| 1789 | 1753 | * @throws Exception |
| 1790 | 1754 | */ |
| 1791 | - public static function validateFacet(?FacetMapping $value): bool { | |
| 1792 | - if (!is_null($value)) { | |
| 1793 | - $value->validate(); | |
| 1794 | - } | |
| 1755 | + public static function validateFacet(FacetMapping $value): bool { | |
| 1756 | + $value->validate(); | |
| 1795 | 1757 | return true; |
| 1796 | 1758 | } |
| 1797 | 1759 | |
| @@ -1800,9 +1762,9 @@ class TopLevel { | ||
| 1800 | 1762 | * definitions. |
| 1801 | 1763 | * |
| 1802 | 1764 | * @throws Exception |
| 1803 | - * @return ?FacetMapping | |
| 1765 | + * @return FacetMapping | |
| 1804 | 1766 | */ |
| 1805 | - public function getFacet(): ?FacetMapping { | |
| 1767 | + public function getFacet(): FacetMapping { | |
| 1806 | 1768 | if (TopLevel::validateFacet($this->facet)) { |
| 1807 | 1769 | return $this->facet; |
| 1808 | 1770 | } |
| @@ -1813,40 +1775,32 @@ class TopLevel { | ||
| 1813 | 1775 | * An object that describes mappings between `row` and `column` channels and their field |
| 1814 | 1776 | * definitions. |
| 1815 | 1777 | * |
| 1816 | - * @return ?FacetMapping | |
| 1778 | + * @return FacetMapping | |
| 1817 | 1779 | */ |
| 1818 | - public static function sampleFacet(): ?FacetMapping { | |
| 1780 | + public static function sampleFacet(): FacetMapping { | |
| 1819 | 1781 | return FacetMapping::sample(); /*49:facet*/ |
| 1820 | 1782 | } |
| 1821 | 1783 | |
| 1822 | 1784 | /** |
| 1823 | 1785 | * A specification of the view that gets faceted. |
| 1824 | 1786 | * |
| 1825 | - * @param ?stdClass $value | |
| 1787 | + * @param stdClass $value | |
| 1826 | 1788 | * @throws Exception |
| 1827 | - * @return ?Spec | |
| 1789 | + * @return Spec | |
| 1828 | 1790 | */ |
| 1829 | - public static function fromSpec(?stdClass $value): ?Spec { | |
| 1830 | - if (!is_null($value)) { | |
| 1831 | - return Spec::from($value); /*class*/ | |
| 1832 | - } else { | |
| 1833 | - return null; | |
| 1834 | - } | |
| 1791 | + public static function fromSpec(stdClass $value): Spec { | |
| 1792 | + return Spec::from($value); /*class*/ | |
| 1835 | 1793 | } |
| 1836 | 1794 | |
| 1837 | 1795 | /** |
| 1838 | 1796 | * A specification of the view that gets faceted. |
| 1839 | 1797 | * |
| 1840 | 1798 | * @throws Exception |
| 1841 | - * @return ?stdClass | |
| 1799 | + * @return stdClass | |
| 1842 | 1800 | */ |
| 1843 | - public function toSpec(): ?stdClass { | |
| 1801 | + public function toSpec(): stdClass { | |
| 1844 | 1802 | if (TopLevel::validateSpec($this->spec)) { |
| 1845 | - if (!is_null($this->spec)) { | |
| 1846 | - return $this->spec->to(); /*class*/ | |
| 1847 | - } else { | |
| 1848 | - return null; | |
| 1849 | - } | |
| 1803 | + return $this->spec->to(); /*class*/ | |
| 1850 | 1804 | } |
| 1851 | 1805 | throw new Exception('never get to this TopLevel::spec'); |
| 1852 | 1806 | } |
| @@ -1854,14 +1808,12 @@ class TopLevel { | ||
| 1854 | 1808 | /** |
| 1855 | 1809 | * A specification of the view that gets faceted. |
| 1856 | 1810 | * |
| 1857 | - * @param Spec|null | |
| 1811 | + * @param Spec | |
| 1858 | 1812 | * @return bool |
| 1859 | 1813 | * @throws Exception |
| 1860 | 1814 | */ |
| 1861 | - public static function validateSpec(?Spec $value): bool { | |
| 1862 | - if (!is_null($value)) { | |
| 1863 | - $value->validate(); | |
| 1864 | - } | |
| 1815 | + public static function validateSpec(Spec $value): bool { | |
| 1816 | + $value->validate(); | |
| 1865 | 1817 | return true; |
| 1866 | 1818 | } |
| 1867 | 1819 | |
| @@ -1869,9 +1821,9 @@ class TopLevel { | ||
| 1869 | 1821 | * A specification of the view that gets faceted. |
| 1870 | 1822 | * |
| 1871 | 1823 | * @throws Exception |
| 1872 | - * @return ?Spec | |
| 1824 | + * @return Spec | |
| 1873 | 1825 | */ |
| 1874 | - public function getSpec(): ?Spec { | |
| 1826 | + public function getSpec(): Spec { | |
| 1875 | 1827 | if (TopLevel::validateSpec($this->spec)) { |
| 1876 | 1828 | return $this->spec; |
| 1877 | 1829 | } |
| @@ -1881,9 +1833,9 @@ class TopLevel { | ||
| 1881 | 1833 | /** |
| 1882 | 1834 | * A specification of the view that gets faceted. |
| 1883 | 1835 | * |
| 1884 | - * @return ?Spec | |
| 1836 | + * @return Spec | |
| 1885 | 1837 | */ |
| 1886 | - public static function sampleSpec(): ?Spec { | |
| 1838 | + public static function sampleSpec(): Spec { | |
| 1887 | 1839 | return Spec::sample(); /*50:spec*/ |
| 1888 | 1840 | } |
| 1889 | 1841 | |
| @@ -1891,16 +1843,12 @@ class TopLevel { | ||
| 1891 | 1843 | * An object that describes what fields should be repeated into views that are laid out as a |
| 1892 | 1844 | * `row` or `column`. |
| 1893 | 1845 | * |
| 1894 | - * @param ?stdClass $value | |
| 1846 | + * @param stdClass $value | |
| 1895 | 1847 | * @throws Exception |
| 1896 | - * @return ?Repeat | |
| 1848 | + * @return Repeat | |
| 1897 | 1849 | */ |
| 1898 | - public static function fromRepeat(?stdClass $value): ?Repeat { | |
| 1899 | - if (!is_null($value)) { | |
| 1900 | - return Repeat::from($value); /*class*/ | |
| 1901 | - } else { | |
| 1902 | - return null; | |
| 1903 | - } | |
| 1850 | + public static function fromRepeat(stdClass $value): Repeat { | |
| 1851 | + return Repeat::from($value); /*class*/ | |
| 1904 | 1852 | } |
| 1905 | 1853 | |
| 1906 | 1854 | /** |
| @@ -1908,15 +1856,11 @@ class TopLevel { | ||
| 1908 | 1856 | * `row` or `column`. |
| 1909 | 1857 | * |
| 1910 | 1858 | * @throws Exception |
| 1911 | - * @return ?stdClass | |
| 1859 | + * @return stdClass | |
| 1912 | 1860 | */ |
| 1913 | - public function toRepeat(): ?stdClass { | |
| 1861 | + public function toRepeat(): stdClass { | |
| 1914 | 1862 | if (TopLevel::validateRepeat($this->repeat)) { |
| 1915 | - if (!is_null($this->repeat)) { | |
| 1916 | - return $this->repeat->to(); /*class*/ | |
| 1917 | - } else { | |
| 1918 | - return null; | |
| 1919 | - } | |
| 1863 | + return $this->repeat->to(); /*class*/ | |
| 1920 | 1864 | } |
| 1921 | 1865 | throw new Exception('never get to this TopLevel::repeat'); |
| 1922 | 1866 | } |
| @@ -1925,14 +1869,12 @@ class TopLevel { | ||
| 1925 | 1869 | * An object that describes what fields should be repeated into views that are laid out as a |
| 1926 | 1870 | * `row` or `column`. |
| 1927 | 1871 | * |
| 1928 | - * @param Repeat|null | |
| 1872 | + * @param Repeat | |
| 1929 | 1873 | * @return bool |
| 1930 | 1874 | * @throws Exception |
| 1931 | 1875 | */ |
| 1932 | - public static function validateRepeat(?Repeat $value): bool { | |
| 1933 | - if (!is_null($value)) { | |
| 1934 | - $value->validate(); | |
| 1935 | - } | |
| 1876 | + public static function validateRepeat(Repeat $value): bool { | |
| 1877 | + $value->validate(); | |
| 1936 | 1878 | return true; |
| 1937 | 1879 | } |
| 1938 | 1880 | |
| @@ -1941,9 +1883,9 @@ class TopLevel { | ||
| 1941 | 1883 | * `row` or `column`. |
| 1942 | 1884 | * |
| 1943 | 1885 | * @throws Exception |
| 1944 | - * @return ?Repeat | |
| 1886 | + * @return Repeat | |
| 1945 | 1887 | */ |
| 1946 | - public function getRepeat(): ?Repeat { | |
| 1888 | + public function getRepeat(): Repeat { | |
| 1947 | 1889 | if (TopLevel::validateRepeat($this->repeat)) { |
| 1948 | 1890 | return $this->repeat; |
| 1949 | 1891 | } |
| @@ -1954,44 +1896,36 @@ class TopLevel { | ||
| 1954 | 1896 | * An object that describes what fields should be repeated into views that are laid out as a |
| 1955 | 1897 | * `row` or `column`. |
| 1956 | 1898 | * |
| 1957 | - * @return ?Repeat | |
| 1899 | + * @return Repeat | |
| 1958 | 1900 | */ |
| 1959 | - public static function sampleRepeat(): ?Repeat { | |
| 1901 | + public static function sampleRepeat(): Repeat { | |
| 1960 | 1902 | return Repeat::sample(); /*51:repeat*/ |
| 1961 | 1903 | } |
| 1962 | 1904 | |
| 1963 | 1905 | /** |
| 1964 | 1906 | * A list of views that should be concatenated and put into a column. |
| 1965 | 1907 | * |
| 1966 | - * @param ?array $value | |
| 1908 | + * @param array $value | |
| 1967 | 1909 | * @throws Exception |
| 1968 | - * @return ?array | |
| 1910 | + * @return array | |
| 1969 | 1911 | */ |
| 1970 | - public static function fromVconcat(?array $value): ?array { | |
| 1971 | - if (!is_null($value)) { | |
| 1972 | - return array_map(function ($value) { | |
| 1973 | - return Spec::from($value); /*class*/ | |
| 1974 | - }, $value); | |
| 1975 | - } else { | |
| 1976 | - return null; | |
| 1977 | - } | |
| 1912 | + public static function fromVconcat(array $value): array { | |
| 1913 | + return array_map(function ($value) { | |
| 1914 | + return Spec::from($value); /*class*/ | |
| 1915 | + }, $value); | |
| 1978 | 1916 | } |
| 1979 | 1917 | |
| 1980 | 1918 | /** |
| 1981 | 1919 | * A list of views that should be concatenated and put into a column. |
| 1982 | 1920 | * |
| 1983 | 1921 | * @throws Exception |
| 1984 | - * @return ?array | |
| 1922 | + * @return array | |
| 1985 | 1923 | */ |
| 1986 | - public function toVconcat(): ?array { | |
| 1924 | + public function toVconcat(): array { | |
| 1987 | 1925 | if (TopLevel::validateVconcat($this->vconcat)) { |
| 1988 | - if (!is_null($this->vconcat)) { | |
| 1989 | - return array_map(function ($value) { | |
| 1990 | - return $value->to(); /*class*/ | |
| 1991 | - }, $this->vconcat); | |
| 1992 | - } else { | |
| 1993 | - return null; | |
| 1994 | - } | |
| 1926 | + return array_map(function ($value) { | |
| 1927 | + return $value->to(); /*class*/ | |
| 1928 | + }, $this->vconcat); | |
| 1995 | 1929 | } |
| 1996 | 1930 | throw new Exception('never get to this TopLevel::vconcat'); |
| 1997 | 1931 | } |
| @@ -1999,19 +1933,17 @@ class TopLevel { | ||
| 1999 | 1933 | /** |
| 2000 | 1934 | * A list of views that should be concatenated and put into a column. |
| 2001 | 1935 | * |
| 2002 | - * @param array|null | |
| 1936 | + * @param array | |
| 2003 | 1937 | * @return bool |
| 2004 | 1938 | * @throws Exception |
| 2005 | 1939 | */ |
| 2006 | - public static function validateVconcat(?array $value): bool { | |
| 2007 | - if (!is_null($value)) { | |
| 2008 | - if (!is_array($value)) { | |
| 2009 | - throw new Exception("Attribute Error:TopLevel::vconcat"); | |
| 2010 | - } | |
| 2011 | - array_walk($value, function($value_v) { | |
| 2012 | - $value_v->validate(); | |
| 2013 | - }); | |
| 1940 | + public static function validateVconcat(array $value): bool { | |
| 1941 | + if (!is_array($value)) { | |
| 1942 | + throw new Exception("Attribute Error:TopLevel::vconcat"); | |
| 2014 | 1943 | } |
| 1944 | + array_walk($value, function($value_v) { | |
| 1945 | + $value_v->validate(); | |
| 1946 | + }); | |
| 2015 | 1947 | return true; |
| 2016 | 1948 | } |
| 2017 | 1949 | |
| @@ -2019,9 +1951,9 @@ class TopLevel { | ||
| 2019 | 1951 | * A list of views that should be concatenated and put into a column. |
| 2020 | 1952 | * |
| 2021 | 1953 | * @throws Exception |
| 2022 | - * @return ?array | |
| 1954 | + * @return array | |
| 2023 | 1955 | */ |
| 2024 | - public function getVconcat(): ?array { | |
| 1956 | + public function getVconcat(): array { | |
| 2025 | 1957 | if (TopLevel::validateVconcat($this->vconcat)) { |
| 2026 | 1958 | return $this->vconcat; |
| 2027 | 1959 | } |
| @@ -2031,9 +1963,9 @@ class TopLevel { | ||
| 2031 | 1963 | /** |
| 2032 | 1964 | * A list of views that should be concatenated and put into a column. |
| 2033 | 1965 | * |
| 2034 | - * @return ?array | |
| 1966 | + * @return array | |
| 2035 | 1967 | */ |
| 2036 | - public static function sampleVconcat(): ?array { | |
| 1968 | + public static function sampleVconcat(): array { | |
| 2037 | 1969 | return array( |
| 2038 | 1970 | Spec::sample() /*52:*/ |
| 2039 | 1971 | ); /* 52:vconcat*/ |
| @@ -2042,35 +1974,27 @@ class TopLevel { | ||
| 2042 | 1974 | /** |
| 2043 | 1975 | * A list of views that should be concatenated and put into a row. |
| 2044 | 1976 | * |
| 2045 | - * @param ?array $value | |
| 1977 | + * @param array $value | |
| 2046 | 1978 | * @throws Exception |
| 2047 | - * @return ?array | |
| 1979 | + * @return array | |
| 2048 | 1980 | */ |
| 2049 | - public static function fromHconcat(?array $value): ?array { | |
| 2050 | - if (!is_null($value)) { | |
| 2051 | - return array_map(function ($value) { | |
| 2052 | - return Spec::from($value); /*class*/ | |
| 2053 | - }, $value); | |
| 2054 | - } else { | |
| 2055 | - return null; | |
| 2056 | - } | |
| 1981 | + public static function fromHconcat(array $value): array { | |
| 1982 | + return array_map(function ($value) { | |
| 1983 | + return Spec::from($value); /*class*/ | |
| 1984 | + }, $value); | |
| 2057 | 1985 | } |
| 2058 | 1986 | |
| 2059 | 1987 | /** |
| 2060 | 1988 | * A list of views that should be concatenated and put into a row. |
| 2061 | 1989 | * |
| 2062 | 1990 | * @throws Exception |
| 2063 | - * @return ?array | |
| 1991 | + * @return array | |
| 2064 | 1992 | */ |
| 2065 | - public function toHconcat(): ?array { | |
| 1993 | + public function toHconcat(): array { | |
| 2066 | 1994 | if (TopLevel::validateHconcat($this->hconcat)) { |
| 2067 | - if (!is_null($this->hconcat)) { | |
| 2068 | - return array_map(function ($value) { | |
| 2069 | - return $value->to(); /*class*/ | |
| 2070 | - }, $this->hconcat); | |
| 2071 | - } else { | |
| 2072 | - return null; | |
| 2073 | - } | |
| 1995 | + return array_map(function ($value) { | |
| 1996 | + return $value->to(); /*class*/ | |
| 1997 | + }, $this->hconcat); | |
| 2074 | 1998 | } |
| 2075 | 1999 | throw new Exception('never get to this TopLevel::hconcat'); |
| 2076 | 2000 | } |
| @@ -2078,19 +2002,17 @@ class TopLevel { | ||
| 2078 | 2002 | /** |
| 2079 | 2003 | * A list of views that should be concatenated and put into a row. |
| 2080 | 2004 | * |
| 2081 | - * @param array|null | |
| 2005 | + * @param array | |
| 2082 | 2006 | * @return bool |
| 2083 | 2007 | * @throws Exception |
| 2084 | 2008 | */ |
| 2085 | - public static function validateHconcat(?array $value): bool { | |
| 2086 | - if (!is_null($value)) { | |
| 2087 | - if (!is_array($value)) { | |
| 2088 | - throw new Exception("Attribute Error:TopLevel::hconcat"); | |
| 2089 | - } | |
| 2090 | - array_walk($value, function($value_v) { | |
| 2091 | - $value_v->validate(); | |
| 2092 | - }); | |
| 2009 | + public static function validateHconcat(array $value): bool { | |
| 2010 | + if (!is_array($value)) { | |
| 2011 | + throw new Exception("Attribute Error:TopLevel::hconcat"); | |
| 2093 | 2012 | } |
| 2013 | + array_walk($value, function($value_v) { | |
| 2014 | + $value_v->validate(); | |
| 2015 | + }); | |
| 2094 | 2016 | return true; |
| 2095 | 2017 | } |
| 2096 | 2018 | |
| @@ -2098,9 +2020,9 @@ class TopLevel { | ||
| 2098 | 2020 | * A list of views that should be concatenated and put into a row. |
| 2099 | 2021 | * |
| 2100 | 2022 | * @throws Exception |
| 2101 | - * @return ?array | |
| 2023 | + * @return array | |
| 2102 | 2024 | */ |
| 2103 | - public function getHconcat(): ?array { | |
| 2025 | + public function getHconcat(): array { | |
| 2104 | 2026 | if (TopLevel::validateHconcat($this->hconcat)) { |
| 2105 | 2027 | return $this->hconcat; |
| 2106 | 2028 | } |
| @@ -2110,9 +2032,9 @@ class TopLevel { | ||
| 2110 | 2032 | /** |
| 2111 | 2033 | * A list of views that should be concatenated and put into a row. |
| 2112 | 2034 | * |
| 2113 | - * @return ?array | |
| 2035 | + * @return array | |
| 2114 | 2036 | */ |
| 2115 | - public static function sampleHconcat(): ?array { | |
| 2037 | + public static function sampleHconcat(): array { | |
| 2116 | 2038 | return array( |
| 2117 | 2039 | Spec::sample() /*53:*/ |
| 2118 | 2040 | ); /* 53:hconcat*/ |
| @@ -23081,16 +23003,16 @@ VGProjectionType::init(); | ||
| 23081 | 23003 | class VGScheme { |
| 23082 | 23004 | private ?float $count; // json:count Optional |
| 23083 | 23005 | private ?array $extent; // json:extent Optional |
| 23084 | - private ?string $scheme; // json:scheme Optional | |
| 23006 | + private string $scheme; // json:scheme Required | |
| 23085 | 23007 | private ?float $step; // json:step Optional |
| 23086 | 23008 | |
| 23087 | 23009 | /** |
| 23088 | 23010 | * @param float|null $count |
| 23089 | 23011 | * @param array|null $extent |
| 23090 | - * @param string|null $scheme | |
| 23012 | + * @param string $scheme | |
| 23091 | 23013 | * @param float|null $step |
| 23092 | 23014 | */ |
| 23093 | - public function __construct(?float $count, ?array $extent, ?string $scheme, ?float $step) { | |
| 23015 | + public function __construct(?float $count, ?array $extent, string $scheme, ?float $step) { | |
| 23094 | 23016 | $this->count = $count; |
| 23095 | 23017 | $this->extent = $extent; |
| 23096 | 23018 | $this->scheme = $scheme; |
| @@ -23226,49 +23148,39 @@ class VGScheme { | ||
| 23226 | 23148 | } |
| 23227 | 23149 | |
| 23228 | 23150 | /** |
| 23229 | - * @param ?string $value | |
| 23151 | + * @param string $value | |
| 23230 | 23152 | * @throws Exception |
| 23231 | - * @return ?string | |
| 23153 | + * @return string | |
| 23232 | 23154 | */ |
| 23233 | - public static function fromScheme(?string $value): ?string { | |
| 23234 | - if (!is_null($value)) { | |
| 23235 | - return $value; /*string*/ | |
| 23236 | - } else { | |
| 23237 | - return null; | |
| 23238 | - } | |
| 23155 | + public static function fromScheme(string $value): string { | |
| 23156 | + return $value; /*string*/ | |
| 23239 | 23157 | } |
| 23240 | 23158 | |
| 23241 | 23159 | /** |
| 23242 | 23160 | * @throws Exception |
| 23243 | - * @return ?string | |
| 23161 | + * @return string | |
| 23244 | 23162 | */ |
| 23245 | - public function toScheme(): ?string { | |
| 23163 | + public function toScheme(): string { | |
| 23246 | 23164 | if (VGScheme::validateScheme($this->scheme)) { |
| 23247 | - if (!is_null($this->scheme)) { | |
| 23248 | - return $this->scheme; /*string*/ | |
| 23249 | - } else { | |
| 23250 | - return null; | |
| 23251 | - } | |
| 23165 | + return $this->scheme; /*string*/ | |
| 23252 | 23166 | } |
| 23253 | 23167 | throw new Exception('never get to this VGScheme::scheme'); |
| 23254 | 23168 | } |
| 23255 | 23169 | |
| 23256 | 23170 | /** |
| 23257 | - * @param string|null | |
| 23171 | + * @param string | |
| 23258 | 23172 | * @return bool |
| 23259 | 23173 | * @throws Exception |
| 23260 | 23174 | */ |
| 23261 | - public static function validateScheme(?string $value): bool { | |
| 23262 | - if (!is_null($value)) { | |
| 23263 | - } | |
| 23175 | + public static function validateScheme(string $value): bool { | |
| 23264 | 23176 | return true; |
| 23265 | 23177 | } |
| 23266 | 23178 | |
| 23267 | 23179 | /** |
| 23268 | 23180 | * @throws Exception |
| 23269 | - * @return ?string | |
| 23181 | + * @return string | |
| 23270 | 23182 | */ |
| 23271 | - public function getScheme(): ?string { | |
| 23183 | + public function getScheme(): string { | |
| 23272 | 23184 | if (VGScheme::validateScheme($this->scheme)) { |
| 23273 | 23185 | return $this->scheme; |
| 23274 | 23186 | } |
| @@ -23276,9 +23188,9 @@ class VGScheme { | ||
| 23276 | 23188 | } |
| 23277 | 23189 | |
| 23278 | 23190 | /** |
| 23279 | - * @return ?string | |
| 23191 | + * @return string | |
| 23280 | 23192 | */ |
| 23281 | - public static function sampleScheme(): ?string { | |
| 23193 | + public static function sampleScheme(): string { | |
| 23282 | 23194 | return 'VGScheme::scheme::33'; /*33:scheme*/ |
| 23283 | 23195 | } |
| 23284 | 23196 | |
| @@ -28552,7 +28464,7 @@ class SingleSelectionConfig { | ||
| 28552 | 28464 | class VGBinding { |
| 28553 | 28465 | private ?string $element; // json:element Optional |
| 28554 | 28466 | private string $input; // json:input Required |
| 28555 | - private ?array $options; // json:options Optional | |
| 28467 | + private array $options; // json:options Required | |
| 28556 | 28468 | private ?float $max; // json:max Optional |
| 28557 | 28469 | private ?float $min; // json:min Optional |
| 28558 | 28470 | private ?float $step; // json:step Optional |
| @@ -28560,12 +28472,12 @@ class VGBinding { | ||
| 28560 | 28472 | /** |
| 28561 | 28473 | * @param string|null $element |
| 28562 | 28474 | * @param string $input |
| 28563 | - * @param array|null $options | |
| 28475 | + * @param array $options | |
| 28564 | 28476 | * @param float|null $max |
| 28565 | 28477 | * @param float|null $min |
| 28566 | 28478 | * @param float|null $step |
| 28567 | 28479 | */ |
| 28568 | - public function __construct(?string $element, string $input, ?array $options, ?float $max, ?float $min, ?float $step) { | |
| 28480 | + public function __construct(?string $element, string $input, array $options, ?float $max, ?float $min, ?float $step) { | |
| 28569 | 28481 | $this->element = $element; |
| 28570 | 28482 | $this->input = $input; |
| 28571 | 28483 | $this->options = $options; |
| @@ -28679,61 +28591,51 @@ class VGBinding { | ||
| 28679 | 28591 | } |
| 28680 | 28592 | |
| 28681 | 28593 | /** |
| 28682 | - * @param ?array $value | |
| 28594 | + * @param array $value | |
| 28683 | 28595 | * @throws Exception |
| 28684 | - * @return ?array | |
| 28596 | + * @return array | |
| 28685 | 28597 | */ |
| 28686 | - public static function fromOptions(?array $value): ?array { | |
| 28687 | - if (!is_null($value)) { | |
| 28688 | - return array_map(function ($value) { | |
| 28689 | - return $value; /*string*/ | |
| 28690 | - }, $value); | |
| 28691 | - } else { | |
| 28692 | - return null; | |
| 28693 | - } | |
| 28598 | + public static function fromOptions(array $value): array { | |
| 28599 | + return array_map(function ($value) { | |
| 28600 | + return $value; /*string*/ | |
| 28601 | + }, $value); | |
| 28694 | 28602 | } |
| 28695 | 28603 | |
| 28696 | 28604 | /** |
| 28697 | 28605 | * @throws Exception |
| 28698 | - * @return ?array | |
| 28606 | + * @return array | |
| 28699 | 28607 | */ |
| 28700 | - public function toOptions(): ?array { | |
| 28608 | + public function toOptions(): array { | |
| 28701 | 28609 | if (VGBinding::validateOptions($this->options)) { |
| 28702 | - if (!is_null($this->options)) { | |
| 28703 | - return array_map(function ($value) { | |
| 28704 | - return $value; /*string*/ | |
| 28705 | - }, $this->options); | |
| 28706 | - } else { | |
| 28707 | - return null; | |
| 28708 | - } | |
| 28610 | + return array_map(function ($value) { | |
| 28611 | + return $value; /*string*/ | |
| 28612 | + }, $this->options); | |
| 28709 | 28613 | } |
| 28710 | 28614 | throw new Exception('never get to this VGBinding::options'); |
| 28711 | 28615 | } |
| 28712 | 28616 | |
| 28713 | 28617 | /** |
| 28714 | - * @param array|null | |
| 28618 | + * @param array | |
| 28715 | 28619 | * @return bool |
| 28716 | 28620 | * @throws Exception |
| 28717 | 28621 | */ |
| 28718 | - public static function validateOptions(?array $value): bool { | |
| 28719 | - if (!is_null($value)) { | |
| 28720 | - if (!is_array($value)) { | |
| 28622 | + public static function validateOptions(array $value): bool { | |
| 28623 | + if (!is_array($value)) { | |
| 28624 | + throw new Exception("Attribute Error:VGBinding::options"); | |
| 28625 | + } | |
| 28626 | + array_walk($value, function($value_v) { | |
| 28627 | + if (!is_string($value_v)) { | |
| 28721 | 28628 | throw new Exception("Attribute Error:VGBinding::options"); |
| 28722 | 28629 | } |
| 28723 | - array_walk($value, function($value_v) { | |
| 28724 | - if (!is_string($value_v)) { | |
| 28725 | - throw new Exception("Attribute Error:VGBinding::options"); | |
| 28726 | - } | |
| 28727 | - }); | |
| 28728 | - } | |
| 28630 | + }); | |
| 28729 | 28631 | return true; |
| 28730 | 28632 | } |
| 28731 | 28633 | |
| 28732 | 28634 | /** |
| 28733 | 28635 | * @throws Exception |
| 28734 | - * @return ?array | |
| 28636 | + * @return array | |
| 28735 | 28637 | */ |
| 28736 | - public function getOptions(): ?array { | |
| 28638 | + public function getOptions(): array { | |
| 28737 | 28639 | if (VGBinding::validateOptions($this->options)) { |
| 28738 | 28640 | return $this->options; |
| 28739 | 28641 | } |
| @@ -28741,9 +28643,9 @@ class VGBinding { | ||
| 28741 | 28643 | } |
| 28742 | 28644 | |
| 28743 | 28645 | /** |
| 28744 | - * @return ?array | |
| 28646 | + * @return array | |
| 28745 | 28647 | */ |
| 28746 | - public static function sampleOptions(): ?array { | |
| 28648 | + public static function sampleOptions(): array { | |
| 28747 | 28649 | return array( |
| 28748 | 28650 | 'VGBinding::::33' /*33:*/ |
| 28749 | 28651 | ); /* 33:options*/ |
| @@ -38845,17 +38747,17 @@ class ViewConfig { | ||
| 38845 | 38747 | |
| 38846 | 38748 | class Data { |
| 38847 | 38749 | private ?DataFormat $format; // json:format Optional |
| 38848 | - private ?string $url; // json:url Optional | |
| 38849 | - private stdClass|array|string|null $values; // json:values Optional | |
| 38850 | - private ?string $name; // json:name Optional | |
| 38750 | + private string $url; // json:url Required | |
| 38751 | + private stdClass|array|string $values; // json:values Required | |
| 38752 | + private string $name; // json:name Required | |
| 38851 | 38753 | |
| 38852 | 38754 | /** |
| 38853 | 38755 | * @param DataFormat|null $format |
| 38854 | - * @param string|null $url | |
| 38855 | - * @param stdClass|array|string|null $values | |
| 38856 | - * @param string|null $name | |
| 38756 | + * @param string $url | |
| 38757 | + * @param stdClass|array|string $values | |
| 38758 | + * @param string $name | |
| 38857 | 38759 | */ |
| 38858 | - public function __construct(?DataFormat $format, ?string $url, stdClass|array|string|null $values, ?string $name) { | |
| 38760 | + public function __construct(?DataFormat $format, string $url, stdClass|array|string $values, string $name) { | |
| 38859 | 38761 | $this->format = $format; |
| 38860 | 38762 | $this->url = $url; |
| 38861 | 38763 | $this->values = $values; |
| @@ -38954,16 +38856,12 @@ class Data { | ||
| 38954 | 38856 | * An URL from which to load the data set. Use the `format.type` property |
| 38955 | 38857 | * to ensure the loaded data is correctly parsed. |
| 38956 | 38858 | * |
| 38957 | - * @param ?string $value | |
| 38859 | + * @param string $value | |
| 38958 | 38860 | * @throws Exception |
| 38959 | - * @return ?string | |
| 38861 | + * @return string | |
| 38960 | 38862 | */ |
| 38961 | - public static function fromURL(?string $value): ?string { | |
| 38962 | - if (!is_null($value)) { | |
| 38963 | - return $value; /*string*/ | |
| 38964 | - } else { | |
| 38965 | - return null; | |
| 38966 | - } | |
| 38863 | + public static function fromURL(string $value): string { | |
| 38864 | + return $value; /*string*/ | |
| 38967 | 38865 | } |
| 38968 | 38866 | |
| 38969 | 38867 | /** |
| @@ -38971,15 +38869,11 @@ class Data { | ||
| 38971 | 38869 | * to ensure the loaded data is correctly parsed. |
| 38972 | 38870 | * |
| 38973 | 38871 | * @throws Exception |
| 38974 | - * @return ?string | |
| 38872 | + * @return string | |
| 38975 | 38873 | */ |
| 38976 | - public function toURL(): ?string { | |
| 38874 | + public function toURL(): string { | |
| 38977 | 38875 | if (Data::validateURL($this->url)) { |
| 38978 | - if (!is_null($this->url)) { | |
| 38979 | - return $this->url; /*string*/ | |
| 38980 | - } else { | |
| 38981 | - return null; | |
| 38982 | - } | |
| 38876 | + return $this->url; /*string*/ | |
| 38983 | 38877 | } |
| 38984 | 38878 | throw new Exception('never get to this Data::url'); |
| 38985 | 38879 | } |
| @@ -38988,13 +38882,11 @@ class Data { | ||
| 38988 | 38882 | * An URL from which to load the data set. Use the `format.type` property |
| 38989 | 38883 | * to ensure the loaded data is correctly parsed. |
| 38990 | 38884 | * |
| 38991 | - * @param string|null | |
| 38885 | + * @param string | |
| 38992 | 38886 | * @return bool |
| 38993 | 38887 | * @throws Exception |
| 38994 | 38888 | */ |
| 38995 | - public static function validateURL(?string $value): bool { | |
| 38996 | - if (!is_null($value)) { | |
| 38997 | - } | |
| 38889 | + public static function validateURL(string $value): bool { | |
| 38998 | 38890 | return true; |
| 38999 | 38891 | } |
| 39000 | 38892 | |
| @@ -39003,9 +38895,9 @@ class Data { | ||
| 39003 | 38895 | * to ensure the loaded data is correctly parsed. |
| 39004 | 38896 | * |
| 39005 | 38897 | * @throws Exception |
| 39006 | - * @return ?string | |
| 38898 | + * @return string | |
| 39007 | 38899 | */ |
| 39008 | - public function getURL(): ?string { | |
| 38900 | + public function getURL(): string { | |
| 39009 | 38901 | if (Data::validateURL($this->url)) { |
| 39010 | 38902 | return $this->url; |
| 39011 | 38903 | } |
| @@ -39016,9 +38908,9 @@ class Data { | ||
| 39016 | 38908 | * An URL from which to load the data set. Use the `format.type` property |
| 39017 | 38909 | * to ensure the loaded data is correctly parsed. |
| 39018 | 38910 | * |
| 39019 | - * @return ?string | |
| 38911 | + * @return string | |
| 39020 | 38912 | */ |
| 39021 | - public static function sampleURL(): ?string { | |
| 38913 | + public static function sampleURL(): string { | |
| 39022 | 38914 | return 'Data::url::32'; /*32:url*/ |
| 39023 | 38915 | } |
| 39024 | 38916 | |
| @@ -39028,14 +38920,12 @@ class Data { | ||
| 39028 | 38920 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 39029 | 38921 | * parsed according to the specified format type. |
| 39030 | 38922 | * |
| 39031 | - * @param stdClass|array|string|null $value | |
| 38923 | + * @param stdClass|array|string $value | |
| 39032 | 38924 | * @throws Exception |
| 39033 | - * @return stdClass|array|string|null | |
| 38925 | + * @return stdClass|array|string | |
| 39034 | 38926 | */ |
| 39035 | - public static function fromValues(stdClass|array|string|null $value): stdClass|array|string|null { | |
| 39036 | - if (is_null($value)) { | |
| 39037 | - return $value; /*null*/ | |
| 39038 | - } elseif (is_object($value)) { | |
| 38927 | + public static function fromValues(stdClass|array|string $value): stdClass|array|string { | |
| 38928 | + if (is_object($value)) { | |
| 39039 | 38929 | $out = new stdClass(); |
| 39040 | 38930 | foreach ($value as $k => $v) { |
| 39041 | 38931 | $out->$k = $v; /*any*/ |
| @@ -39073,13 +38963,11 @@ class Data { | ||
| 39073 | 38963 | * parsed according to the specified format type. |
| 39074 | 38964 | * |
| 39075 | 38965 | * @throws Exception |
| 39076 | - * @return stdClass|array|string|null | |
| 38966 | + * @return stdClass|array|string | |
| 39077 | 38967 | */ |
| 39078 | - public function toValues(): stdClass|array|string|null { | |
| 38968 | + public function toValues(): stdClass|array|string { | |
| 39079 | 38969 | if (Data::validateValues($this->values)) { |
| 39080 | - if (is_null($this->values)) { | |
| 39081 | - return $this->values; /*null*/ | |
| 39082 | - } elseif ($this->values instanceof stdClass) { | |
| 38970 | + if ($this->values instanceof stdClass) { | |
| 39083 | 38971 | $out = new stdClass(); |
| 39084 | 38972 | foreach ($this->values as $k => $v) { |
| 39085 | 38973 | $out->$k = $v; /*any*/ |
| @@ -39118,16 +39006,12 @@ class Data { | ||
| 39118 | 39006 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 39119 | 39007 | * parsed according to the specified format type. |
| 39120 | 39008 | * |
| 39121 | - * @param stdClass|array|string|null | |
| 39009 | + * @param stdClass|array|string | |
| 39122 | 39010 | * @return bool |
| 39123 | 39011 | * @throws Exception |
| 39124 | 39012 | */ |
| 39125 | - public static function validateValues(stdClass|array|string|null $value): bool { | |
| 39126 | - if (is_null($value)) { | |
| 39127 | - if (!is_null($value)) { | |
| 39128 | - throw new Exception("Attribute Error:Data::values"); | |
| 39129 | - } | |
| 39130 | - } elseif ($value instanceof stdClass) { | |
| 39013 | + public static function validateValues(stdClass|array|string $value): bool { | |
| 39014 | + if ($value instanceof stdClass) { | |
| 39131 | 39015 | foreach ($value as $k => $v) { |
| 39132 | 39016 | } |
| 39133 | 39017 | } elseif (is_array($value)) { |
| @@ -39171,9 +39055,9 @@ class Data { | ||
| 39171 | 39055 | * parsed according to the specified format type. |
| 39172 | 39056 | * |
| 39173 | 39057 | * @throws Exception |
| 39174 | - * @return stdClass|array|string|null | |
| 39058 | + * @return stdClass|array|string | |
| 39175 | 39059 | */ |
| 39176 | - public function getValues(): stdClass|array|string|null { | |
| 39060 | + public function getValues(): stdClass|array|string { | |
| 39177 | 39061 | if (Data::validateValues($this->values)) { |
| 39178 | 39062 | return $this->values; |
| 39179 | 39063 | } |
| @@ -39186,9 +39070,9 @@ class Data { | ||
| 39186 | 39070 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 39187 | 39071 | * parsed according to the specified format type. |
| 39188 | 39072 | * |
| 39189 | - * @return stdClass|array|string|null | |
| 39073 | + * @return stdClass|array|string | |
| 39190 | 39074 | */ |
| 39191 | - public static function sampleValues(): stdClass|array|string|null { | |
| 39075 | + public static function sampleValues(): stdClass|array|string { | |
| 39192 | 39076 | return (function () { |
| 39193 | 39077 | $out = new stdClass(); |
| 39194 | 39078 | $out->{'Data'} = 'AnyType::Data::values::33';/*33:values*/ |
| @@ -39199,31 +39083,23 @@ class Data { | ||
| 39199 | 39083 | /** |
| 39200 | 39084 | * Provide a placeholder name and bind data at runtime. |
| 39201 | 39085 | * |
| 39202 | - * @param ?string $value | |
| 39086 | + * @param string $value | |
| 39203 | 39087 | * @throws Exception |
| 39204 | - * @return ?string | |
| 39088 | + * @return string | |
| 39205 | 39089 | */ |
| 39206 | - public static function fromName(?string $value): ?string { | |
| 39207 | - if (!is_null($value)) { | |
| 39208 | - return $value; /*string*/ | |
| 39209 | - } else { | |
| 39210 | - return null; | |
| 39211 | - } | |
| 39090 | + public static function fromName(string $value): string { | |
| 39091 | + return $value; /*string*/ | |
| 39212 | 39092 | } |
| 39213 | 39093 | |
| 39214 | 39094 | /** |
| 39215 | 39095 | * Provide a placeholder name and bind data at runtime. |
| 39216 | 39096 | * |
| 39217 | 39097 | * @throws Exception |
| 39218 | - * @return ?string | |
| 39098 | + * @return string | |
| 39219 | 39099 | */ |
| 39220 | - public function toName(): ?string { | |
| 39100 | + public function toName(): string { | |
| 39221 | 39101 | if (Data::validateName($this->name)) { |
| 39222 | - if (!is_null($this->name)) { | |
| 39223 | - return $this->name; /*string*/ | |
| 39224 | - } else { | |
| 39225 | - return null; | |
| 39226 | - } | |
| 39102 | + return $this->name; /*string*/ | |
| 39227 | 39103 | } |
| 39228 | 39104 | throw new Exception('never get to this Data::name'); |
| 39229 | 39105 | } |
| @@ -39231,13 +39107,11 @@ class Data { | ||
| 39231 | 39107 | /** |
| 39232 | 39108 | * Provide a placeholder name and bind data at runtime. |
| 39233 | 39109 | * |
| 39234 | - * @param string|null | |
| 39110 | + * @param string | |
| 39235 | 39111 | * @return bool |
| 39236 | 39112 | * @throws Exception |
| 39237 | 39113 | */ |
| 39238 | - public static function validateName(?string $value): bool { | |
| 39239 | - if (!is_null($value)) { | |
| 39240 | - } | |
| 39114 | + public static function validateName(string $value): bool { | |
| 39241 | 39115 | return true; |
| 39242 | 39116 | } |
| 39243 | 39117 | |
| @@ -39245,9 +39119,9 @@ class Data { | ||
| 39245 | 39119 | * Provide a placeholder name and bind data at runtime. |
| 39246 | 39120 | * |
| 39247 | 39121 | * @throws Exception |
| 39248 | - * @return ?string | |
| 39122 | + * @return string | |
| 39249 | 39123 | */ |
| 39250 | - public function getName(): ?string { | |
| 39124 | + public function getName(): string { | |
| 39251 | 39125 | if (Data::validateName($this->name)) { |
| 39252 | 39126 | return $this->name; |
| 39253 | 39127 | } |
| @@ -39257,9 +39131,9 @@ class Data { | ||
| 39257 | 39131 | /** |
| 39258 | 39132 | * Provide a placeholder name and bind data at runtime. |
| 39259 | 39133 | * |
| 39260 | - * @return ?string | |
| 39134 | + * @return string | |
| 39261 | 39135 | */ |
| 39262 | - public static function sampleName(): ?string { | |
| 39136 | + public static function sampleName(): string { | |
| 39263 | 39137 | return 'Data::name::34'; /*34:name*/ |
| 39264 | 39138 | } |
| 39265 | 39139 | |
| @@ -41367,7 +41241,7 @@ class MarkPropDefWithCondition { | ||
| 41367 | 41241 | private ?Scale $scale; // json:scale Optional |
| 41368 | 41242 | private SortField|SortOrder|null $sort; // json:sort Optional |
| 41369 | 41243 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 41370 | - private ?Type $type; // json:type Optional | |
| 41244 | + private Type $type; // json:type Required | |
| 41371 | 41245 | private bool|float|string|null $value; // json:value Optional |
| 41372 | 41246 | |
| 41373 | 41247 | /** |
| @@ -41379,10 +41253,10 @@ class MarkPropDefWithCondition { | ||
| 41379 | 41253 | * @param Scale|null $scale |
| 41380 | 41254 | * @param SortField|SortOrder|null $sort |
| 41381 | 41255 | * @param TimeUnit|null $timeUnit |
| 41382 | - * @param Type|null $type | |
| 41256 | + * @param Type $type | |
| 41383 | 41257 | * @param bool|float|string|null $value |
| 41384 | 41258 | */ |
| 41385 | - public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateMarkPropFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) { | |
| 41259 | + public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateMarkPropFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, Type $type, bool|float|string|null $value) { | |
| 41386 | 41260 | $this->aggregate = $aggregate; |
| 41387 | 41261 | $this->bin = $bin; |
| 41388 | 41262 | $this->condition = $condition; |
| @@ -42207,16 +42081,12 @@ class MarkPropDefWithCondition { | ||
| 42207 | 42081 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 42208 | 42082 | * [geographic projection](projection.html) is applied. |
| 42209 | 42083 | * |
| 42210 | - * @param ?string $value | |
| 42084 | + * @param string $value | |
| 42211 | 42085 | * @throws Exception |
| 42212 | - * @return ?Type | |
| 42086 | + * @return Type | |
| 42213 | 42087 | */ |
| 42214 | - public static function fromType(?string $value): ?Type { | |
| 42215 | - if (!is_null($value)) { | |
| 42216 | - return Type::from($value); /*enum*/ | |
| 42217 | - } else { | |
| 42218 | - return null; | |
| 42219 | - } | |
| 42088 | + public static function fromType(string $value): Type { | |
| 42089 | + return Type::from($value); /*enum*/ | |
| 42220 | 42090 | } |
| 42221 | 42091 | |
| 42222 | 42092 | /** |
| @@ -42226,15 +42096,11 @@ class MarkPropDefWithCondition { | ||
| 42226 | 42096 | * [geographic projection](projection.html) is applied. |
| 42227 | 42097 | * |
| 42228 | 42098 | * @throws Exception |
| 42229 | - * @return ?string | |
| 42099 | + * @return string | |
| 42230 | 42100 | */ |
| 42231 | - public function toType(): ?string { | |
| 42101 | + public function toType(): string { | |
| 42232 | 42102 | if (MarkPropDefWithCondition::validateType($this->type)) { |
| 42233 | - if (!is_null($this->type)) { | |
| 42234 | - return Type::to($this->type); /*enum*/ | |
| 42235 | - } else { | |
| 42236 | - return null; | |
| 42237 | - } | |
| 42103 | + return Type::to($this->type); /*enum*/ | |
| 42238 | 42104 | } |
| 42239 | 42105 | throw new Exception('never get to this MarkPropDefWithCondition::type'); |
| 42240 | 42106 | } |
| @@ -42245,14 +42111,12 @@ class MarkPropDefWithCondition { | ||
| 42245 | 42111 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 42246 | 42112 | * [geographic projection](projection.html) is applied. |
| 42247 | 42113 | * |
| 42248 | - * @param Type|null | |
| 42114 | + * @param Type | |
| 42249 | 42115 | * @return bool |
| 42250 | 42116 | * @throws Exception |
| 42251 | 42117 | */ |
| 42252 | - public static function validateType(?Type $value): bool { | |
| 42253 | - if (!is_null($value)) { | |
| 42254 | - Type::to($value); | |
| 42255 | - } | |
| 42118 | + public static function validateType(Type $value): bool { | |
| 42119 | + Type::to($value); | |
| 42256 | 42120 | return true; |
| 42257 | 42121 | } |
| 42258 | 42122 | |
| @@ -42263,9 +42127,9 @@ class MarkPropDefWithCondition { | ||
| 42263 | 42127 | * [geographic projection](projection.html) is applied. |
| 42264 | 42128 | * |
| 42265 | 42129 | * @throws Exception |
| 42266 | - * @return ?Type | |
| 42130 | + * @return Type | |
| 42267 | 42131 | */ |
| 42268 | - public function getType(): ?Type { | |
| 42132 | + public function getType(): Type { | |
| 42269 | 42133 | if (MarkPropDefWithCondition::validateType($this->type)) { |
| 42270 | 42134 | return $this->type; |
| 42271 | 42135 | } |
| @@ -42278,9 +42142,9 @@ class MarkPropDefWithCondition { | ||
| 42278 | 42142 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 42279 | 42143 | * [geographic projection](projection.html) is applied. |
| 42280 | 42144 | * |
| 42281 | - * @return ?Type | |
| 42145 | + * @return Type | |
| 42282 | 42146 | */ |
| 42283 | - public static function sampleType(): ?Type { | |
| 42147 | + public static function sampleType(): Type { | |
| 42284 | 42148 | return Type::sample(); /*enum*/ |
| 42285 | 42149 | } |
| 42286 | 42150 | |
| @@ -43346,30 +43210,28 @@ class BinParams { | ||
| 43346 | 43210 | // This is an autogenerated file:ConditionalValueDef |
| 43347 | 43211 | |
| 43348 | 43212 | class ConditionalValueDef { |
| 43349 | - private Predicate|string|null $test; // json:test Optional | |
| 43213 | + private Predicate|string $test; // json:test Required | |
| 43350 | 43214 | private bool|float|string $value; // json:value Required |
| 43351 | - private Selection|string|null $selection; // json:selection Optional | |
| 43215 | + private Selection|string $selection; // json:selection Required | |
| 43352 | 43216 | |
| 43353 | 43217 | /** |
| 43354 | - * @param Predicate|string|null $test | |
| 43218 | + * @param Predicate|string $test | |
| 43355 | 43219 | * @param bool|float|string $value |
| 43356 | - * @param Selection|string|null $selection | |
| 43220 | + * @param Selection|string $selection | |
| 43357 | 43221 | */ |
| 43358 | - public function __construct(Predicate|string|null $test, bool|float|string $value, Selection|string|null $selection) { | |
| 43222 | + public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection) { | |
| 43359 | 43223 | $this->test = $test; |
| 43360 | 43224 | $this->value = $value; |
| 43361 | 43225 | $this->selection = $selection; |
| 43362 | 43226 | } |
| 43363 | 43227 | |
| 43364 | 43228 | /** |
| 43365 | - * @param stdClass|string|null $value | |
| 43229 | + * @param stdClass|string $value | |
| 43366 | 43230 | * @throws Exception |
| 43367 | - * @return Predicate|string|null | |
| 43231 | + * @return Predicate|string | |
| 43368 | 43232 | */ |
| 43369 | - public static function fromTest(stdClass|string|null $value): Predicate|string|null { | |
| 43370 | - if (is_null($value)) { | |
| 43371 | - return $value; /*null*/ | |
| 43372 | - } elseif (is_object($value)) { | |
| 43233 | + public static function fromTest(stdClass|string $value): Predicate|string { | |
| 43234 | + if (is_object($value)) { | |
| 43373 | 43235 | return Predicate::from($value); /*class*/ |
| 43374 | 43236 | } elseif (is_string($value)) { |
| 43375 | 43237 | return $value; /*string*/ |
| @@ -43380,13 +43242,11 @@ class ConditionalValueDef { | ||
| 43380 | 43242 | |
| 43381 | 43243 | /** |
| 43382 | 43244 | * @throws Exception |
| 43383 | - * @return stdClass|string|null | |
| 43245 | + * @return stdClass|string | |
| 43384 | 43246 | */ |
| 43385 | - public function toTest(): stdClass|string|null { | |
| 43247 | + public function toTest(): stdClass|string { | |
| 43386 | 43248 | if (ConditionalValueDef::validateTest($this->test)) { |
| 43387 | - if (is_null($this->test)) { | |
| 43388 | - return $this->test; /*null*/ | |
| 43389 | - } elseif ($this->test instanceof Predicate) { | |
| 43249 | + if ($this->test instanceof Predicate) { | |
| 43390 | 43250 | return $this->test->to(); /*class*/ |
| 43391 | 43251 | } elseif (is_string($this->test)) { |
| 43392 | 43252 | return $this->test; /*string*/ |
| @@ -43398,16 +43258,12 @@ class ConditionalValueDef { | ||
| 43398 | 43258 | } |
| 43399 | 43259 | |
| 43400 | 43260 | /** |
| 43401 | - * @param Predicate|string|null | |
| 43261 | + * @param Predicate|string | |
| 43402 | 43262 | * @return bool |
| 43403 | 43263 | * @throws Exception |
| 43404 | 43264 | */ |
| 43405 | - public static function validateTest(Predicate|string|null $value): bool { | |
| 43406 | - if (is_null($value)) { | |
| 43407 | - if (!is_null($value)) { | |
| 43408 | - throw new Exception("Attribute Error:ConditionalValueDef::test"); | |
| 43409 | - } | |
| 43410 | - } elseif ($value instanceof Predicate) { | |
| 43265 | + public static function validateTest(Predicate|string $value): bool { | |
| 43266 | + if ($value instanceof Predicate) { | |
| 43411 | 43267 | $value->validate(); |
| 43412 | 43268 | } elseif (is_string($value)) { |
| 43413 | 43269 | if (!is_string($value)) { |
| @@ -43421,9 +43277,9 @@ class ConditionalValueDef { | ||
| 43421 | 43277 | |
| 43422 | 43278 | /** |
| 43423 | 43279 | * @throws Exception |
| 43424 | - * @return Predicate|string|null | |
| 43280 | + * @return Predicate|string | |
| 43425 | 43281 | */ |
| 43426 | - public function getTest(): Predicate|string|null { | |
| 43282 | + public function getTest(): Predicate|string { | |
| 43427 | 43283 | if (ConditionalValueDef::validateTest($this->test)) { |
| 43428 | 43284 | return $this->test; |
| 43429 | 43285 | } |
| @@ -43431,9 +43287,9 @@ class ConditionalValueDef { | ||
| 43431 | 43287 | } |
| 43432 | 43288 | |
| 43433 | 43289 | /** |
| 43434 | - * @return Predicate|string|null | |
| 43290 | + * @return Predicate|string | |
| 43435 | 43291 | */ |
| 43436 | - public static function sampleTest(): Predicate|string|null { | |
| 43292 | + public static function sampleTest(): Predicate|string { | |
| 43437 | 43293 | return Predicate::sample(); /*31:test*/ |
| 43438 | 43294 | } |
| 43439 | 43295 | |
| @@ -43534,14 +43390,12 @@ class ConditionalValueDef { | ||
| 43534 | 43390 | * A [selection name](selection.html), or a series of [composed |
| 43535 | 43391 | * selections](selection.html#compose). |
| 43536 | 43392 | * |
| 43537 | - * @param stdClass|string|null $value | |
| 43393 | + * @param stdClass|string $value | |
| 43538 | 43394 | * @throws Exception |
| 43539 | - * @return Selection|string|null | |
| 43395 | + * @return Selection|string | |
| 43540 | 43396 | */ |
| 43541 | - public static function fromSelection(stdClass|string|null $value): Selection|string|null { | |
| 43542 | - if (is_null($value)) { | |
| 43543 | - return $value; /*null*/ | |
| 43544 | - } elseif (is_object($value)) { | |
| 43397 | + public static function fromSelection(stdClass|string $value): Selection|string { | |
| 43398 | + if (is_object($value)) { | |
| 43545 | 43399 | return Selection::from($value); /*class*/ |
| 43546 | 43400 | } elseif (is_string($value)) { |
| 43547 | 43401 | return $value; /*string*/ |
| @@ -43555,13 +43409,11 @@ class ConditionalValueDef { | ||
| 43555 | 43409 | * selections](selection.html#compose). |
| 43556 | 43410 | * |
| 43557 | 43411 | * @throws Exception |
| 43558 | - * @return stdClass|string|null | |
| 43412 | + * @return stdClass|string | |
| 43559 | 43413 | */ |
| 43560 | - public function toSelection(): stdClass|string|null { | |
| 43414 | + public function toSelection(): stdClass|string { | |
| 43561 | 43415 | if (ConditionalValueDef::validateSelection($this->selection)) { |
| 43562 | - if (is_null($this->selection)) { | |
| 43563 | - return $this->selection; /*null*/ | |
| 43564 | - } elseif ($this->selection instanceof Selection) { | |
| 43416 | + if ($this->selection instanceof Selection) { | |
| 43565 | 43417 | return $this->selection->to(); /*class*/ |
| 43566 | 43418 | } elseif (is_string($this->selection)) { |
| 43567 | 43419 | return $this->selection; /*string*/ |
| @@ -43576,16 +43428,12 @@ class ConditionalValueDef { | ||
| 43576 | 43428 | * A [selection name](selection.html), or a series of [composed |
| 43577 | 43429 | * selections](selection.html#compose). |
| 43578 | 43430 | * |
| 43579 | - * @param Selection|string|null | |
| 43431 | + * @param Selection|string | |
| 43580 | 43432 | * @return bool |
| 43581 | 43433 | * @throws Exception |
| 43582 | 43434 | */ |
| 43583 | - public static function validateSelection(Selection|string|null $value): bool { | |
| 43584 | - if (is_null($value)) { | |
| 43585 | - if (!is_null($value)) { | |
| 43586 | - throw new Exception("Attribute Error:ConditionalValueDef::selection"); | |
| 43587 | - } | |
| 43588 | - } elseif ($value instanceof Selection) { | |
| 43435 | + public static function validateSelection(Selection|string $value): bool { | |
| 43436 | + if ($value instanceof Selection) { | |
| 43589 | 43437 | $value->validate(); |
| 43590 | 43438 | } elseif (is_string($value)) { |
| 43591 | 43439 | if (!is_string($value)) { |
| @@ -43602,9 +43450,9 @@ class ConditionalValueDef { | ||
| 43602 | 43450 | * selections](selection.html#compose). |
| 43603 | 43451 | * |
| 43604 | 43452 | * @throws Exception |
| 43605 | - * @return Selection|string|null | |
| 43453 | + * @return Selection|string | |
| 43606 | 43454 | */ |
| 43607 | - public function getSelection(): Selection|string|null { | |
| 43455 | + public function getSelection(): Selection|string { | |
| 43608 | 43456 | if (ConditionalValueDef::validateSelection($this->selection)) { |
| 43609 | 43457 | return $this->selection; |
| 43610 | 43458 | } |
| @@ -43615,9 +43463,9 @@ class ConditionalValueDef { | ||
| 43615 | 43463 | * A [selection name](selection.html), or a series of [composed |
| 43616 | 43464 | * selections](selection.html#compose). |
| 43617 | 43465 | * |
| 43618 | - * @return Selection|string|null | |
| 43466 | + * @return Selection|string | |
| 43619 | 43467 | */ |
| 43620 | - public static function sampleSelection(): Selection|string|null { | |
| 43468 | + public static function sampleSelection(): Selection|string { | |
| 43621 | 43469 | return Selection::sample(); /*33:selection*/ |
| 43622 | 43470 | } |
| 43623 | 43471 | |
| @@ -43671,30 +43519,28 @@ class ConditionalValueDef { | ||
| 43671 | 43519 | // This is an autogenerated file:Selection |
| 43672 | 43520 | |
| 43673 | 43521 | class Selection { |
| 43674 | - private Selection|string|null $not; // json:not Optional | |
| 43675 | - private ?array $and; // json:and Optional | |
| 43676 | - private ?array $or; // json:or Optional | |
| 43522 | + private Selection|string $not; // json:not Required | |
| 43523 | + private array $and; // json:and Required | |
| 43524 | + private array $or; // json:or Required | |
| 43677 | 43525 | |
| 43678 | 43526 | /** |
| 43679 | - * @param Selection|string|null $not | |
| 43680 | - * @param array|null $and | |
| 43681 | - * @param array|null $or | |
| 43527 | + * @param Selection|string $not | |
| 43528 | + * @param array $and | |
| 43529 | + * @param array $or | |
| 43682 | 43530 | */ |
| 43683 | - public function __construct(Selection|string|null $not, ?array $and, ?array $or) { | |
| 43531 | + public function __construct(Selection|string $not, array $and, array $or) { | |
| 43684 | 43532 | $this->not = $not; |
| 43685 | 43533 | $this->and = $and; |
| 43686 | 43534 | $this->or = $or; |
| 43687 | 43535 | } |
| 43688 | 43536 | |
| 43689 | 43537 | /** |
| 43690 | - * @param stdClass|string|null $value | |
| 43538 | + * @param stdClass|string $value | |
| 43691 | 43539 | * @throws Exception |
| 43692 | - * @return Selection|string|null | |
| 43540 | + * @return Selection|string | |
| 43693 | 43541 | */ |
| 43694 | - public static function fromNot(stdClass|string|null $value): Selection|string|null { | |
| 43695 | - if (is_null($value)) { | |
| 43696 | - return $value; /*null*/ | |
| 43697 | - } elseif (is_object($value)) { | |
| 43542 | + public static function fromNot(stdClass|string $value): Selection|string { | |
| 43543 | + if (is_object($value)) { | |
| 43698 | 43544 | return Selection::from($value); /*class*/ |
| 43699 | 43545 | } elseif (is_string($value)) { |
| 43700 | 43546 | return $value; /*string*/ |
| @@ -43705,13 +43551,11 @@ class Selection { | ||
| 43705 | 43551 | |
| 43706 | 43552 | /** |
| 43707 | 43553 | * @throws Exception |
| 43708 | - * @return stdClass|string|null | |
| 43554 | + * @return stdClass|string | |
| 43709 | 43555 | */ |
| 43710 | - public function toNot(): stdClass|string|null { | |
| 43556 | + public function toNot(): stdClass|string { | |
| 43711 | 43557 | if (Selection::validateNot($this->not)) { |
| 43712 | - if (is_null($this->not)) { | |
| 43713 | - return $this->not; /*null*/ | |
| 43714 | - } elseif ($this->not instanceof Selection) { | |
| 43558 | + if ($this->not instanceof Selection) { | |
| 43715 | 43559 | return $this->not->to(); /*class*/ |
| 43716 | 43560 | } elseif (is_string($this->not)) { |
| 43717 | 43561 | return $this->not; /*string*/ |
| @@ -43723,16 +43567,12 @@ class Selection { | ||
| 43723 | 43567 | } |
| 43724 | 43568 | |
| 43725 | 43569 | /** |
| 43726 | - * @param Selection|string|null | |
| 43570 | + * @param Selection|string | |
| 43727 | 43571 | * @return bool |
| 43728 | 43572 | * @throws Exception |
| 43729 | 43573 | */ |
| 43730 | - public static function validateNot(Selection|string|null $value): bool { | |
| 43731 | - if (is_null($value)) { | |
| 43732 | - if (!is_null($value)) { | |
| 43733 | - throw new Exception("Attribute Error:Selection::not"); | |
| 43734 | - } | |
| 43735 | - } elseif ($value instanceof Selection) { | |
| 43574 | + public static function validateNot(Selection|string $value): bool { | |
| 43575 | + if ($value instanceof Selection) { | |
| 43736 | 43576 | $value->validate(); |
| 43737 | 43577 | } elseif (is_string($value)) { |
| 43738 | 43578 | if (!is_string($value)) { |
| @@ -43746,9 +43586,9 @@ class Selection { | ||
| 43746 | 43586 | |
| 43747 | 43587 | /** |
| 43748 | 43588 | * @throws Exception |
| 43749 | - * @return Selection|string|null | |
| 43589 | + * @return Selection|string | |
| 43750 | 43590 | */ |
| 43751 | - public function getNot(): Selection|string|null { | |
| 43591 | + public function getNot(): Selection|string { | |
| 43752 | 43592 | if (Selection::validateNot($this->not)) { |
| 43753 | 43593 | return $this->not; |
| 43754 | 43594 | } |
| @@ -43756,86 +43596,76 @@ class Selection { | ||
| 43756 | 43596 | } |
| 43757 | 43597 | |
| 43758 | 43598 | /** |
| 43759 | - * @return Selection|string|null | |
| 43599 | + * @return Selection|string | |
| 43760 | 43600 | */ |
| 43761 | - public static function sampleNot(): Selection|string|null { | |
| 43601 | + public static function sampleNot(): Selection|string { | |
| 43762 | 43602 | return Selection::sample(); /*31:not*/ |
| 43763 | 43603 | } |
| 43764 | 43604 | |
| 43765 | 43605 | /** |
| 43766 | - * @param ?array $value | |
| 43606 | + * @param array $value | |
| 43767 | 43607 | * @throws Exception |
| 43768 | - * @return ?array | |
| 43608 | + * @return array | |
| 43769 | 43609 | */ |
| 43770 | - public static function fromAnd(?array $value): ?array { | |
| 43771 | - if (!is_null($value)) { | |
| 43772 | - return array_map(function ($value) { | |
| 43773 | - if (is_object($value)) { | |
| 43774 | - return Selection::from($value); /*class*/ | |
| 43775 | - } elseif (is_string($value)) { | |
| 43776 | - return $value; /*string*/ | |
| 43777 | - } else { | |
| 43778 | - throw new Exception('Cannot deserialize union value in Selection'); | |
| 43779 | - } | |
| 43780 | - }, $value); | |
| 43781 | - } else { | |
| 43782 | - return null; | |
| 43783 | - } | |
| 43610 | + public static function fromAnd(array $value): array { | |
| 43611 | + return array_map(function ($value) { | |
| 43612 | + if (is_object($value)) { | |
| 43613 | + return Selection::from($value); /*class*/ | |
| 43614 | + } elseif (is_string($value)) { | |
| 43615 | + return $value; /*string*/ | |
| 43616 | + } else { | |
| 43617 | + throw new Exception('Cannot deserialize union value in Selection'); | |
| 43618 | + } | |
| 43619 | + }, $value); | |
| 43784 | 43620 | } |
| 43785 | 43621 | |
| 43786 | 43622 | /** |
| 43787 | 43623 | * @throws Exception |
| 43788 | - * @return ?array | |
| 43624 | + * @return array | |
| 43789 | 43625 | */ |
| 43790 | - public function toAnd(): ?array { | |
| 43626 | + public function toAnd(): array { | |
| 43791 | 43627 | if (Selection::validateAnd($this->and)) { |
| 43792 | - if (!is_null($this->and)) { | |
| 43793 | - return array_map(function ($value) { | |
| 43794 | - if ($value instanceof Selection) { | |
| 43795 | - return $value->to(); /*class*/ | |
| 43796 | - } elseif (is_string($value)) { | |
| 43797 | - return $value; /*string*/ | |
| 43798 | - } else { | |
| 43799 | - throw new Exception('Union value has no matching member in Selection'); | |
| 43800 | - } | |
| 43801 | - }, $this->and); | |
| 43802 | - } else { | |
| 43803 | - return null; | |
| 43804 | - } | |
| 43628 | + return array_map(function ($value) { | |
| 43629 | + if ($value instanceof Selection) { | |
| 43630 | + return $value->to(); /*class*/ | |
| 43631 | + } elseif (is_string($value)) { | |
| 43632 | + return $value; /*string*/ | |
| 43633 | + } else { | |
| 43634 | + throw new Exception('Union value has no matching member in Selection'); | |
| 43635 | + } | |
| 43636 | + }, $this->and); | |
| 43805 | 43637 | } |
| 43806 | 43638 | throw new Exception('never get to this Selection::and'); |
| 43807 | 43639 | } |
| 43808 | 43640 | |
| 43809 | 43641 | /** |
| 43810 | - * @param array|null | |
| 43642 | + * @param array | |
| 43811 | 43643 | * @return bool |
| 43812 | 43644 | * @throws Exception |
| 43813 | 43645 | */ |
| 43814 | - public static function validateAnd(?array $value): bool { | |
| 43815 | - if (!is_null($value)) { | |
| 43816 | - if (!is_array($value)) { | |
| 43817 | - throw new Exception("Attribute Error:Selection::and"); | |
| 43818 | - } | |
| 43819 | - array_walk($value, function($value_v) { | |
| 43820 | - if ($value_v instanceof Selection) { | |
| 43821 | - $value_v->validate(); | |
| 43822 | - } elseif (is_string($value_v)) { | |
| 43823 | - if (!is_string($value_v)) { | |
| 43824 | - throw new Exception("Attribute Error:Selection::and"); | |
| 43825 | - } | |
| 43826 | - } else { | |
| 43646 | + public static function validateAnd(array $value): bool { | |
| 43647 | + if (!is_array($value)) { | |
| 43648 | + throw new Exception("Attribute Error:Selection::and"); | |
| 43649 | + } | |
| 43650 | + array_walk($value, function($value_v) { | |
| 43651 | + if ($value_v instanceof Selection) { | |
| 43652 | + $value_v->validate(); | |
| 43653 | + } elseif (is_string($value_v)) { | |
| 43654 | + if (!is_string($value_v)) { | |
| 43827 | 43655 | throw new Exception("Attribute Error:Selection::and"); |
| 43828 | 43656 | } |
| 43829 | - }); | |
| 43830 | - } | |
| 43657 | + } else { | |
| 43658 | + throw new Exception("Attribute Error:Selection::and"); | |
| 43659 | + } | |
| 43660 | + }); | |
| 43831 | 43661 | return true; |
| 43832 | 43662 | } |
| 43833 | 43663 | |
| 43834 | 43664 | /** |
| 43835 | 43665 | * @throws Exception |
| 43836 | - * @return ?array | |
| 43666 | + * @return array | |
| 43837 | 43667 | */ |
| 43838 | - public function getAnd(): ?array { | |
| 43668 | + public function getAnd(): array { | |
| 43839 | 43669 | if (Selection::validateAnd($this->and)) { |
| 43840 | 43670 | return $this->and; |
| 43841 | 43671 | } |
| @@ -43843,88 +43673,78 @@ class Selection { | ||
| 43843 | 43673 | } |
| 43844 | 43674 | |
| 43845 | 43675 | /** |
| 43846 | - * @return ?array | |
| 43676 | + * @return array | |
| 43847 | 43677 | */ |
| 43848 | - public static function sampleAnd(): ?array { | |
| 43678 | + public static function sampleAnd(): array { | |
| 43849 | 43679 | return array( |
| 43850 | 43680 | Selection::sample() /*32:*/ |
| 43851 | 43681 | ); /* 32:and*/ |
| 43852 | 43682 | } |
| 43853 | 43683 | |
| 43854 | 43684 | /** |
| 43855 | - * @param ?array $value | |
| 43685 | + * @param array $value | |
| 43856 | 43686 | * @throws Exception |
| 43857 | - * @return ?array | |
| 43687 | + * @return array | |
| 43858 | 43688 | */ |
| 43859 | - public static function fromOr(?array $value): ?array { | |
| 43860 | - if (!is_null($value)) { | |
| 43861 | - return array_map(function ($value) { | |
| 43862 | - if (is_object($value)) { | |
| 43863 | - return Selection::from($value); /*class*/ | |
| 43864 | - } elseif (is_string($value)) { | |
| 43865 | - return $value; /*string*/ | |
| 43866 | - } else { | |
| 43867 | - throw new Exception('Cannot deserialize union value in Selection'); | |
| 43868 | - } | |
| 43869 | - }, $value); | |
| 43870 | - } else { | |
| 43871 | - return null; | |
| 43872 | - } | |
| 43689 | + public static function fromOr(array $value): array { | |
| 43690 | + return array_map(function ($value) { | |
| 43691 | + if (is_object($value)) { | |
| 43692 | + return Selection::from($value); /*class*/ | |
| 43693 | + } elseif (is_string($value)) { | |
| 43694 | + return $value; /*string*/ | |
| 43695 | + } else { | |
| 43696 | + throw new Exception('Cannot deserialize union value in Selection'); | |
| 43697 | + } | |
| 43698 | + }, $value); | |
| 43873 | 43699 | } |
| 43874 | 43700 | |
| 43875 | 43701 | /** |
| 43876 | 43702 | * @throws Exception |
| 43877 | - * @return ?array | |
| 43703 | + * @return array | |
| 43878 | 43704 | */ |
| 43879 | - public function toOr(): ?array { | |
| 43705 | + public function toOr(): array { | |
| 43880 | 43706 | if (Selection::validateOr($this->or)) { |
| 43881 | - if (!is_null($this->or)) { | |
| 43882 | - return array_map(function ($value) { | |
| 43883 | - if ($value instanceof Selection) { | |
| 43884 | - return $value->to(); /*class*/ | |
| 43885 | - } elseif (is_string($value)) { | |
| 43886 | - return $value; /*string*/ | |
| 43887 | - } else { | |
| 43888 | - throw new Exception('Union value has no matching member in Selection'); | |
| 43889 | - } | |
| 43890 | - }, $this->or); | |
| 43891 | - } else { | |
| 43892 | - return null; | |
| 43893 | - } | |
| 43707 | + return array_map(function ($value) { | |
| 43708 | + if ($value instanceof Selection) { | |
| 43709 | + return $value->to(); /*class*/ | |
| 43710 | + } elseif (is_string($value)) { | |
| 43711 | + return $value; /*string*/ | |
| 43712 | + } else { | |
| 43713 | + throw new Exception('Union value has no matching member in Selection'); | |
| 43714 | + } | |
| 43715 | + }, $this->or); | |
| 43894 | 43716 | } |
| 43895 | 43717 | throw new Exception('never get to this Selection::or'); |
| 43896 | 43718 | } |
| 43897 | 43719 | |
| 43898 | 43720 | /** |
| 43899 | - * @param array|null | |
| 43721 | + * @param array | |
| 43900 | 43722 | * @return bool |
| 43901 | 43723 | * @throws Exception |
| 43902 | 43724 | */ |
| 43903 | - public static function validateOr(?array $value): bool { | |
| 43904 | - if (!is_null($value)) { | |
| 43905 | - if (!is_array($value)) { | |
| 43906 | - throw new Exception("Attribute Error:Selection::or"); | |
| 43907 | - } | |
| 43908 | - array_walk($value, function($value_v) { | |
| 43909 | - if ($value_v instanceof Selection) { | |
| 43910 | - $value_v->validate(); | |
| 43911 | - } elseif (is_string($value_v)) { | |
| 43912 | - if (!is_string($value_v)) { | |
| 43913 | - throw new Exception("Attribute Error:Selection::or"); | |
| 43914 | - } | |
| 43915 | - } else { | |
| 43725 | + public static function validateOr(array $value): bool { | |
| 43726 | + if (!is_array($value)) { | |
| 43727 | + throw new Exception("Attribute Error:Selection::or"); | |
| 43728 | + } | |
| 43729 | + array_walk($value, function($value_v) { | |
| 43730 | + if ($value_v instanceof Selection) { | |
| 43731 | + $value_v->validate(); | |
| 43732 | + } elseif (is_string($value_v)) { | |
| 43733 | + if (!is_string($value_v)) { | |
| 43916 | 43734 | throw new Exception("Attribute Error:Selection::or"); |
| 43917 | 43735 | } |
| 43918 | - }); | |
| 43919 | - } | |
| 43736 | + } else { | |
| 43737 | + throw new Exception("Attribute Error:Selection::or"); | |
| 43738 | + } | |
| 43739 | + }); | |
| 43920 | 43740 | return true; |
| 43921 | 43741 | } |
| 43922 | 43742 | |
| 43923 | 43743 | /** |
| 43924 | 43744 | * @throws Exception |
| 43925 | - * @return ?array | |
| 43745 | + * @return array | |
| 43926 | 43746 | */ |
| 43927 | - public function getOr(): ?array { | |
| 43747 | + public function getOr(): array { | |
| 43928 | 43748 | if (Selection::validateOr($this->or)) { |
| 43929 | 43749 | return $this->or; |
| 43930 | 43750 | } |
| @@ -43932,9 +43752,9 @@ class Selection { | ||
| 43932 | 43752 | } |
| 43933 | 43753 | |
| 43934 | 43754 | /** |
| 43935 | - * @return ?array | |
| 43755 | + * @return array | |
| 43936 | 43756 | */ |
| 43937 | - public static function sampleOr(): ?array { | |
| 43757 | + public static function sampleOr(): array { | |
| 43938 | 43758 | return array( |
| 43939 | 43759 | Selection::sample() /*33:*/ |
| 43940 | 43760 | ); /* 33:or*/ |
| @@ -43990,28 +43810,28 @@ class Selection { | ||
| 43990 | 43810 | // This is an autogenerated file:Predicate |
| 43991 | 43811 | |
| 43992 | 43812 | class Predicate { |
| 43993 | - private Predicate|string|null $not; // json:not Optional | |
| 43994 | - private ?array $and; // json:and Optional | |
| 43995 | - private ?array $or; // json:or Optional | |
| 43996 | - private DateTimeClass|bool|float|string|null $equal; // json:equal Optional | |
| 43997 | - private ?string $field; // json:field Optional | |
| 43813 | + private Predicate|string $not; // json:not Required | |
| 43814 | + private array $and; // json:and Required | |
| 43815 | + private array $or; // json:or Required | |
| 43816 | + private DateTimeClass|bool|float|string $equal; // json:equal Required | |
| 43817 | + private string $field; // json:field Required | |
| 43998 | 43818 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 43999 | - private ?array $range; // json:range Optional | |
| 44000 | - private ?array $oneOf; // json:oneOf Optional | |
| 44001 | - private Selection|string|null $selection; // json:selection Optional | |
| 43819 | + private array $range; // json:range Required | |
| 43820 | + private array $oneOf; // json:oneOf Required | |
| 43821 | + private Selection|string $selection; // json:selection Required | |
| 44002 | 43822 | |
| 44003 | 43823 | /** |
| 44004 | - * @param Predicate|string|null $not | |
| 44005 | - * @param array|null $and | |
| 44006 | - * @param array|null $or | |
| 44007 | - * @param DateTimeClass|bool|float|string|null $equal | |
| 44008 | - * @param string|null $field | |
| 43824 | + * @param Predicate|string $not | |
| 43825 | + * @param array $and | |
| 43826 | + * @param array $or | |
| 43827 | + * @param DateTimeClass|bool|float|string $equal | |
| 43828 | + * @param string $field | |
| 44009 | 43829 | * @param TimeUnit|null $timeUnit |
| 44010 | - * @param array|null $range | |
| 44011 | - * @param array|null $oneOf | |
| 44012 | - * @param Selection|string|null $selection | |
| 43830 | + * @param array $range | |
| 43831 | + * @param array $oneOf | |
| 43832 | + * @param Selection|string $selection | |
| 44013 | 43833 | */ |
| 44014 | - public function __construct(Predicate|string|null $not, ?array $and, ?array $or, DateTimeClass|bool|float|string|null $equal, ?string $field, ?TimeUnit $timeUnit, ?array $range, ?array $oneOf, Selection|string|null $selection) { | |
| 43834 | + public function __construct(Predicate|string $not, array $and, array $or, DateTimeClass|bool|float|string $equal, string $field, ?TimeUnit $timeUnit, array $range, array $oneOf, Selection|string $selection) { | |
| 44015 | 43835 | $this->not = $not; |
| 44016 | 43836 | $this->and = $and; |
| 44017 | 43837 | $this->or = $or; |
| @@ -44024,14 +43844,12 @@ class Predicate { | ||
| 44024 | 43844 | } |
| 44025 | 43845 | |
| 44026 | 43846 | /** |
| 44027 | - * @param stdClass|string|null $value | |
| 43847 | + * @param stdClass|string $value | |
| 44028 | 43848 | * @throws Exception |
| 44029 | - * @return Predicate|string|null | |
| 43849 | + * @return Predicate|string | |
| 44030 | 43850 | */ |
| 44031 | - public static function fromNot(stdClass|string|null $value): Predicate|string|null { | |
| 44032 | - if (is_null($value)) { | |
| 44033 | - return $value; /*null*/ | |
| 44034 | - } elseif (is_object($value)) { | |
| 43851 | + public static function fromNot(stdClass|string $value): Predicate|string { | |
| 43852 | + if (is_object($value)) { | |
| 44035 | 43853 | return Predicate::from($value); /*class*/ |
| 44036 | 43854 | } elseif (is_string($value)) { |
| 44037 | 43855 | return $value; /*string*/ |
| @@ -44042,13 +43860,11 @@ class Predicate { | ||
| 44042 | 43860 | |
| 44043 | 43861 | /** |
| 44044 | 43862 | * @throws Exception |
| 44045 | - * @return stdClass|string|null | |
| 43863 | + * @return stdClass|string | |
| 44046 | 43864 | */ |
| 44047 | - public function toNot(): stdClass|string|null { | |
| 43865 | + public function toNot(): stdClass|string { | |
| 44048 | 43866 | if (Predicate::validateNot($this->not)) { |
| 44049 | - if (is_null($this->not)) { | |
| 44050 | - return $this->not; /*null*/ | |
| 44051 | - } elseif ($this->not instanceof Predicate) { | |
| 43867 | + if ($this->not instanceof Predicate) { | |
| 44052 | 43868 | return $this->not->to(); /*class*/ |
| 44053 | 43869 | } elseif (is_string($this->not)) { |
| 44054 | 43870 | return $this->not; /*string*/ |
| @@ -44060,16 +43876,12 @@ class Predicate { | ||
| 44060 | 43876 | } |
| 44061 | 43877 | |
| 44062 | 43878 | /** |
| 44063 | - * @param Predicate|string|null | |
| 43879 | + * @param Predicate|string | |
| 44064 | 43880 | * @return bool |
| 44065 | 43881 | * @throws Exception |
| 44066 | 43882 | */ |
| 44067 | - public static function validateNot(Predicate|string|null $value): bool { | |
| 44068 | - if (is_null($value)) { | |
| 44069 | - if (!is_null($value)) { | |
| 44070 | - throw new Exception("Attribute Error:Predicate::not"); | |
| 44071 | - } | |
| 44072 | - } elseif ($value instanceof Predicate) { | |
| 43883 | + public static function validateNot(Predicate|string $value): bool { | |
| 43884 | + if ($value instanceof Predicate) { | |
| 44073 | 43885 | $value->validate(); |
| 44074 | 43886 | } elseif (is_string($value)) { |
| 44075 | 43887 | if (!is_string($value)) { |
| @@ -44083,9 +43895,9 @@ class Predicate { | ||
| 44083 | 43895 | |
| 44084 | 43896 | /** |
| 44085 | 43897 | * @throws Exception |
| 44086 | - * @return Predicate|string|null | |
| 43898 | + * @return Predicate|string | |
| 44087 | 43899 | */ |
| 44088 | - public function getNot(): Predicate|string|null { | |
| 43900 | + public function getNot(): Predicate|string { | |
| 44089 | 43901 | if (Predicate::validateNot($this->not)) { |
| 44090 | 43902 | return $this->not; |
| 44091 | 43903 | } |
| @@ -44093,86 +43905,76 @@ class Predicate { | ||
| 44093 | 43905 | } |
| 44094 | 43906 | |
| 44095 | 43907 | /** |
| 44096 | - * @return Predicate|string|null | |
| 43908 | + * @return Predicate|string | |
| 44097 | 43909 | */ |
| 44098 | - public static function sampleNot(): Predicate|string|null { | |
| 43910 | + public static function sampleNot(): Predicate|string { | |
| 44099 | 43911 | return Predicate::sample(); /*31:not*/ |
| 44100 | 43912 | } |
| 44101 | 43913 | |
| 44102 | 43914 | /** |
| 44103 | - * @param ?array $value | |
| 43915 | + * @param array $value | |
| 44104 | 43916 | * @throws Exception |
| 44105 | - * @return ?array | |
| 43917 | + * @return array | |
| 44106 | 43918 | */ |
| 44107 | - public static function fromAnd(?array $value): ?array { | |
| 44108 | - if (!is_null($value)) { | |
| 44109 | - return array_map(function ($value) { | |
| 44110 | - if (is_object($value)) { | |
| 44111 | - return Predicate::from($value); /*class*/ | |
| 44112 | - } elseif (is_string($value)) { | |
| 44113 | - return $value; /*string*/ | |
| 44114 | - } else { | |
| 44115 | - throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44116 | - } | |
| 44117 | - }, $value); | |
| 44118 | - } else { | |
| 44119 | - return null; | |
| 44120 | - } | |
| 43919 | + public static function fromAnd(array $value): array { | |
| 43920 | + return array_map(function ($value) { | |
| 43921 | + if (is_object($value)) { | |
| 43922 | + return Predicate::from($value); /*class*/ | |
| 43923 | + } elseif (is_string($value)) { | |
| 43924 | + return $value; /*string*/ | |
| 43925 | + } else { | |
| 43926 | + throw new Exception('Cannot deserialize union value in Predicate'); | |
| 43927 | + } | |
| 43928 | + }, $value); | |
| 44121 | 43929 | } |
| 44122 | 43930 | |
| 44123 | 43931 | /** |
| 44124 | 43932 | * @throws Exception |
| 44125 | - * @return ?array | |
| 43933 | + * @return array | |
| 44126 | 43934 | */ |
| 44127 | - public function toAnd(): ?array { | |
| 43935 | + public function toAnd(): array { | |
| 44128 | 43936 | if (Predicate::validateAnd($this->and)) { |
| 44129 | - if (!is_null($this->and)) { | |
| 44130 | - return array_map(function ($value) { | |
| 44131 | - if ($value instanceof Predicate) { | |
| 44132 | - return $value->to(); /*class*/ | |
| 44133 | - } elseif (is_string($value)) { | |
| 44134 | - return $value; /*string*/ | |
| 44135 | - } else { | |
| 44136 | - throw new Exception('Union value has no matching member in Predicate'); | |
| 44137 | - } | |
| 44138 | - }, $this->and); | |
| 44139 | - } else { | |
| 44140 | - return null; | |
| 44141 | - } | |
| 43937 | + return array_map(function ($value) { | |
| 43938 | + if ($value instanceof Predicate) { | |
| 43939 | + return $value->to(); /*class*/ | |
| 43940 | + } elseif (is_string($value)) { | |
| 43941 | + return $value; /*string*/ | |
| 43942 | + } else { | |
| 43943 | + throw new Exception('Union value has no matching member in Predicate'); | |
| 43944 | + } | |
| 43945 | + }, $this->and); | |
| 44142 | 43946 | } |
| 44143 | 43947 | throw new Exception('never get to this Predicate::and'); |
| 44144 | 43948 | } |
| 44145 | 43949 | |
| 44146 | 43950 | /** |
| 44147 | - * @param array|null | |
| 43951 | + * @param array | |
| 44148 | 43952 | * @return bool |
| 44149 | 43953 | * @throws Exception |
| 44150 | 43954 | */ |
| 44151 | - public static function validateAnd(?array $value): bool { | |
| 44152 | - if (!is_null($value)) { | |
| 44153 | - if (!is_array($value)) { | |
| 44154 | - throw new Exception("Attribute Error:Predicate::and"); | |
| 44155 | - } | |
| 44156 | - array_walk($value, function($value_v) { | |
| 44157 | - if ($value_v instanceof Predicate) { | |
| 44158 | - $value_v->validate(); | |
| 44159 | - } elseif (is_string($value_v)) { | |
| 44160 | - if (!is_string($value_v)) { | |
| 44161 | - throw new Exception("Attribute Error:Predicate::and"); | |
| 44162 | - } | |
| 44163 | - } else { | |
| 43955 | + public static function validateAnd(array $value): bool { | |
| 43956 | + if (!is_array($value)) { | |
| 43957 | + throw new Exception("Attribute Error:Predicate::and"); | |
| 43958 | + } | |
| 43959 | + array_walk($value, function($value_v) { | |
| 43960 | + if ($value_v instanceof Predicate) { | |
| 43961 | + $value_v->validate(); | |
| 43962 | + } elseif (is_string($value_v)) { | |
| 43963 | + if (!is_string($value_v)) { | |
| 44164 | 43964 | throw new Exception("Attribute Error:Predicate::and"); |
| 44165 | 43965 | } |
| 44166 | - }); | |
| 44167 | - } | |
| 43966 | + } else { | |
| 43967 | + throw new Exception("Attribute Error:Predicate::and"); | |
| 43968 | + } | |
| 43969 | + }); | |
| 44168 | 43970 | return true; |
| 44169 | 43971 | } |
| 44170 | 43972 | |
| 44171 | 43973 | /** |
| 44172 | 43974 | * @throws Exception |
| 44173 | - * @return ?array | |
| 43975 | + * @return array | |
| 44174 | 43976 | */ |
| 44175 | - public function getAnd(): ?array { | |
| 43977 | + public function getAnd(): array { | |
| 44176 | 43978 | if (Predicate::validateAnd($this->and)) { |
| 44177 | 43979 | return $this->and; |
| 44178 | 43980 | } |
| @@ -44180,88 +43982,78 @@ class Predicate { | ||
| 44180 | 43982 | } |
| 44181 | 43983 | |
| 44182 | 43984 | /** |
| 44183 | - * @return ?array | |
| 43985 | + * @return array | |
| 44184 | 43986 | */ |
| 44185 | - public static function sampleAnd(): ?array { | |
| 43987 | + public static function sampleAnd(): array { | |
| 44186 | 43988 | return array( |
| 44187 | 43989 | Predicate::sample() /*32:*/ |
| 44188 | 43990 | ); /* 32:and*/ |
| 44189 | 43991 | } |
| 44190 | 43992 | |
| 44191 | 43993 | /** |
| 44192 | - * @param ?array $value | |
| 43994 | + * @param array $value | |
| 44193 | 43995 | * @throws Exception |
| 44194 | - * @return ?array | |
| 43996 | + * @return array | |
| 44195 | 43997 | */ |
| 44196 | - public static function fromOr(?array $value): ?array { | |
| 44197 | - if (!is_null($value)) { | |
| 44198 | - return array_map(function ($value) { | |
| 44199 | - if (is_object($value)) { | |
| 44200 | - return Predicate::from($value); /*class*/ | |
| 44201 | - } elseif (is_string($value)) { | |
| 44202 | - return $value; /*string*/ | |
| 44203 | - } else { | |
| 44204 | - throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44205 | - } | |
| 44206 | - }, $value); | |
| 44207 | - } else { | |
| 44208 | - return null; | |
| 44209 | - } | |
| 43998 | + public static function fromOr(array $value): array { | |
| 43999 | + return array_map(function ($value) { | |
| 44000 | + if (is_object($value)) { | |
| 44001 | + return Predicate::from($value); /*class*/ | |
| 44002 | + } elseif (is_string($value)) { | |
| 44003 | + return $value; /*string*/ | |
| 44004 | + } else { | |
| 44005 | + throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44006 | + } | |
| 44007 | + }, $value); | |
| 44210 | 44008 | } |
| 44211 | 44009 | |
| 44212 | 44010 | /** |
| 44213 | 44011 | * @throws Exception |
| 44214 | - * @return ?array | |
| 44012 | + * @return array | |
| 44215 | 44013 | */ |
| 44216 | - public function toOr(): ?array { | |
| 44014 | + public function toOr(): array { | |
| 44217 | 44015 | if (Predicate::validateOr($this->or)) { |
| 44218 | - if (!is_null($this->or)) { | |
| 44219 | - return array_map(function ($value) { | |
| 44220 | - if ($value instanceof Predicate) { | |
| 44221 | - return $value->to(); /*class*/ | |
| 44222 | - } elseif (is_string($value)) { | |
| 44223 | - return $value; /*string*/ | |
| 44224 | - } else { | |
| 44225 | - throw new Exception('Union value has no matching member in Predicate'); | |
| 44226 | - } | |
| 44227 | - }, $this->or); | |
| 44228 | - } else { | |
| 44229 | - return null; | |
| 44230 | - } | |
| 44016 | + return array_map(function ($value) { | |
| 44017 | + if ($value instanceof Predicate) { | |
| 44018 | + return $value->to(); /*class*/ | |
| 44019 | + } elseif (is_string($value)) { | |
| 44020 | + return $value; /*string*/ | |
| 44021 | + } else { | |
| 44022 | + throw new Exception('Union value has no matching member in Predicate'); | |
| 44023 | + } | |
| 44024 | + }, $this->or); | |
| 44231 | 44025 | } |
| 44232 | 44026 | throw new Exception('never get to this Predicate::or'); |
| 44233 | 44027 | } |
| 44234 | 44028 | |
| 44235 | 44029 | /** |
| 44236 | - * @param array|null | |
| 44030 | + * @param array | |
| 44237 | 44031 | * @return bool |
| 44238 | 44032 | * @throws Exception |
| 44239 | 44033 | */ |
| 44240 | - public static function validateOr(?array $value): bool { | |
| 44241 | - if (!is_null($value)) { | |
| 44242 | - if (!is_array($value)) { | |
| 44243 | - throw new Exception("Attribute Error:Predicate::or"); | |
| 44244 | - } | |
| 44245 | - array_walk($value, function($value_v) { | |
| 44246 | - if ($value_v instanceof Predicate) { | |
| 44247 | - $value_v->validate(); | |
| 44248 | - } elseif (is_string($value_v)) { | |
| 44249 | - if (!is_string($value_v)) { | |
| 44250 | - throw new Exception("Attribute Error:Predicate::or"); | |
| 44251 | - } | |
| 44252 | - } else { | |
| 44034 | + public static function validateOr(array $value): bool { | |
| 44035 | + if (!is_array($value)) { | |
| 44036 | + throw new Exception("Attribute Error:Predicate::or"); | |
| 44037 | + } | |
| 44038 | + array_walk($value, function($value_v) { | |
| 44039 | + if ($value_v instanceof Predicate) { | |
| 44040 | + $value_v->validate(); | |
| 44041 | + } elseif (is_string($value_v)) { | |
| 44042 | + if (!is_string($value_v)) { | |
| 44253 | 44043 | throw new Exception("Attribute Error:Predicate::or"); |
| 44254 | 44044 | } |
| 44255 | - }); | |
| 44256 | - } | |
| 44045 | + } else { | |
| 44046 | + throw new Exception("Attribute Error:Predicate::or"); | |
| 44047 | + } | |
| 44048 | + }); | |
| 44257 | 44049 | return true; |
| 44258 | 44050 | } |
| 44259 | 44051 | |
| 44260 | 44052 | /** |
| 44261 | 44053 | * @throws Exception |
| 44262 | - * @return ?array | |
| 44054 | + * @return array | |
| 44263 | 44055 | */ |
| 44264 | - public function getOr(): ?array { | |
| 44056 | + public function getOr(): array { | |
| 44265 | 44057 | if (Predicate::validateOr($this->or)) { |
| 44266 | 44058 | return $this->or; |
| 44267 | 44059 | } |
| @@ -44269,9 +44061,9 @@ class Predicate { | ||
| 44269 | 44061 | } |
| 44270 | 44062 | |
| 44271 | 44063 | /** |
| 44272 | - * @return ?array | |
| 44064 | + * @return array | |
| 44273 | 44065 | */ |
| 44274 | - public static function sampleOr(): ?array { | |
| 44066 | + public static function sampleOr(): array { | |
| 44275 | 44067 | return array( |
| 44276 | 44068 | Predicate::sample() /*33:*/ |
| 44277 | 44069 | ); /* 33:or*/ |
| @@ -44280,14 +44072,12 @@ class Predicate { | ||
| 44280 | 44072 | /** |
| 44281 | 44073 | * The value that the field should be equal to. |
| 44282 | 44074 | * |
| 44283 | - * @param stdClass|bool|float|string|null $value | |
| 44075 | + * @param stdClass|bool|float|string $value | |
| 44284 | 44076 | * @throws Exception |
| 44285 | - * @return DateTimeClass|bool|float|string|null | |
| 44077 | + * @return DateTimeClass|bool|float|string | |
| 44286 | 44078 | */ |
| 44287 | - public static function fromEqual(stdClass|bool|float|string|null $value): DateTimeClass|bool|float|string|null { | |
| 44288 | - if (is_null($value)) { | |
| 44289 | - return $value; /*null*/ | |
| 44290 | - } elseif (is_object($value)) { | |
| 44079 | + public static function fromEqual(stdClass|bool|float|string $value): DateTimeClass|bool|float|string { | |
| 44080 | + if (is_object($value)) { | |
| 44291 | 44081 | return DateTimeClass::from($value); /*class*/ |
| 44292 | 44082 | } elseif (is_bool($value)) { |
| 44293 | 44083 | return $value; /*bool*/ |
| @@ -44304,13 +44094,11 @@ class Predicate { | ||
| 44304 | 44094 | * The value that the field should be equal to. |
| 44305 | 44095 | * |
| 44306 | 44096 | * @throws Exception |
| 44307 | - * @return stdClass|bool|float|string|null | |
| 44097 | + * @return stdClass|bool|float|string | |
| 44308 | 44098 | */ |
| 44309 | - public function toEqual(): stdClass|bool|float|string|null { | |
| 44099 | + public function toEqual(): stdClass|bool|float|string { | |
| 44310 | 44100 | if (Predicate::validateEqual($this->equal)) { |
| 44311 | - if (is_null($this->equal)) { | |
| 44312 | - return $this->equal; /*null*/ | |
| 44313 | - } elseif ($this->equal instanceof DateTimeClass) { | |
| 44101 | + if ($this->equal instanceof DateTimeClass) { | |
| 44314 | 44102 | return $this->equal->to(); /*class*/ |
| 44315 | 44103 | } elseif (is_bool($this->equal)) { |
| 44316 | 44104 | return $this->equal; /*bool*/ |
| @@ -44328,16 +44116,12 @@ class Predicate { | ||
| 44328 | 44116 | /** |
| 44329 | 44117 | * The value that the field should be equal to. |
| 44330 | 44118 | * |
| 44331 | - * @param DateTimeClass|bool|float|string|null | |
| 44119 | + * @param DateTimeClass|bool|float|string | |
| 44332 | 44120 | * @return bool |
| 44333 | 44121 | * @throws Exception |
| 44334 | 44122 | */ |
| 44335 | - public static function validateEqual(DateTimeClass|bool|float|string|null $value): bool { | |
| 44336 | - if (is_null($value)) { | |
| 44337 | - if (!is_null($value)) { | |
| 44338 | - throw new Exception("Attribute Error:Predicate::equal"); | |
| 44339 | - } | |
| 44340 | - } elseif ($value instanceof DateTimeClass) { | |
| 44123 | + public static function validateEqual(DateTimeClass|bool|float|string $value): bool { | |
| 44124 | + if ($value instanceof DateTimeClass) { | |
| 44341 | 44125 | $value->validate(); |
| 44342 | 44126 | } elseif (is_bool($value)) { |
| 44343 | 44127 | if (!is_bool($value)) { |
| @@ -44361,9 +44145,9 @@ class Predicate { | ||
| 44361 | 44145 | * The value that the field should be equal to. |
| 44362 | 44146 | * |
| 44363 | 44147 | * @throws Exception |
| 44364 | - * @return DateTimeClass|bool|float|string|null | |
| 44148 | + * @return DateTimeClass|bool|float|string | |
| 44365 | 44149 | */ |
| 44366 | - public function getEqual(): DateTimeClass|bool|float|string|null { | |
| 44150 | + public function getEqual(): DateTimeClass|bool|float|string { | |
| 44367 | 44151 | if (Predicate::validateEqual($this->equal)) { |
| 44368 | 44152 | return $this->equal; |
| 44369 | 44153 | } |
| @@ -44373,9 +44157,9 @@ class Predicate { | ||
| 44373 | 44157 | /** |
| 44374 | 44158 | * The value that the field should be equal to. |
| 44375 | 44159 | * |
| 44376 | - * @return DateTimeClass|bool|float|string|null | |
| 44160 | + * @return DateTimeClass|bool|float|string | |
| 44377 | 44161 | */ |
| 44378 | - public static function sampleEqual(): DateTimeClass|bool|float|string|null { | |
| 44162 | + public static function sampleEqual(): DateTimeClass|bool|float|string { | |
| 44379 | 44163 | return DateTimeClass::sample(); /*34:equal*/ |
| 44380 | 44164 | } |
| 44381 | 44165 | |
| @@ -44384,16 +44168,12 @@ class Predicate { | ||
| 44384 | 44168 | * |
| 44385 | 44169 | * Field to be filtered |
| 44386 | 44170 | * |
| 44387 | - * @param ?string $value | |
| 44171 | + * @param string $value | |
| 44388 | 44172 | * @throws Exception |
| 44389 | - * @return ?string | |
| 44173 | + * @return string | |
| 44390 | 44174 | */ |
| 44391 | - public static function fromField(?string $value): ?string { | |
| 44392 | - if (!is_null($value)) { | |
| 44393 | - return $value; /*string*/ | |
| 44394 | - } else { | |
| 44395 | - return null; | |
| 44396 | - } | |
| 44175 | + public static function fromField(string $value): string { | |
| 44176 | + return $value; /*string*/ | |
| 44397 | 44177 | } |
| 44398 | 44178 | |
| 44399 | 44179 | /** |
| @@ -44402,15 +44182,11 @@ class Predicate { | ||
| 44402 | 44182 | * Field to be filtered |
| 44403 | 44183 | * |
| 44404 | 44184 | * @throws Exception |
| 44405 | - * @return ?string | |
| 44185 | + * @return string | |
| 44406 | 44186 | */ |
| 44407 | - public function toField(): ?string { | |
| 44187 | + public function toField(): string { | |
| 44408 | 44188 | if (Predicate::validateField($this->field)) { |
| 44409 | - if (!is_null($this->field)) { | |
| 44410 | - return $this->field; /*string*/ | |
| 44411 | - } else { | |
| 44412 | - return null; | |
| 44413 | - } | |
| 44189 | + return $this->field; /*string*/ | |
| 44414 | 44190 | } |
| 44415 | 44191 | throw new Exception('never get to this Predicate::field'); |
| 44416 | 44192 | } |
| @@ -44420,13 +44196,11 @@ class Predicate { | ||
| 44420 | 44196 | * |
| 44421 | 44197 | * Field to be filtered |
| 44422 | 44198 | * |
| 44423 | - * @param string|null | |
| 44199 | + * @param string | |
| 44424 | 44200 | * @return bool |
| 44425 | 44201 | * @throws Exception |
| 44426 | 44202 | */ |
| 44427 | - public static function validateField(?string $value): bool { | |
| 44428 | - if (!is_null($value)) { | |
| 44429 | - } | |
| 44203 | + public static function validateField(string $value): bool { | |
| 44430 | 44204 | return true; |
| 44431 | 44205 | } |
| 44432 | 44206 | |
| @@ -44436,9 +44210,9 @@ class Predicate { | ||
| 44436 | 44210 | * Field to be filtered |
| 44437 | 44211 | * |
| 44438 | 44212 | * @throws Exception |
| 44439 | - * @return ?string | |
| 44213 | + * @return string | |
| 44440 | 44214 | */ |
| 44441 | - public function getField(): ?string { | |
| 44215 | + public function getField(): string { | |
| 44442 | 44216 | if (Predicate::validateField($this->field)) { |
| 44443 | 44217 | return $this->field; |
| 44444 | 44218 | } |
| @@ -44450,9 +44224,9 @@ class Predicate { | ||
| 44450 | 44224 | * |
| 44451 | 44225 | * Field to be filtered |
| 44452 | 44226 | * |
| 44453 | - * @return ?string | |
| 44227 | + * @return string | |
| 44454 | 44228 | */ |
| 44455 | - public static function sampleField(): ?string { | |
| 44229 | + public static function sampleField(): string { | |
| 44456 | 44230 | return 'Predicate::field::35'; /*35:field*/ |
| 44457 | 44231 | } |
| 44458 | 44232 | |
| @@ -44538,26 +44312,22 @@ class Predicate { | ||
| 44538 | 44312 | * An array of inclusive minimum and maximum values |
| 44539 | 44313 | * for a field value of a data item to be included in the filtered data. |
| 44540 | 44314 | * |
| 44541 | - * @param ?array $value | |
| 44315 | + * @param array $value | |
| 44542 | 44316 | * @throws Exception |
| 44543 | - * @return ?array | |
| 44317 | + * @return array | |
| 44544 | 44318 | */ |
| 44545 | - public static function fromRange(?array $value): ?array { | |
| 44546 | - if (!is_null($value)) { | |
| 44547 | - return array_map(function ($value) { | |
| 44548 | - if (is_null($value)) { | |
| 44549 | - return $value; /*null*/ | |
| 44550 | - } elseif (is_object($value)) { | |
| 44551 | - return DateTimeClass::from($value); /*class*/ | |
| 44552 | - } elseif (is_float($value) || is_int($value)) { | |
| 44553 | - return $value; /*float*/ | |
| 44554 | - } else { | |
| 44555 | - throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44556 | - } | |
| 44557 | - }, $value); | |
| 44558 | - } else { | |
| 44559 | - return null; | |
| 44560 | - } | |
| 44319 | + public static function fromRange(array $value): array { | |
| 44320 | + return array_map(function ($value) { | |
| 44321 | + if (is_null($value)) { | |
| 44322 | + return $value; /*null*/ | |
| 44323 | + } elseif (is_object($value)) { | |
| 44324 | + return DateTimeClass::from($value); /*class*/ | |
| 44325 | + } elseif (is_float($value) || is_int($value)) { | |
| 44326 | + return $value; /*float*/ | |
| 44327 | + } else { | |
| 44328 | + throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44329 | + } | |
| 44330 | + }, $value); | |
| 44561 | 44331 | } |
| 44562 | 44332 | |
| 44563 | 44333 | /** |
| @@ -44565,25 +44335,21 @@ class Predicate { | ||
| 44565 | 44335 | * for a field value of a data item to be included in the filtered data. |
| 44566 | 44336 | * |
| 44567 | 44337 | * @throws Exception |
| 44568 | - * @return ?array | |
| 44338 | + * @return array | |
| 44569 | 44339 | */ |
| 44570 | - public function toRange(): ?array { | |
| 44340 | + public function toRange(): array { | |
| 44571 | 44341 | if (Predicate::validateRange($this->range)) { |
| 44572 | - if (!is_null($this->range)) { | |
| 44573 | - return array_map(function ($value) { | |
| 44574 | - if (is_null($value)) { | |
| 44575 | - return $value; /*null*/ | |
| 44576 | - } elseif ($value instanceof DateTimeClass) { | |
| 44577 | - return $value->to(); /*class*/ | |
| 44578 | - } elseif (is_float($value) || is_int($value)) { | |
| 44579 | - return $value; /*float*/ | |
| 44580 | - } else { | |
| 44581 | - throw new Exception('Union value has no matching member in Predicate'); | |
| 44582 | - } | |
| 44583 | - }, $this->range); | |
| 44584 | - } else { | |
| 44585 | - return null; | |
| 44586 | - } | |
| 44342 | + return array_map(function ($value) { | |
| 44343 | + if (is_null($value)) { | |
| 44344 | + return $value; /*null*/ | |
| 44345 | + } elseif ($value instanceof DateTimeClass) { | |
| 44346 | + return $value->to(); /*class*/ | |
| 44347 | + } elseif (is_float($value) || is_int($value)) { | |
| 44348 | + return $value; /*float*/ | |
| 44349 | + } else { | |
| 44350 | + throw new Exception('Union value has no matching member in Predicate'); | |
| 44351 | + } | |
| 44352 | + }, $this->range); | |
| 44587 | 44353 | } |
| 44588 | 44354 | throw new Exception('never get to this Predicate::range'); |
| 44589 | 44355 | } |
| @@ -44592,31 +44358,29 @@ class Predicate { | ||
| 44592 | 44358 | * An array of inclusive minimum and maximum values |
| 44593 | 44359 | * for a field value of a data item to be included in the filtered data. |
| 44594 | 44360 | * |
| 44595 | - * @param array|null | |
| 44361 | + * @param array | |
| 44596 | 44362 | * @return bool |
| 44597 | 44363 | * @throws Exception |
| 44598 | 44364 | */ |
| 44599 | - public static function validateRange(?array $value): bool { | |
| 44600 | - if (!is_null($value)) { | |
| 44601 | - if (!is_array($value)) { | |
| 44602 | - throw new Exception("Attribute Error:Predicate::range"); | |
| 44603 | - } | |
| 44604 | - array_walk($value, function($value_v) { | |
| 44605 | - if (is_null($value_v)) { | |
| 44606 | - if (!is_null($value_v)) { | |
| 44607 | - throw new Exception("Attribute Error:Predicate::range"); | |
| 44608 | - } | |
| 44609 | - } elseif ($value_v instanceof DateTimeClass) { | |
| 44610 | - $value_v->validate(); | |
| 44611 | - } elseif (is_float($value_v) || is_int($value_v)) { | |
| 44612 | - if (!is_float($value_v) && !is_int($value_v)) { | |
| 44613 | - throw new Exception("Attribute Error:Predicate::range"); | |
| 44614 | - } | |
| 44615 | - } else { | |
| 44365 | + public static function validateRange(array $value): bool { | |
| 44366 | + if (!is_array($value)) { | |
| 44367 | + throw new Exception("Attribute Error:Predicate::range"); | |
| 44368 | + } | |
| 44369 | + array_walk($value, function($value_v) { | |
| 44370 | + if (is_null($value_v)) { | |
| 44371 | + if (!is_null($value_v)) { | |
| 44616 | 44372 | throw new Exception("Attribute Error:Predicate::range"); |
| 44617 | 44373 | } |
| 44618 | - }); | |
| 44619 | - } | |
| 44374 | + } elseif ($value_v instanceof DateTimeClass) { | |
| 44375 | + $value_v->validate(); | |
| 44376 | + } elseif (is_float($value_v) || is_int($value_v)) { | |
| 44377 | + if (!is_float($value_v) && !is_int($value_v)) { | |
| 44378 | + throw new Exception("Attribute Error:Predicate::range"); | |
| 44379 | + } | |
| 44380 | + } else { | |
| 44381 | + throw new Exception("Attribute Error:Predicate::range"); | |
| 44382 | + } | |
| 44383 | + }); | |
| 44620 | 44384 | return true; |
| 44621 | 44385 | } |
| 44622 | 44386 | |
| @@ -44625,9 +44389,9 @@ class Predicate { | ||
| 44625 | 44389 | * for a field value of a data item to be included in the filtered data. |
| 44626 | 44390 | * |
| 44627 | 44391 | * @throws Exception |
| 44628 | - * @return ?array | |
| 44392 | + * @return array | |
| 44629 | 44393 | */ |
| 44630 | - public function getRange(): ?array { | |
| 44394 | + public function getRange(): array { | |
| 44631 | 44395 | if (Predicate::validateRange($this->range)) { |
| 44632 | 44396 | return $this->range; |
| 44633 | 44397 | } |
| @@ -44638,9 +44402,9 @@ class Predicate { | ||
| 44638 | 44402 | * An array of inclusive minimum and maximum values |
| 44639 | 44403 | * for a field value of a data item to be included in the filtered data. |
| 44640 | 44404 | * |
| 44641 | - * @return ?array | |
| 44405 | + * @return array | |
| 44642 | 44406 | */ |
| 44643 | - public static function sampleRange(): ?array { | |
| 44407 | + public static function sampleRange(): array { | |
| 44644 | 44408 | return array( |
| 44645 | 44409 | DateTimeClass::sample() /*37:*/ |
| 44646 | 44410 | ); /* 37:range*/ |
| @@ -44650,28 +44414,24 @@ class Predicate { | ||
| 44650 | 44414 | * A set of values that the `field`'s value should be a member of, |
| 44651 | 44415 | * for a data item included in the filtered data. |
| 44652 | 44416 | * |
| 44653 | - * @param ?array $value | |
| 44417 | + * @param array $value | |
| 44654 | 44418 | * @throws Exception |
| 44655 | - * @return ?array | |
| 44419 | + * @return array | |
| 44656 | 44420 | */ |
| 44657 | - public static function fromOneOf(?array $value): ?array { | |
| 44658 | - if (!is_null($value)) { | |
| 44659 | - return array_map(function ($value) { | |
| 44660 | - if (is_object($value)) { | |
| 44661 | - return DateTimeClass::from($value); /*class*/ | |
| 44662 | - } elseif (is_bool($value)) { | |
| 44663 | - return $value; /*bool*/ | |
| 44664 | - } elseif (is_float($value) || is_int($value)) { | |
| 44665 | - return $value; /*float*/ | |
| 44666 | - } elseif (is_string($value)) { | |
| 44667 | - return $value; /*string*/ | |
| 44668 | - } else { | |
| 44669 | - throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44670 | - } | |
| 44671 | - }, $value); | |
| 44672 | - } else { | |
| 44673 | - return null; | |
| 44674 | - } | |
| 44421 | + public static function fromOneOf(array $value): array { | |
| 44422 | + return array_map(function ($value) { | |
| 44423 | + if (is_object($value)) { | |
| 44424 | + return DateTimeClass::from($value); /*class*/ | |
| 44425 | + } elseif (is_bool($value)) { | |
| 44426 | + return $value; /*bool*/ | |
| 44427 | + } elseif (is_float($value) || is_int($value)) { | |
| 44428 | + return $value; /*float*/ | |
| 44429 | + } elseif (is_string($value)) { | |
| 44430 | + return $value; /*string*/ | |
| 44431 | + } else { | |
| 44432 | + throw new Exception('Cannot deserialize union value in Predicate'); | |
| 44433 | + } | |
| 44434 | + }, $value); | |
| 44675 | 44435 | } |
| 44676 | 44436 | |
| 44677 | 44437 | /** |
| @@ -44679,27 +44439,23 @@ class Predicate { | ||
| 44679 | 44439 | * for a data item included in the filtered data. |
| 44680 | 44440 | * |
| 44681 | 44441 | * @throws Exception |
| 44682 | - * @return ?array | |
| 44442 | + * @return array | |
| 44683 | 44443 | */ |
| 44684 | - public function toOneOf(): ?array { | |
| 44444 | + public function toOneOf(): array { | |
| 44685 | 44445 | if (Predicate::validateOneOf($this->oneOf)) { |
| 44686 | - if (!is_null($this->oneOf)) { | |
| 44687 | - return array_map(function ($value) { | |
| 44688 | - if ($value instanceof DateTimeClass) { | |
| 44689 | - return $value->to(); /*class*/ | |
| 44690 | - } elseif (is_bool($value)) { | |
| 44691 | - return $value; /*bool*/ | |
| 44692 | - } elseif (is_float($value) || is_int($value)) { | |
| 44693 | - return $value; /*float*/ | |
| 44694 | - } elseif (is_string($value)) { | |
| 44695 | - return $value; /*string*/ | |
| 44696 | - } else { | |
| 44697 | - throw new Exception('Union value has no matching member in Predicate'); | |
| 44698 | - } | |
| 44699 | - }, $this->oneOf); | |
| 44700 | - } else { | |
| 44701 | - return null; | |
| 44702 | - } | |
| 44446 | + return array_map(function ($value) { | |
| 44447 | + if ($value instanceof DateTimeClass) { | |
| 44448 | + return $value->to(); /*class*/ | |
| 44449 | + } elseif (is_bool($value)) { | |
| 44450 | + return $value; /*bool*/ | |
| 44451 | + } elseif (is_float($value) || is_int($value)) { | |
| 44452 | + return $value; /*float*/ | |
| 44453 | + } elseif (is_string($value)) { | |
| 44454 | + return $value; /*string*/ | |
| 44455 | + } else { | |
| 44456 | + throw new Exception('Union value has no matching member in Predicate'); | |
| 44457 | + } | |
| 44458 | + }, $this->oneOf); | |
| 44703 | 44459 | } |
| 44704 | 44460 | throw new Exception('never get to this Predicate::oneOf'); |
| 44705 | 44461 | } |
| @@ -44708,35 +44464,33 @@ class Predicate { | ||
| 44708 | 44464 | * A set of values that the `field`'s value should be a member of, |
| 44709 | 44465 | * for a data item included in the filtered data. |
| 44710 | 44466 | * |
| 44711 | - * @param array|null | |
| 44467 | + * @param array | |
| 44712 | 44468 | * @return bool |
| 44713 | 44469 | * @throws Exception |
| 44714 | 44470 | */ |
| 44715 | - public static function validateOneOf(?array $value): bool { | |
| 44716 | - if (!is_null($value)) { | |
| 44717 | - if (!is_array($value)) { | |
| 44718 | - throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44719 | - } | |
| 44720 | - array_walk($value, function($value_v) { | |
| 44721 | - if ($value_v instanceof DateTimeClass) { | |
| 44722 | - $value_v->validate(); | |
| 44723 | - } elseif (is_bool($value_v)) { | |
| 44724 | - if (!is_bool($value_v)) { | |
| 44725 | - throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44726 | - } | |
| 44727 | - } elseif (is_float($value_v) || is_int($value_v)) { | |
| 44728 | - if (!is_float($value_v) && !is_int($value_v)) { | |
| 44729 | - throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44730 | - } | |
| 44731 | - } elseif (is_string($value_v)) { | |
| 44732 | - if (!is_string($value_v)) { | |
| 44733 | - throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44734 | - } | |
| 44735 | - } else { | |
| 44471 | + public static function validateOneOf(array $value): bool { | |
| 44472 | + if (!is_array($value)) { | |
| 44473 | + throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44474 | + } | |
| 44475 | + array_walk($value, function($value_v) { | |
| 44476 | + if ($value_v instanceof DateTimeClass) { | |
| 44477 | + $value_v->validate(); | |
| 44478 | + } elseif (is_bool($value_v)) { | |
| 44479 | + if (!is_bool($value_v)) { | |
| 44736 | 44480 | throw new Exception("Attribute Error:Predicate::oneOf"); |
| 44737 | 44481 | } |
| 44738 | - }); | |
| 44739 | - } | |
| 44482 | + } elseif (is_float($value_v) || is_int($value_v)) { | |
| 44483 | + if (!is_float($value_v) && !is_int($value_v)) { | |
| 44484 | + throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44485 | + } | |
| 44486 | + } elseif (is_string($value_v)) { | |
| 44487 | + if (!is_string($value_v)) { | |
| 44488 | + throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44489 | + } | |
| 44490 | + } else { | |
| 44491 | + throw new Exception("Attribute Error:Predicate::oneOf"); | |
| 44492 | + } | |
| 44493 | + }); | |
| 44740 | 44494 | return true; |
| 44741 | 44495 | } |
| 44742 | 44496 | |
| @@ -44745,9 +44499,9 @@ class Predicate { | ||
| 44745 | 44499 | * for a data item included in the filtered data. |
| 44746 | 44500 | * |
| 44747 | 44501 | * @throws Exception |
| 44748 | - * @return ?array | |
| 44502 | + * @return array | |
| 44749 | 44503 | */ |
| 44750 | - public function getOneOf(): ?array { | |
| 44504 | + public function getOneOf(): array { | |
| 44751 | 44505 | if (Predicate::validateOneOf($this->oneOf)) { |
| 44752 | 44506 | return $this->oneOf; |
| 44753 | 44507 | } |
| @@ -44758,9 +44512,9 @@ class Predicate { | ||
| 44758 | 44512 | * A set of values that the `field`'s value should be a member of, |
| 44759 | 44513 | * for a data item included in the filtered data. |
| 44760 | 44514 | * |
| 44761 | - * @return ?array | |
| 44515 | + * @return array | |
| 44762 | 44516 | */ |
| 44763 | - public static function sampleOneOf(): ?array { | |
| 44517 | + public static function sampleOneOf(): array { | |
| 44764 | 44518 | return array( |
| 44765 | 44519 | DateTimeClass::sample() /*38:*/ |
| 44766 | 44520 | ); /* 38:oneOf*/ |
| @@ -44769,14 +44523,12 @@ class Predicate { | ||
| 44769 | 44523 | /** |
| 44770 | 44524 | * Filter using a selection name. |
| 44771 | 44525 | * |
| 44772 | - * @param stdClass|string|null $value | |
| 44526 | + * @param stdClass|string $value | |
| 44773 | 44527 | * @throws Exception |
| 44774 | - * @return Selection|string|null | |
| 44528 | + * @return Selection|string | |
| 44775 | 44529 | */ |
| 44776 | - public static function fromSelection(stdClass|string|null $value): Selection|string|null { | |
| 44777 | - if (is_null($value)) { | |
| 44778 | - return $value; /*null*/ | |
| 44779 | - } elseif (is_object($value)) { | |
| 44530 | + public static function fromSelection(stdClass|string $value): Selection|string { | |
| 44531 | + if (is_object($value)) { | |
| 44780 | 44532 | return Selection::from($value); /*class*/ |
| 44781 | 44533 | } elseif (is_string($value)) { |
| 44782 | 44534 | return $value; /*string*/ |
| @@ -44789,13 +44541,11 @@ class Predicate { | ||
| 44789 | 44541 | * Filter using a selection name. |
| 44790 | 44542 | * |
| 44791 | 44543 | * @throws Exception |
| 44792 | - * @return stdClass|string|null | |
| 44544 | + * @return stdClass|string | |
| 44793 | 44545 | */ |
| 44794 | - public function toSelection(): stdClass|string|null { | |
| 44546 | + public function toSelection(): stdClass|string { | |
| 44795 | 44547 | if (Predicate::validateSelection($this->selection)) { |
| 44796 | - if (is_null($this->selection)) { | |
| 44797 | - return $this->selection; /*null*/ | |
| 44798 | - } elseif ($this->selection instanceof Selection) { | |
| 44548 | + if ($this->selection instanceof Selection) { | |
| 44799 | 44549 | return $this->selection->to(); /*class*/ |
| 44800 | 44550 | } elseif (is_string($this->selection)) { |
| 44801 | 44551 | return $this->selection; /*string*/ |
| @@ -44809,16 +44559,12 @@ class Predicate { | ||
| 44809 | 44559 | /** |
| 44810 | 44560 | * Filter using a selection name. |
| 44811 | 44561 | * |
| 44812 | - * @param Selection|string|null | |
| 44562 | + * @param Selection|string | |
| 44813 | 44563 | * @return bool |
| 44814 | 44564 | * @throws Exception |
| 44815 | 44565 | */ |
| 44816 | - public static function validateSelection(Selection|string|null $value): bool { | |
| 44817 | - if (is_null($value)) { | |
| 44818 | - if (!is_null($value)) { | |
| 44819 | - throw new Exception("Attribute Error:Predicate::selection"); | |
| 44820 | - } | |
| 44821 | - } elseif ($value instanceof Selection) { | |
| 44566 | + public static function validateSelection(Selection|string $value): bool { | |
| 44567 | + if ($value instanceof Selection) { | |
| 44822 | 44568 | $value->validate(); |
| 44823 | 44569 | } elseif (is_string($value)) { |
| 44824 | 44570 | if (!is_string($value)) { |
| @@ -44834,9 +44580,9 @@ class Predicate { | ||
| 44834 | 44580 | * Filter using a selection name. |
| 44835 | 44581 | * |
| 44836 | 44582 | * @throws Exception |
| 44837 | - * @return Selection|string|null | |
| 44583 | + * @return Selection|string | |
| 44838 | 44584 | */ |
| 44839 | - public function getSelection(): Selection|string|null { | |
| 44585 | + public function getSelection(): Selection|string { | |
| 44840 | 44586 | if (Predicate::validateSelection($this->selection)) { |
| 44841 | 44587 | return $this->selection; |
| 44842 | 44588 | } |
| @@ -44846,9 +44592,9 @@ class Predicate { | ||
| 44846 | 44592 | /** |
| 44847 | 44593 | * Filter using a selection name. |
| 44848 | 44594 | * |
| 44849 | - * @return Selection|string|null | |
| 44595 | + * @return Selection|string | |
| 44850 | 44596 | */ |
| 44851 | - public static function sampleSelection(): Selection|string|null { | |
| 44597 | + public static function sampleSelection(): Selection|string { | |
| 44852 | 44598 | return Selection::sample(); /*39:selection*/ |
| 44853 | 44599 | } |
| 44854 | 44600 | |
| @@ -46016,9 +45762,9 @@ TimeUnit::init(); | ||
| 46016 | 45762 | // This is an autogenerated file:ConditionalPredicateMarkPropFieldDefClass |
| 46017 | 45763 | |
| 46018 | 45764 | class ConditionalPredicateMarkPropFieldDefClass { |
| 46019 | - private Predicate|string|null $test; // json:test Optional | |
| 46020 | - private bool|float|string|null $value; // json:value Optional | |
| 46021 | - private Selection|string|null $selection; // json:selection Optional | |
| 45765 | + private Predicate|string $test; // json:test Required | |
| 45766 | + private bool|float|string $value; // json:value Required | |
| 45767 | + private Selection|string $selection; // json:selection Required | |
| 46022 | 45768 | private ?AggregateOp $aggregate; // json:aggregate Optional |
| 46023 | 45769 | private BinParams|bool|null $bin; // json:bin Optional |
| 46024 | 45770 | private RepeatRef|string|null $field; // json:field Optional |
| @@ -46026,12 +45772,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46026 | 45772 | private ?Scale $scale; // json:scale Optional |
| 46027 | 45773 | private SortField|SortOrder|null $sort; // json:sort Optional |
| 46028 | 45774 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 46029 | - private ?Type $type; // json:type Optional | |
| 45775 | + private Type $type; // json:type Required | |
| 46030 | 45776 | |
| 46031 | 45777 | /** |
| 46032 | - * @param Predicate|string|null $test | |
| 46033 | - * @param bool|float|string|null $value | |
| 46034 | - * @param Selection|string|null $selection | |
| 45778 | + * @param Predicate|string $test | |
| 45779 | + * @param bool|float|string $value | |
| 45780 | + * @param Selection|string $selection | |
| 46035 | 45781 | * @param AggregateOp|null $aggregate |
| 46036 | 45782 | * @param BinParams|bool|null $bin |
| 46037 | 45783 | * @param RepeatRef|string|null $field |
| @@ -46039,9 +45785,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46039 | 45785 | * @param Scale|null $scale |
| 46040 | 45786 | * @param SortField|SortOrder|null $sort |
| 46041 | 45787 | * @param TimeUnit|null $timeUnit |
| 46042 | - * @param Type|null $type | |
| 45788 | + * @param Type $type | |
| 46043 | 45789 | */ |
| 46044 | - public function __construct(Predicate|string|null $test, bool|float|string|null $value, Selection|string|null $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, ?Type $type) { | |
| 45790 | + public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, Type $type) { | |
| 46045 | 45791 | $this->test = $test; |
| 46046 | 45792 | $this->value = $value; |
| 46047 | 45793 | $this->selection = $selection; |
| @@ -46056,14 +45802,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46056 | 45802 | } |
| 46057 | 45803 | |
| 46058 | 45804 | /** |
| 46059 | - * @param stdClass|string|null $value | |
| 45805 | + * @param stdClass|string $value | |
| 46060 | 45806 | * @throws Exception |
| 46061 | - * @return Predicate|string|null | |
| 45807 | + * @return Predicate|string | |
| 46062 | 45808 | */ |
| 46063 | - public static function fromTest(stdClass|string|null $value): Predicate|string|null { | |
| 46064 | - if (is_null($value)) { | |
| 46065 | - return $value; /*null*/ | |
| 46066 | - } elseif (is_object($value)) { | |
| 45809 | + public static function fromTest(stdClass|string $value): Predicate|string { | |
| 45810 | + if (is_object($value)) { | |
| 46067 | 45811 | return Predicate::from($value); /*class*/ |
| 46068 | 45812 | } elseif (is_string($value)) { |
| 46069 | 45813 | return $value; /*string*/ |
| @@ -46074,13 +45818,11 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46074 | 45818 | |
| 46075 | 45819 | /** |
| 46076 | 45820 | * @throws Exception |
| 46077 | - * @return stdClass|string|null | |
| 45821 | + * @return stdClass|string | |
| 46078 | 45822 | */ |
| 46079 | - public function toTest(): stdClass|string|null { | |
| 45823 | + public function toTest(): stdClass|string { | |
| 46080 | 45824 | if (ConditionalPredicateMarkPropFieldDefClass::validateTest($this->test)) { |
| 46081 | - if (is_null($this->test)) { | |
| 46082 | - return $this->test; /*null*/ | |
| 46083 | - } elseif ($this->test instanceof Predicate) { | |
| 45825 | + if ($this->test instanceof Predicate) { | |
| 46084 | 45826 | return $this->test->to(); /*class*/ |
| 46085 | 45827 | } elseif (is_string($this->test)) { |
| 46086 | 45828 | return $this->test; /*string*/ |
| @@ -46092,16 +45834,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46092 | 45834 | } |
| 46093 | 45835 | |
| 46094 | 45836 | /** |
| 46095 | - * @param Predicate|string|null | |
| 45837 | + * @param Predicate|string | |
| 46096 | 45838 | * @return bool |
| 46097 | 45839 | * @throws Exception |
| 46098 | 45840 | */ |
| 46099 | - public static function validateTest(Predicate|string|null $value): bool { | |
| 46100 | - if (is_null($value)) { | |
| 46101 | - if (!is_null($value)) { | |
| 46102 | - throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::test"); | |
| 46103 | - } | |
| 46104 | - } elseif ($value instanceof Predicate) { | |
| 45841 | + public static function validateTest(Predicate|string $value): bool { | |
| 45842 | + if ($value instanceof Predicate) { | |
| 46105 | 45843 | $value->validate(); |
| 46106 | 45844 | } elseif (is_string($value)) { |
| 46107 | 45845 | if (!is_string($value)) { |
| @@ -46115,9 +45853,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46115 | 45853 | |
| 46116 | 45854 | /** |
| 46117 | 45855 | * @throws Exception |
| 46118 | - * @return Predicate|string|null | |
| 45856 | + * @return Predicate|string | |
| 46119 | 45857 | */ |
| 46120 | - public function getTest(): Predicate|string|null { | |
| 45858 | + public function getTest(): Predicate|string { | |
| 46121 | 45859 | if (ConditionalPredicateMarkPropFieldDefClass::validateTest($this->test)) { |
| 46122 | 45860 | return $this->test; |
| 46123 | 45861 | } |
| @@ -46125,9 +45863,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46125 | 45863 | } |
| 46126 | 45864 | |
| 46127 | 45865 | /** |
| 46128 | - * @return Predicate|string|null | |
| 45866 | + * @return Predicate|string | |
| 46129 | 45867 | */ |
| 46130 | - public static function sampleTest(): Predicate|string|null { | |
| 45868 | + public static function sampleTest(): Predicate|string { | |
| 46131 | 45869 | return Predicate::sample(); /*31:test*/ |
| 46132 | 45870 | } |
| 46133 | 45871 | |
| @@ -46135,14 +45873,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46135 | 45873 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 46136 | 45874 | * `0` to `1` for opacity). |
| 46137 | 45875 | * |
| 46138 | - * @param bool|float|string|null $value | |
| 45876 | + * @param bool|float|string $value | |
| 46139 | 45877 | * @throws Exception |
| 46140 | - * @return bool|float|string|null | |
| 45878 | + * @return bool|float|string | |
| 46141 | 45879 | */ |
| 46142 | - public static function fromValue(bool|float|string|null $value): bool|float|string|null { | |
| 46143 | - if (is_null($value)) { | |
| 46144 | - return $value; /*null*/ | |
| 46145 | - } elseif (is_bool($value)) { | |
| 45880 | + public static function fromValue(bool|float|string $value): bool|float|string { | |
| 45881 | + if (is_bool($value)) { | |
| 46146 | 45882 | return $value; /*bool*/ |
| 46147 | 45883 | } elseif (is_float($value) || is_int($value)) { |
| 46148 | 45884 | return $value; /*float*/ |
| @@ -46158,13 +45894,11 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46158 | 45894 | * `0` to `1` for opacity). |
| 46159 | 45895 | * |
| 46160 | 45896 | * @throws Exception |
| 46161 | - * @return bool|float|string|null | |
| 45897 | + * @return bool|float|string | |
| 46162 | 45898 | */ |
| 46163 | - public function toValue(): bool|float|string|null { | |
| 45899 | + public function toValue(): bool|float|string { | |
| 46164 | 45900 | if (ConditionalPredicateMarkPropFieldDefClass::validateValue($this->value)) { |
| 46165 | - if (is_null($this->value)) { | |
| 46166 | - return $this->value; /*null*/ | |
| 46167 | - } elseif (is_bool($this->value)) { | |
| 45901 | + if (is_bool($this->value)) { | |
| 46168 | 45902 | return $this->value; /*bool*/ |
| 46169 | 45903 | } elseif (is_float($this->value) || is_int($this->value)) { |
| 46170 | 45904 | return $this->value; /*float*/ |
| @@ -46181,16 +45915,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46181 | 45915 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 46182 | 45916 | * `0` to `1` for opacity). |
| 46183 | 45917 | * |
| 46184 | - * @param bool|float|string|null | |
| 45918 | + * @param bool|float|string | |
| 46185 | 45919 | * @return bool |
| 46186 | 45920 | * @throws Exception |
| 46187 | 45921 | */ |
| 46188 | - public static function validateValue(bool|float|string|null $value): bool { | |
| 46189 | - if (is_null($value)) { | |
| 46190 | - if (!is_null($value)) { | |
| 46191 | - throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::value"); | |
| 46192 | - } | |
| 46193 | - } elseif (is_bool($value)) { | |
| 45922 | + public static function validateValue(bool|float|string $value): bool { | |
| 45923 | + if (is_bool($value)) { | |
| 46194 | 45924 | if (!is_bool($value)) { |
| 46195 | 45925 | throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::value"); |
| 46196 | 45926 | } |
| @@ -46213,9 +45943,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46213 | 45943 | * `0` to `1` for opacity). |
| 46214 | 45944 | * |
| 46215 | 45945 | * @throws Exception |
| 46216 | - * @return bool|float|string|null | |
| 45946 | + * @return bool|float|string | |
| 46217 | 45947 | */ |
| 46218 | - public function getValue(): bool|float|string|null { | |
| 45948 | + public function getValue(): bool|float|string { | |
| 46219 | 45949 | if (ConditionalPredicateMarkPropFieldDefClass::validateValue($this->value)) { |
| 46220 | 45950 | return $this->value; |
| 46221 | 45951 | } |
| @@ -46226,9 +45956,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46226 | 45956 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 46227 | 45957 | * `0` to `1` for opacity). |
| 46228 | 45958 | * |
| 46229 | - * @return bool|float|string|null | |
| 45959 | + * @return bool|float|string | |
| 46230 | 45960 | */ |
| 46231 | - public static function sampleValue(): bool|float|string|null { | |
| 45961 | + public static function sampleValue(): bool|float|string { | |
| 46232 | 45962 | return true; /*32:value*/ |
| 46233 | 45963 | } |
| 46234 | 45964 | |
| @@ -46236,14 +45966,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46236 | 45966 | * A [selection name](selection.html), or a series of [composed |
| 46237 | 45967 | * selections](selection.html#compose). |
| 46238 | 45968 | * |
| 46239 | - * @param stdClass|string|null $value | |
| 45969 | + * @param stdClass|string $value | |
| 46240 | 45970 | * @throws Exception |
| 46241 | - * @return Selection|string|null | |
| 45971 | + * @return Selection|string | |
| 46242 | 45972 | */ |
| 46243 | - public static function fromSelection(stdClass|string|null $value): Selection|string|null { | |
| 46244 | - if (is_null($value)) { | |
| 46245 | - return $value; /*null*/ | |
| 46246 | - } elseif (is_object($value)) { | |
| 45973 | + public static function fromSelection(stdClass|string $value): Selection|string { | |
| 45974 | + if (is_object($value)) { | |
| 46247 | 45975 | return Selection::from($value); /*class*/ |
| 46248 | 45976 | } elseif (is_string($value)) { |
| 46249 | 45977 | return $value; /*string*/ |
| @@ -46257,13 +45985,11 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46257 | 45985 | * selections](selection.html#compose). |
| 46258 | 45986 | * |
| 46259 | 45987 | * @throws Exception |
| 46260 | - * @return stdClass|string|null | |
| 45988 | + * @return stdClass|string | |
| 46261 | 45989 | */ |
| 46262 | - public function toSelection(): stdClass|string|null { | |
| 45990 | + public function toSelection(): stdClass|string { | |
| 46263 | 45991 | if (ConditionalPredicateMarkPropFieldDefClass::validateSelection($this->selection)) { |
| 46264 | - if (is_null($this->selection)) { | |
| 46265 | - return $this->selection; /*null*/ | |
| 46266 | - } elseif ($this->selection instanceof Selection) { | |
| 45992 | + if ($this->selection instanceof Selection) { | |
| 46267 | 45993 | return $this->selection->to(); /*class*/ |
| 46268 | 45994 | } elseif (is_string($this->selection)) { |
| 46269 | 45995 | return $this->selection; /*string*/ |
| @@ -46278,16 +46004,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46278 | 46004 | * A [selection name](selection.html), or a series of [composed |
| 46279 | 46005 | * selections](selection.html#compose). |
| 46280 | 46006 | * |
| 46281 | - * @param Selection|string|null | |
| 46007 | + * @param Selection|string | |
| 46282 | 46008 | * @return bool |
| 46283 | 46009 | * @throws Exception |
| 46284 | 46010 | */ |
| 46285 | - public static function validateSelection(Selection|string|null $value): bool { | |
| 46286 | - if (is_null($value)) { | |
| 46287 | - if (!is_null($value)) { | |
| 46288 | - throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::selection"); | |
| 46289 | - } | |
| 46290 | - } elseif ($value instanceof Selection) { | |
| 46011 | + public static function validateSelection(Selection|string $value): bool { | |
| 46012 | + if ($value instanceof Selection) { | |
| 46291 | 46013 | $value->validate(); |
| 46292 | 46014 | } elseif (is_string($value)) { |
| 46293 | 46015 | if (!is_string($value)) { |
| @@ -46304,9 +46026,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46304 | 46026 | * selections](selection.html#compose). |
| 46305 | 46027 | * |
| 46306 | 46028 | * @throws Exception |
| 46307 | - * @return Selection|string|null | |
| 46029 | + * @return Selection|string | |
| 46308 | 46030 | */ |
| 46309 | - public function getSelection(): Selection|string|null { | |
| 46031 | + public function getSelection(): Selection|string { | |
| 46310 | 46032 | if (ConditionalPredicateMarkPropFieldDefClass::validateSelection($this->selection)) { |
| 46311 | 46033 | return $this->selection; |
| 46312 | 46034 | } |
| @@ -46317,9 +46039,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 46317 | 46039 | * A [selection name](selection.html), or a series of [composed |
| 46318 | 46040 | * selections](selection.html#compose). |
| 46319 | 46041 | * |
| 46320 | - * @return Selection|string|null | |
| 46042 | + * @return Selection|string | |
| 46321 | 46043 | */ |
| 46322 | - public static function sampleSelection(): Selection|string|null { | |
| 46044 | + public static function sampleSelection(): Selection|string { | |
| 46323 | 46045 | return Selection::sample(); /*33:selection*/ |
| 46324 | 46046 | } |
| 46325 | 46047 | |
| @@ -47012,16 +46734,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 47012 | 46734 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 47013 | 46735 | * [geographic projection](projection.html) is applied. |
| 47014 | 46736 | * |
| 47015 | - * @param ?string $value | |
| 46737 | + * @param string $value | |
| 47016 | 46738 | * @throws Exception |
| 47017 | - * @return ?Type | |
| 46739 | + * @return Type | |
| 47018 | 46740 | */ |
| 47019 | - public static function fromType(?string $value): ?Type { | |
| 47020 | - if (!is_null($value)) { | |
| 47021 | - return Type::from($value); /*enum*/ | |
| 47022 | - } else { | |
| 47023 | - return null; | |
| 47024 | - } | |
| 46741 | + public static function fromType(string $value): Type { | |
| 46742 | + return Type::from($value); /*enum*/ | |
| 47025 | 46743 | } |
| 47026 | 46744 | |
| 47027 | 46745 | /** |
| @@ -47031,15 +46749,11 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 47031 | 46749 | * [geographic projection](projection.html) is applied. |
| 47032 | 46750 | * |
| 47033 | 46751 | * @throws Exception |
| 47034 | - * @return ?string | |
| 46752 | + * @return string | |
| 47035 | 46753 | */ |
| 47036 | - public function toType(): ?string { | |
| 46754 | + public function toType(): string { | |
| 47037 | 46755 | if (ConditionalPredicateMarkPropFieldDefClass::validateType($this->type)) { |
| 47038 | - if (!is_null($this->type)) { | |
| 47039 | - return Type::to($this->type); /*enum*/ | |
| 47040 | - } else { | |
| 47041 | - return null; | |
| 47042 | - } | |
| 46756 | + return Type::to($this->type); /*enum*/ | |
| 47043 | 46757 | } |
| 47044 | 46758 | throw new Exception('never get to this ConditionalPredicateMarkPropFieldDefClass::type'); |
| 47045 | 46759 | } |
| @@ -47050,14 +46764,12 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 47050 | 46764 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 47051 | 46765 | * [geographic projection](projection.html) is applied. |
| 47052 | 46766 | * |
| 47053 | - * @param Type|null | |
| 46767 | + * @param Type | |
| 47054 | 46768 | * @return bool |
| 47055 | 46769 | * @throws Exception |
| 47056 | 46770 | */ |
| 47057 | - public static function validateType(?Type $value): bool { | |
| 47058 | - if (!is_null($value)) { | |
| 47059 | - Type::to($value); | |
| 47060 | - } | |
| 46771 | + public static function validateType(Type $value): bool { | |
| 46772 | + Type::to($value); | |
| 47061 | 46773 | return true; |
| 47062 | 46774 | } |
| 47063 | 46775 | |
| @@ -47068,9 +46780,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 47068 | 46780 | * [geographic projection](projection.html) is applied. |
| 47069 | 46781 | * |
| 47070 | 46782 | * @throws Exception |
| 47071 | - * @return ?Type | |
| 46783 | + * @return Type | |
| 47072 | 46784 | */ |
| 47073 | - public function getType(): ?Type { | |
| 46785 | + public function getType(): Type { | |
| 47074 | 46786 | if (ConditionalPredicateMarkPropFieldDefClass::validateType($this->type)) { |
| 47075 | 46787 | return $this->type; |
| 47076 | 46788 | } |
| @@ -47083,9 +46795,9 @@ class ConditionalPredicateMarkPropFieldDefClass { | ||
| 47083 | 46795 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 47084 | 46796 | * [geographic projection](projection.html) is applied. |
| 47085 | 46797 | * |
| 47086 | - * @return ?Type | |
| 46798 | + * @return Type | |
| 47087 | 46799 | */ |
| 47088 | - public static function sampleType(): ?Type { | |
| 46800 | + public static function sampleType(): Type { | |
| 47089 | 46801 | return Type::sample(); /*enum*/ |
| 47090 | 46802 | } |
| 47091 | 46803 | |
| @@ -53576,7 +53288,7 @@ class DefWithCondition { | ||
| 53576 | 53288 | private ConditionalPredicateFieldDefClass|array|null $condition; // json:condition Optional |
| 53577 | 53289 | private RepeatRef|string|null $field; // json:field Optional |
| 53578 | 53290 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 53579 | - private ?Type $type; // json:type Optional | |
| 53291 | + private Type $type; // json:type Required | |
| 53580 | 53292 | private bool|float|string|null $value; // json:value Optional |
| 53581 | 53293 | |
| 53582 | 53294 | /** |
| @@ -53585,10 +53297,10 @@ class DefWithCondition { | ||
| 53585 | 53297 | * @param ConditionalPredicateFieldDefClass|array|null $condition |
| 53586 | 53298 | * @param RepeatRef|string|null $field |
| 53587 | 53299 | * @param TimeUnit|null $timeUnit |
| 53588 | - * @param Type|null $type | |
| 53300 | + * @param Type $type | |
| 53589 | 53301 | * @param bool|float|string|null $value |
| 53590 | 53302 | */ |
| 53591 | - public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) { | |
| 53303 | + public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?TimeUnit $timeUnit, Type $type, bool|float|string|null $value) { | |
| 53592 | 53304 | $this->aggregate = $aggregate; |
| 53593 | 53305 | $this->bin = $bin; |
| 53594 | 53306 | $this->condition = $condition; |
| @@ -54130,16 +53842,12 @@ class DefWithCondition { | ||
| 54130 | 53842 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 54131 | 53843 | * [geographic projection](projection.html) is applied. |
| 54132 | 53844 | * |
| 54133 | - * @param ?string $value | |
| 53845 | + * @param string $value | |
| 54134 | 53846 | * @throws Exception |
| 54135 | - * @return ?Type | |
| 53847 | + * @return Type | |
| 54136 | 53848 | */ |
| 54137 | - public static function fromType(?string $value): ?Type { | |
| 54138 | - if (!is_null($value)) { | |
| 54139 | - return Type::from($value); /*enum*/ | |
| 54140 | - } else { | |
| 54141 | - return null; | |
| 54142 | - } | |
| 53849 | + public static function fromType(string $value): Type { | |
| 53850 | + return Type::from($value); /*enum*/ | |
| 54143 | 53851 | } |
| 54144 | 53852 | |
| 54145 | 53853 | /** |
| @@ -54149,15 +53857,11 @@ class DefWithCondition { | ||
| 54149 | 53857 | * [geographic projection](projection.html) is applied. |
| 54150 | 53858 | * |
| 54151 | 53859 | * @throws Exception |
| 54152 | - * @return ?string | |
| 53860 | + * @return string | |
| 54153 | 53861 | */ |
| 54154 | - public function toType(): ?string { | |
| 53862 | + public function toType(): string { | |
| 54155 | 53863 | if (DefWithCondition::validateType($this->type)) { |
| 54156 | - if (!is_null($this->type)) { | |
| 54157 | - return Type::to($this->type); /*enum*/ | |
| 54158 | - } else { | |
| 54159 | - return null; | |
| 54160 | - } | |
| 53864 | + return Type::to($this->type); /*enum*/ | |
| 54161 | 53865 | } |
| 54162 | 53866 | throw new Exception('never get to this DefWithCondition::type'); |
| 54163 | 53867 | } |
| @@ -54168,14 +53872,12 @@ class DefWithCondition { | ||
| 54168 | 53872 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 54169 | 53873 | * [geographic projection](projection.html) is applied. |
| 54170 | 53874 | * |
| 54171 | - * @param Type|null | |
| 53875 | + * @param Type | |
| 54172 | 53876 | * @return bool |
| 54173 | 53877 | * @throws Exception |
| 54174 | 53878 | */ |
| 54175 | - public static function validateType(?Type $value): bool { | |
| 54176 | - if (!is_null($value)) { | |
| 54177 | - Type::to($value); | |
| 54178 | - } | |
| 53879 | + public static function validateType(Type $value): bool { | |
| 53880 | + Type::to($value); | |
| 54179 | 53881 | return true; |
| 54180 | 53882 | } |
| 54181 | 53883 | |
| @@ -54186,9 +53888,9 @@ class DefWithCondition { | ||
| 54186 | 53888 | * [geographic projection](projection.html) is applied. |
| 54187 | 53889 | * |
| 54188 | 53890 | * @throws Exception |
| 54189 | - * @return ?Type | |
| 53891 | + * @return Type | |
| 54190 | 53892 | */ |
| 54191 | - public function getType(): ?Type { | |
| 53893 | + public function getType(): Type { | |
| 54192 | 53894 | if (DefWithCondition::validateType($this->type)) { |
| 54193 | 53895 | return $this->type; |
| 54194 | 53896 | } |
| @@ -54201,9 +53903,9 @@ class DefWithCondition { | ||
| 54201 | 53903 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 54202 | 53904 | * [geographic projection](projection.html) is applied. |
| 54203 | 53905 | * |
| 54204 | - * @return ?Type | |
| 53906 | + * @return Type | |
| 54205 | 53907 | */ |
| 54206 | - public static function sampleType(): ?Type { | |
| 53908 | + public static function sampleType(): Type { | |
| 54207 | 53909 | return Type::sample(); /*enum*/ |
| 54208 | 53910 | } |
| 54209 | 53911 | |
| @@ -54369,26 +54071,26 @@ class DefWithCondition { | ||
| 54369 | 54071 | // This is an autogenerated file:ConditionalPredicateFieldDefClass |
| 54370 | 54072 | |
| 54371 | 54073 | class ConditionalPredicateFieldDefClass { |
| 54372 | - private Predicate|string|null $test; // json:test Optional | |
| 54373 | - private bool|float|string|null $value; // json:value Optional | |
| 54374 | - private Selection|string|null $selection; // json:selection Optional | |
| 54074 | + private Predicate|string $test; // json:test Required | |
| 54075 | + private bool|float|string $value; // json:value Required | |
| 54076 | + private Selection|string $selection; // json:selection Required | |
| 54375 | 54077 | private ?AggregateOp $aggregate; // json:aggregate Optional |
| 54376 | 54078 | private BinParams|bool|null $bin; // json:bin Optional |
| 54377 | 54079 | private RepeatRef|string|null $field; // json:field Optional |
| 54378 | 54080 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 54379 | - private ?Type $type; // json:type Optional | |
| 54081 | + private Type $type; // json:type Required | |
| 54380 | 54082 | |
| 54381 | 54083 | /** |
| 54382 | - * @param Predicate|string|null $test | |
| 54383 | - * @param bool|float|string|null $value | |
| 54384 | - * @param Selection|string|null $selection | |
| 54084 | + * @param Predicate|string $test | |
| 54085 | + * @param bool|float|string $value | |
| 54086 | + * @param Selection|string $selection | |
| 54385 | 54087 | * @param AggregateOp|null $aggregate |
| 54386 | 54088 | * @param BinParams|bool|null $bin |
| 54387 | 54089 | * @param RepeatRef|string|null $field |
| 54388 | 54090 | * @param TimeUnit|null $timeUnit |
| 54389 | - * @param Type|null $type | |
| 54091 | + * @param Type $type | |
| 54390 | 54092 | */ |
| 54391 | - public function __construct(Predicate|string|null $test, bool|float|string|null $value, Selection|string|null $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, ?Type $type) { | |
| 54093 | + public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, Type $type) { | |
| 54392 | 54094 | $this->test = $test; |
| 54393 | 54095 | $this->value = $value; |
| 54394 | 54096 | $this->selection = $selection; |
| @@ -54400,14 +54102,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 54400 | 54102 | } |
| 54401 | 54103 | |
| 54402 | 54104 | /** |
| 54403 | - * @param stdClass|string|null $value | |
| 54105 | + * @param stdClass|string $value | |
| 54404 | 54106 | * @throws Exception |
| 54405 | - * @return Predicate|string|null | |
| 54107 | + * @return Predicate|string | |
| 54406 | 54108 | */ |
| 54407 | - public static function fromTest(stdClass|string|null $value): Predicate|string|null { | |
| 54408 | - if (is_null($value)) { | |
| 54409 | - return $value; /*null*/ | |
| 54410 | - } elseif (is_object($value)) { | |
| 54109 | + public static function fromTest(stdClass|string $value): Predicate|string { | |
| 54110 | + if (is_object($value)) { | |
| 54411 | 54111 | return Predicate::from($value); /*class*/ |
| 54412 | 54112 | } elseif (is_string($value)) { |
| 54413 | 54113 | return $value; /*string*/ |
| @@ -54418,13 +54118,11 @@ class ConditionalPredicateFieldDefClass { | ||
| 54418 | 54118 | |
| 54419 | 54119 | /** |
| 54420 | 54120 | * @throws Exception |
| 54421 | - * @return stdClass|string|null | |
| 54121 | + * @return stdClass|string | |
| 54422 | 54122 | */ |
| 54423 | - public function toTest(): stdClass|string|null { | |
| 54123 | + public function toTest(): stdClass|string { | |
| 54424 | 54124 | if (ConditionalPredicateFieldDefClass::validateTest($this->test)) { |
| 54425 | - if (is_null($this->test)) { | |
| 54426 | - return $this->test; /*null*/ | |
| 54427 | - } elseif ($this->test instanceof Predicate) { | |
| 54125 | + if ($this->test instanceof Predicate) { | |
| 54428 | 54126 | return $this->test->to(); /*class*/ |
| 54429 | 54127 | } elseif (is_string($this->test)) { |
| 54430 | 54128 | return $this->test; /*string*/ |
| @@ -54436,16 +54134,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 54436 | 54134 | } |
| 54437 | 54135 | |
| 54438 | 54136 | /** |
| 54439 | - * @param Predicate|string|null | |
| 54137 | + * @param Predicate|string | |
| 54440 | 54138 | * @return bool |
| 54441 | 54139 | * @throws Exception |
| 54442 | 54140 | */ |
| 54443 | - public static function validateTest(Predicate|string|null $value): bool { | |
| 54444 | - if (is_null($value)) { | |
| 54445 | - if (!is_null($value)) { | |
| 54446 | - throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::test"); | |
| 54447 | - } | |
| 54448 | - } elseif ($value instanceof Predicate) { | |
| 54141 | + public static function validateTest(Predicate|string $value): bool { | |
| 54142 | + if ($value instanceof Predicate) { | |
| 54449 | 54143 | $value->validate(); |
| 54450 | 54144 | } elseif (is_string($value)) { |
| 54451 | 54145 | if (!is_string($value)) { |
| @@ -54459,9 +54153,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 54459 | 54153 | |
| 54460 | 54154 | /** |
| 54461 | 54155 | * @throws Exception |
| 54462 | - * @return Predicate|string|null | |
| 54156 | + * @return Predicate|string | |
| 54463 | 54157 | */ |
| 54464 | - public function getTest(): Predicate|string|null { | |
| 54158 | + public function getTest(): Predicate|string { | |
| 54465 | 54159 | if (ConditionalPredicateFieldDefClass::validateTest($this->test)) { |
| 54466 | 54160 | return $this->test; |
| 54467 | 54161 | } |
| @@ -54469,9 +54163,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 54469 | 54163 | } |
| 54470 | 54164 | |
| 54471 | 54165 | /** |
| 54472 | - * @return Predicate|string|null | |
| 54166 | + * @return Predicate|string | |
| 54473 | 54167 | */ |
| 54474 | - public static function sampleTest(): Predicate|string|null { | |
| 54168 | + public static function sampleTest(): Predicate|string { | |
| 54475 | 54169 | return Predicate::sample(); /*31:test*/ |
| 54476 | 54170 | } |
| 54477 | 54171 | |
| @@ -54479,14 +54173,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 54479 | 54173 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 54480 | 54174 | * `0` to `1` for opacity). |
| 54481 | 54175 | * |
| 54482 | - * @param bool|float|string|null $value | |
| 54176 | + * @param bool|float|string $value | |
| 54483 | 54177 | * @throws Exception |
| 54484 | - * @return bool|float|string|null | |
| 54178 | + * @return bool|float|string | |
| 54485 | 54179 | */ |
| 54486 | - public static function fromValue(bool|float|string|null $value): bool|float|string|null { | |
| 54487 | - if (is_null($value)) { | |
| 54488 | - return $value; /*null*/ | |
| 54489 | - } elseif (is_bool($value)) { | |
| 54180 | + public static function fromValue(bool|float|string $value): bool|float|string { | |
| 54181 | + if (is_bool($value)) { | |
| 54490 | 54182 | return $value; /*bool*/ |
| 54491 | 54183 | } elseif (is_float($value) || is_int($value)) { |
| 54492 | 54184 | return $value; /*float*/ |
| @@ -54502,13 +54194,11 @@ class ConditionalPredicateFieldDefClass { | ||
| 54502 | 54194 | * `0` to `1` for opacity). |
| 54503 | 54195 | * |
| 54504 | 54196 | * @throws Exception |
| 54505 | - * @return bool|float|string|null | |
| 54197 | + * @return bool|float|string | |
| 54506 | 54198 | */ |
| 54507 | - public function toValue(): bool|float|string|null { | |
| 54199 | + public function toValue(): bool|float|string { | |
| 54508 | 54200 | if (ConditionalPredicateFieldDefClass::validateValue($this->value)) { |
| 54509 | - if (is_null($this->value)) { | |
| 54510 | - return $this->value; /*null*/ | |
| 54511 | - } elseif (is_bool($this->value)) { | |
| 54201 | + if (is_bool($this->value)) { | |
| 54512 | 54202 | return $this->value; /*bool*/ |
| 54513 | 54203 | } elseif (is_float($this->value) || is_int($this->value)) { |
| 54514 | 54204 | return $this->value; /*float*/ |
| @@ -54525,16 +54215,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 54525 | 54215 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 54526 | 54216 | * `0` to `1` for opacity). |
| 54527 | 54217 | * |
| 54528 | - * @param bool|float|string|null | |
| 54218 | + * @param bool|float|string | |
| 54529 | 54219 | * @return bool |
| 54530 | 54220 | * @throws Exception |
| 54531 | 54221 | */ |
| 54532 | - public static function validateValue(bool|float|string|null $value): bool { | |
| 54533 | - if (is_null($value)) { | |
| 54534 | - if (!is_null($value)) { | |
| 54535 | - throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::value"); | |
| 54536 | - } | |
| 54537 | - } elseif (is_bool($value)) { | |
| 54222 | + public static function validateValue(bool|float|string $value): bool { | |
| 54223 | + if (is_bool($value)) { | |
| 54538 | 54224 | if (!is_bool($value)) { |
| 54539 | 54225 | throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::value"); |
| 54540 | 54226 | } |
| @@ -54557,9 +54243,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 54557 | 54243 | * `0` to `1` for opacity). |
| 54558 | 54244 | * |
| 54559 | 54245 | * @throws Exception |
| 54560 | - * @return bool|float|string|null | |
| 54246 | + * @return bool|float|string | |
| 54561 | 54247 | */ |
| 54562 | - public function getValue(): bool|float|string|null { | |
| 54248 | + public function getValue(): bool|float|string { | |
| 54563 | 54249 | if (ConditionalPredicateFieldDefClass::validateValue($this->value)) { |
| 54564 | 54250 | return $this->value; |
| 54565 | 54251 | } |
| @@ -54570,9 +54256,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 54570 | 54256 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 54571 | 54257 | * `0` to `1` for opacity). |
| 54572 | 54258 | * |
| 54573 | - * @return bool|float|string|null | |
| 54259 | + * @return bool|float|string | |
| 54574 | 54260 | */ |
| 54575 | - public static function sampleValue(): bool|float|string|null { | |
| 54261 | + public static function sampleValue(): bool|float|string { | |
| 54576 | 54262 | return true; /*32:value*/ |
| 54577 | 54263 | } |
| 54578 | 54264 | |
| @@ -54580,14 +54266,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 54580 | 54266 | * A [selection name](selection.html), or a series of [composed |
| 54581 | 54267 | * selections](selection.html#compose). |
| 54582 | 54268 | * |
| 54583 | - * @param stdClass|string|null $value | |
| 54269 | + * @param stdClass|string $value | |
| 54584 | 54270 | * @throws Exception |
| 54585 | - * @return Selection|string|null | |
| 54271 | + * @return Selection|string | |
| 54586 | 54272 | */ |
| 54587 | - public static function fromSelection(stdClass|string|null $value): Selection|string|null { | |
| 54588 | - if (is_null($value)) { | |
| 54589 | - return $value; /*null*/ | |
| 54590 | - } elseif (is_object($value)) { | |
| 54273 | + public static function fromSelection(stdClass|string $value): Selection|string { | |
| 54274 | + if (is_object($value)) { | |
| 54591 | 54275 | return Selection::from($value); /*class*/ |
| 54592 | 54276 | } elseif (is_string($value)) { |
| 54593 | 54277 | return $value; /*string*/ |
| @@ -54601,13 +54285,11 @@ class ConditionalPredicateFieldDefClass { | ||
| 54601 | 54285 | * selections](selection.html#compose). |
| 54602 | 54286 | * |
| 54603 | 54287 | * @throws Exception |
| 54604 | - * @return stdClass|string|null | |
| 54288 | + * @return stdClass|string | |
| 54605 | 54289 | */ |
| 54606 | - public function toSelection(): stdClass|string|null { | |
| 54290 | + public function toSelection(): stdClass|string { | |
| 54607 | 54291 | if (ConditionalPredicateFieldDefClass::validateSelection($this->selection)) { |
| 54608 | - if (is_null($this->selection)) { | |
| 54609 | - return $this->selection; /*null*/ | |
| 54610 | - } elseif ($this->selection instanceof Selection) { | |
| 54292 | + if ($this->selection instanceof Selection) { | |
| 54611 | 54293 | return $this->selection->to(); /*class*/ |
| 54612 | 54294 | } elseif (is_string($this->selection)) { |
| 54613 | 54295 | return $this->selection; /*string*/ |
| @@ -54622,16 +54304,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 54622 | 54304 | * A [selection name](selection.html), or a series of [composed |
| 54623 | 54305 | * selections](selection.html#compose). |
| 54624 | 54306 | * |
| 54625 | - * @param Selection|string|null | |
| 54307 | + * @param Selection|string | |
| 54626 | 54308 | * @return bool |
| 54627 | 54309 | * @throws Exception |
| 54628 | 54310 | */ |
| 54629 | - public static function validateSelection(Selection|string|null $value): bool { | |
| 54630 | - if (is_null($value)) { | |
| 54631 | - if (!is_null($value)) { | |
| 54632 | - throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::selection"); | |
| 54633 | - } | |
| 54634 | - } elseif ($value instanceof Selection) { | |
| 54311 | + public static function validateSelection(Selection|string $value): bool { | |
| 54312 | + if ($value instanceof Selection) { | |
| 54635 | 54313 | $value->validate(); |
| 54636 | 54314 | } elseif (is_string($value)) { |
| 54637 | 54315 | if (!is_string($value)) { |
| @@ -54648,9 +54326,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 54648 | 54326 | * selections](selection.html#compose). |
| 54649 | 54327 | * |
| 54650 | 54328 | * @throws Exception |
| 54651 | - * @return Selection|string|null | |
| 54329 | + * @return Selection|string | |
| 54652 | 54330 | */ |
| 54653 | - public function getSelection(): Selection|string|null { | |
| 54331 | + public function getSelection(): Selection|string { | |
| 54654 | 54332 | if (ConditionalPredicateFieldDefClass::validateSelection($this->selection)) { |
| 54655 | 54333 | return $this->selection; |
| 54656 | 54334 | } |
| @@ -54661,9 +54339,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 54661 | 54339 | * A [selection name](selection.html), or a series of [composed |
| 54662 | 54340 | * selections](selection.html#compose). |
| 54663 | 54341 | * |
| 54664 | - * @return Selection|string|null | |
| 54342 | + * @return Selection|string | |
| 54665 | 54343 | */ |
| 54666 | - public static function sampleSelection(): Selection|string|null { | |
| 54344 | + public static function sampleSelection(): Selection|string { | |
| 54667 | 54345 | return Selection::sample(); /*33:selection*/ |
| 54668 | 54346 | } |
| 54669 | 54347 | |
| @@ -55076,16 +54754,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 55076 | 54754 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 55077 | 54755 | * [geographic projection](projection.html) is applied. |
| 55078 | 54756 | * |
| 55079 | - * @param ?string $value | |
| 54757 | + * @param string $value | |
| 55080 | 54758 | * @throws Exception |
| 55081 | - * @return ?Type | |
| 54759 | + * @return Type | |
| 55082 | 54760 | */ |
| 55083 | - public static function fromType(?string $value): ?Type { | |
| 55084 | - if (!is_null($value)) { | |
| 55085 | - return Type::from($value); /*enum*/ | |
| 55086 | - } else { | |
| 55087 | - return null; | |
| 55088 | - } | |
| 54761 | + public static function fromType(string $value): Type { | |
| 54762 | + return Type::from($value); /*enum*/ | |
| 55089 | 54763 | } |
| 55090 | 54764 | |
| 55091 | 54765 | /** |
| @@ -55095,15 +54769,11 @@ class ConditionalPredicateFieldDefClass { | ||
| 55095 | 54769 | * [geographic projection](projection.html) is applied. |
| 55096 | 54770 | * |
| 55097 | 54771 | * @throws Exception |
| 55098 | - * @return ?string | |
| 54772 | + * @return string | |
| 55099 | 54773 | */ |
| 55100 | - public function toType(): ?string { | |
| 54774 | + public function toType(): string { | |
| 55101 | 54775 | if (ConditionalPredicateFieldDefClass::validateType($this->type)) { |
| 55102 | - if (!is_null($this->type)) { | |
| 55103 | - return Type::to($this->type); /*enum*/ | |
| 55104 | - } else { | |
| 55105 | - return null; | |
| 55106 | - } | |
| 54776 | + return Type::to($this->type); /*enum*/ | |
| 55107 | 54777 | } |
| 55108 | 54778 | throw new Exception('never get to this ConditionalPredicateFieldDefClass::type'); |
| 55109 | 54779 | } |
| @@ -55114,14 +54784,12 @@ class ConditionalPredicateFieldDefClass { | ||
| 55114 | 54784 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 55115 | 54785 | * [geographic projection](projection.html) is applied. |
| 55116 | 54786 | * |
| 55117 | - * @param Type|null | |
| 54787 | + * @param Type | |
| 55118 | 54788 | * @return bool |
| 55119 | 54789 | * @throws Exception |
| 55120 | 54790 | */ |
| 55121 | - public static function validateType(?Type $value): bool { | |
| 55122 | - if (!is_null($value)) { | |
| 55123 | - Type::to($value); | |
| 55124 | - } | |
| 54791 | + public static function validateType(Type $value): bool { | |
| 54792 | + Type::to($value); | |
| 55125 | 54793 | return true; |
| 55126 | 54794 | } |
| 55127 | 54795 | |
| @@ -55132,9 +54800,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 55132 | 54800 | * [geographic projection](projection.html) is applied. |
| 55133 | 54801 | * |
| 55134 | 54802 | * @throws Exception |
| 55135 | - * @return ?Type | |
| 54803 | + * @return Type | |
| 55136 | 54804 | */ |
| 55137 | - public function getType(): ?Type { | |
| 54805 | + public function getType(): Type { | |
| 55138 | 54806 | if (ConditionalPredicateFieldDefClass::validateType($this->type)) { |
| 55139 | 54807 | return $this->type; |
| 55140 | 54808 | } |
| @@ -55147,9 +54815,9 @@ class ConditionalPredicateFieldDefClass { | ||
| 55147 | 54815 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 55148 | 54816 | * [geographic projection](projection.html) is applied. |
| 55149 | 54817 | * |
| 55150 | - * @return ?Type | |
| 54818 | + * @return Type | |
| 55151 | 54819 | */ |
| 55152 | - public static function sampleType(): ?Type { | |
| 54820 | + public static function sampleType(): Type { | |
| 55153 | 54821 | return Type::sample(); /*enum*/ |
| 55154 | 54822 | } |
| 55155 | 54823 | |
| @@ -55859,7 +55527,7 @@ class TextDefWithCondition { | ||
| 55859 | 55527 | private RepeatRef|string|null $field; // json:field Optional |
| 55860 | 55528 | private ?string $format; // json:format Optional |
| 55861 | 55529 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 55862 | - private ?Type $type; // json:type Optional | |
| 55530 | + private Type $type; // json:type Required | |
| 55863 | 55531 | private bool|float|string|null $value; // json:value Optional |
| 55864 | 55532 | |
| 55865 | 55533 | /** |
| @@ -55869,10 +55537,10 @@ class TextDefWithCondition { | ||
| 55869 | 55537 | * @param RepeatRef|string|null $field |
| 55870 | 55538 | * @param string|null $format |
| 55871 | 55539 | * @param TimeUnit|null $timeUnit |
| 55872 | - * @param Type|null $type | |
| 55540 | + * @param Type $type | |
| 55873 | 55541 | * @param bool|float|string|null $value |
| 55874 | 55542 | */ |
| 55875 | - public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateTextFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) { | |
| 55543 | + public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateTextFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, Type $type, bool|float|string|null $value) { | |
| 55876 | 55544 | $this->aggregate = $aggregate; |
| 55877 | 55545 | $this->bin = $bin; |
| 55878 | 55546 | $this->condition = $condition; |
| @@ -56487,16 +56155,12 @@ class TextDefWithCondition { | ||
| 56487 | 56155 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 56488 | 56156 | * [geographic projection](projection.html) is applied. |
| 56489 | 56157 | * |
| 56490 | - * @param ?string $value | |
| 56158 | + * @param string $value | |
| 56491 | 56159 | * @throws Exception |
| 56492 | - * @return ?Type | |
| 56160 | + * @return Type | |
| 56493 | 56161 | */ |
| 56494 | - public static function fromType(?string $value): ?Type { | |
| 56495 | - if (!is_null($value)) { | |
| 56496 | - return Type::from($value); /*enum*/ | |
| 56497 | - } else { | |
| 56498 | - return null; | |
| 56499 | - } | |
| 56162 | + public static function fromType(string $value): Type { | |
| 56163 | + return Type::from($value); /*enum*/ | |
| 56500 | 56164 | } |
| 56501 | 56165 | |
| 56502 | 56166 | /** |
| @@ -56506,15 +56170,11 @@ class TextDefWithCondition { | ||
| 56506 | 56170 | * [geographic projection](projection.html) is applied. |
| 56507 | 56171 | * |
| 56508 | 56172 | * @throws Exception |
| 56509 | - * @return ?string | |
| 56173 | + * @return string | |
| 56510 | 56174 | */ |
| 56511 | - public function toType(): ?string { | |
| 56175 | + public function toType(): string { | |
| 56512 | 56176 | if (TextDefWithCondition::validateType($this->type)) { |
| 56513 | - if (!is_null($this->type)) { | |
| 56514 | - return Type::to($this->type); /*enum*/ | |
| 56515 | - } else { | |
| 56516 | - return null; | |
| 56517 | - } | |
| 56177 | + return Type::to($this->type); /*enum*/ | |
| 56518 | 56178 | } |
| 56519 | 56179 | throw new Exception('never get to this TextDefWithCondition::type'); |
| 56520 | 56180 | } |
| @@ -56525,14 +56185,12 @@ class TextDefWithCondition { | ||
| 56525 | 56185 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 56526 | 56186 | * [geographic projection](projection.html) is applied. |
| 56527 | 56187 | * |
| 56528 | - * @param Type|null | |
| 56188 | + * @param Type | |
| 56529 | 56189 | * @return bool |
| 56530 | 56190 | * @throws Exception |
| 56531 | 56191 | */ |
| 56532 | - public static function validateType(?Type $value): bool { | |
| 56533 | - if (!is_null($value)) { | |
| 56534 | - Type::to($value); | |
| 56535 | - } | |
| 56192 | + public static function validateType(Type $value): bool { | |
| 56193 | + Type::to($value); | |
| 56536 | 56194 | return true; |
| 56537 | 56195 | } |
| 56538 | 56196 | |
| @@ -56543,9 +56201,9 @@ class TextDefWithCondition { | ||
| 56543 | 56201 | * [geographic projection](projection.html) is applied. |
| 56544 | 56202 | * |
| 56545 | 56203 | * @throws Exception |
| 56546 | - * @return ?Type | |
| 56204 | + * @return Type | |
| 56547 | 56205 | */ |
| 56548 | - public function getType(): ?Type { | |
| 56206 | + public function getType(): Type { | |
| 56549 | 56207 | if (TextDefWithCondition::validateType($this->type)) { |
| 56550 | 56208 | return $this->type; |
| 56551 | 56209 | } |
| @@ -56558,9 +56216,9 @@ class TextDefWithCondition { | ||
| 56558 | 56216 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 56559 | 56217 | * [geographic projection](projection.html) is applied. |
| 56560 | 56218 | * |
| 56561 | - * @return ?Type | |
| 56219 | + * @return Type | |
| 56562 | 56220 | */ |
| 56563 | - public static function sampleType(): ?Type { | |
| 56221 | + public static function sampleType(): Type { | |
| 56564 | 56222 | return Type::sample(); /*enum*/ |
| 56565 | 56223 | } |
| 56566 | 56224 | |
| @@ -56730,28 +56388,28 @@ class TextDefWithCondition { | ||
| 56730 | 56388 | // This is an autogenerated file:ConditionalPredicateTextFieldDefClass |
| 56731 | 56389 | |
| 56732 | 56390 | class ConditionalPredicateTextFieldDefClass { |
| 56733 | - private Predicate|string|null $test; // json:test Optional | |
| 56734 | - private bool|float|string|null $value; // json:value Optional | |
| 56735 | - private Selection|string|null $selection; // json:selection Optional | |
| 56391 | + private Predicate|string $test; // json:test Required | |
| 56392 | + private bool|float|string $value; // json:value Required | |
| 56393 | + private Selection|string $selection; // json:selection Required | |
| 56736 | 56394 | private ?AggregateOp $aggregate; // json:aggregate Optional |
| 56737 | 56395 | private BinParams|bool|null $bin; // json:bin Optional |
| 56738 | 56396 | private RepeatRef|string|null $field; // json:field Optional |
| 56739 | 56397 | private ?string $format; // json:format Optional |
| 56740 | 56398 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 56741 | - private ?Type $type; // json:type Optional | |
| 56399 | + private Type $type; // json:type Required | |
| 56742 | 56400 | |
| 56743 | 56401 | /** |
| 56744 | - * @param Predicate|string|null $test | |
| 56745 | - * @param bool|float|string|null $value | |
| 56746 | - * @param Selection|string|null $selection | |
| 56402 | + * @param Predicate|string $test | |
| 56403 | + * @param bool|float|string $value | |
| 56404 | + * @param Selection|string $selection | |
| 56747 | 56405 | * @param AggregateOp|null $aggregate |
| 56748 | 56406 | * @param BinParams|bool|null $bin |
| 56749 | 56407 | * @param RepeatRef|string|null $field |
| 56750 | 56408 | * @param string|null $format |
| 56751 | 56409 | * @param TimeUnit|null $timeUnit |
| 56752 | - * @param Type|null $type | |
| 56410 | + * @param Type $type | |
| 56753 | 56411 | */ |
| 56754 | - public function __construct(Predicate|string|null $test, bool|float|string|null $value, Selection|string|null $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, ?Type $type) { | |
| 56412 | + public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, Type $type) { | |
| 56755 | 56413 | $this->test = $test; |
| 56756 | 56414 | $this->value = $value; |
| 56757 | 56415 | $this->selection = $selection; |
| @@ -56764,14 +56422,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56764 | 56422 | } |
| 56765 | 56423 | |
| 56766 | 56424 | /** |
| 56767 | - * @param stdClass|string|null $value | |
| 56425 | + * @param stdClass|string $value | |
| 56768 | 56426 | * @throws Exception |
| 56769 | - * @return Predicate|string|null | |
| 56427 | + * @return Predicate|string | |
| 56770 | 56428 | */ |
| 56771 | - public static function fromTest(stdClass|string|null $value): Predicate|string|null { | |
| 56772 | - if (is_null($value)) { | |
| 56773 | - return $value; /*null*/ | |
| 56774 | - } elseif (is_object($value)) { | |
| 56429 | + public static function fromTest(stdClass|string $value): Predicate|string { | |
| 56430 | + if (is_object($value)) { | |
| 56775 | 56431 | return Predicate::from($value); /*class*/ |
| 56776 | 56432 | } elseif (is_string($value)) { |
| 56777 | 56433 | return $value; /*string*/ |
| @@ -56782,13 +56438,11 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56782 | 56438 | |
| 56783 | 56439 | /** |
| 56784 | 56440 | * @throws Exception |
| 56785 | - * @return stdClass|string|null | |
| 56441 | + * @return stdClass|string | |
| 56786 | 56442 | */ |
| 56787 | - public function toTest(): stdClass|string|null { | |
| 56443 | + public function toTest(): stdClass|string { | |
| 56788 | 56444 | if (ConditionalPredicateTextFieldDefClass::validateTest($this->test)) { |
| 56789 | - if (is_null($this->test)) { | |
| 56790 | - return $this->test; /*null*/ | |
| 56791 | - } elseif ($this->test instanceof Predicate) { | |
| 56445 | + if ($this->test instanceof Predicate) { | |
| 56792 | 56446 | return $this->test->to(); /*class*/ |
| 56793 | 56447 | } elseif (is_string($this->test)) { |
| 56794 | 56448 | return $this->test; /*string*/ |
| @@ -56800,16 +56454,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56800 | 56454 | } |
| 56801 | 56455 | |
| 56802 | 56456 | /** |
| 56803 | - * @param Predicate|string|null | |
| 56457 | + * @param Predicate|string | |
| 56804 | 56458 | * @return bool |
| 56805 | 56459 | * @throws Exception |
| 56806 | 56460 | */ |
| 56807 | - public static function validateTest(Predicate|string|null $value): bool { | |
| 56808 | - if (is_null($value)) { | |
| 56809 | - if (!is_null($value)) { | |
| 56810 | - throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::test"); | |
| 56811 | - } | |
| 56812 | - } elseif ($value instanceof Predicate) { | |
| 56461 | + public static function validateTest(Predicate|string $value): bool { | |
| 56462 | + if ($value instanceof Predicate) { | |
| 56813 | 56463 | $value->validate(); |
| 56814 | 56464 | } elseif (is_string($value)) { |
| 56815 | 56465 | if (!is_string($value)) { |
| @@ -56823,9 +56473,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56823 | 56473 | |
| 56824 | 56474 | /** |
| 56825 | 56475 | * @throws Exception |
| 56826 | - * @return Predicate|string|null | |
| 56476 | + * @return Predicate|string | |
| 56827 | 56477 | */ |
| 56828 | - public function getTest(): Predicate|string|null { | |
| 56478 | + public function getTest(): Predicate|string { | |
| 56829 | 56479 | if (ConditionalPredicateTextFieldDefClass::validateTest($this->test)) { |
| 56830 | 56480 | return $this->test; |
| 56831 | 56481 | } |
| @@ -56833,9 +56483,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56833 | 56483 | } |
| 56834 | 56484 | |
| 56835 | 56485 | /** |
| 56836 | - * @return Predicate|string|null | |
| 56486 | + * @return Predicate|string | |
| 56837 | 56487 | */ |
| 56838 | - public static function sampleTest(): Predicate|string|null { | |
| 56488 | + public static function sampleTest(): Predicate|string { | |
| 56839 | 56489 | return Predicate::sample(); /*31:test*/ |
| 56840 | 56490 | } |
| 56841 | 56491 | |
| @@ -56843,14 +56493,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56843 | 56493 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 56844 | 56494 | * `0` to `1` for opacity). |
| 56845 | 56495 | * |
| 56846 | - * @param bool|float|string|null $value | |
| 56496 | + * @param bool|float|string $value | |
| 56847 | 56497 | * @throws Exception |
| 56848 | - * @return bool|float|string|null | |
| 56498 | + * @return bool|float|string | |
| 56849 | 56499 | */ |
| 56850 | - public static function fromValue(bool|float|string|null $value): bool|float|string|null { | |
| 56851 | - if (is_null($value)) { | |
| 56852 | - return $value; /*null*/ | |
| 56853 | - } elseif (is_bool($value)) { | |
| 56500 | + public static function fromValue(bool|float|string $value): bool|float|string { | |
| 56501 | + if (is_bool($value)) { | |
| 56854 | 56502 | return $value; /*bool*/ |
| 56855 | 56503 | } elseif (is_float($value) || is_int($value)) { |
| 56856 | 56504 | return $value; /*float*/ |
| @@ -56866,13 +56514,11 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56866 | 56514 | * `0` to `1` for opacity). |
| 56867 | 56515 | * |
| 56868 | 56516 | * @throws Exception |
| 56869 | - * @return bool|float|string|null | |
| 56517 | + * @return bool|float|string | |
| 56870 | 56518 | */ |
| 56871 | - public function toValue(): bool|float|string|null { | |
| 56519 | + public function toValue(): bool|float|string { | |
| 56872 | 56520 | if (ConditionalPredicateTextFieldDefClass::validateValue($this->value)) { |
| 56873 | - if (is_null($this->value)) { | |
| 56874 | - return $this->value; /*null*/ | |
| 56875 | - } elseif (is_bool($this->value)) { | |
| 56521 | + if (is_bool($this->value)) { | |
| 56876 | 56522 | return $this->value; /*bool*/ |
| 56877 | 56523 | } elseif (is_float($this->value) || is_int($this->value)) { |
| 56878 | 56524 | return $this->value; /*float*/ |
| @@ -56889,16 +56535,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56889 | 56535 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 56890 | 56536 | * `0` to `1` for opacity). |
| 56891 | 56537 | * |
| 56892 | - * @param bool|float|string|null | |
| 56538 | + * @param bool|float|string | |
| 56893 | 56539 | * @return bool |
| 56894 | 56540 | * @throws Exception |
| 56895 | 56541 | */ |
| 56896 | - public static function validateValue(bool|float|string|null $value): bool { | |
| 56897 | - if (is_null($value)) { | |
| 56898 | - if (!is_null($value)) { | |
| 56899 | - throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::value"); | |
| 56900 | - } | |
| 56901 | - } elseif (is_bool($value)) { | |
| 56542 | + public static function validateValue(bool|float|string $value): bool { | |
| 56543 | + if (is_bool($value)) { | |
| 56902 | 56544 | if (!is_bool($value)) { |
| 56903 | 56545 | throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::value"); |
| 56904 | 56546 | } |
| @@ -56921,9 +56563,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56921 | 56563 | * `0` to `1` for opacity). |
| 56922 | 56564 | * |
| 56923 | 56565 | * @throws Exception |
| 56924 | - * @return bool|float|string|null | |
| 56566 | + * @return bool|float|string | |
| 56925 | 56567 | */ |
| 56926 | - public function getValue(): bool|float|string|null { | |
| 56568 | + public function getValue(): bool|float|string { | |
| 56927 | 56569 | if (ConditionalPredicateTextFieldDefClass::validateValue($this->value)) { |
| 56928 | 56570 | return $this->value; |
| 56929 | 56571 | } |
| @@ -56934,9 +56576,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56934 | 56576 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 56935 | 56577 | * `0` to `1` for opacity). |
| 56936 | 56578 | * |
| 56937 | - * @return bool|float|string|null | |
| 56579 | + * @return bool|float|string | |
| 56938 | 56580 | */ |
| 56939 | - public static function sampleValue(): bool|float|string|null { | |
| 56581 | + public static function sampleValue(): bool|float|string { | |
| 56940 | 56582 | return true; /*32:value*/ |
| 56941 | 56583 | } |
| 56942 | 56584 | |
| @@ -56944,14 +56586,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56944 | 56586 | * A [selection name](selection.html), or a series of [composed |
| 56945 | 56587 | * selections](selection.html#compose). |
| 56946 | 56588 | * |
| 56947 | - * @param stdClass|string|null $value | |
| 56589 | + * @param stdClass|string $value | |
| 56948 | 56590 | * @throws Exception |
| 56949 | - * @return Selection|string|null | |
| 56591 | + * @return Selection|string | |
| 56950 | 56592 | */ |
| 56951 | - public static function fromSelection(stdClass|string|null $value): Selection|string|null { | |
| 56952 | - if (is_null($value)) { | |
| 56953 | - return $value; /*null*/ | |
| 56954 | - } elseif (is_object($value)) { | |
| 56593 | + public static function fromSelection(stdClass|string $value): Selection|string { | |
| 56594 | + if (is_object($value)) { | |
| 56955 | 56595 | return Selection::from($value); /*class*/ |
| 56956 | 56596 | } elseif (is_string($value)) { |
| 56957 | 56597 | return $value; /*string*/ |
| @@ -56965,13 +56605,11 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56965 | 56605 | * selections](selection.html#compose). |
| 56966 | 56606 | * |
| 56967 | 56607 | * @throws Exception |
| 56968 | - * @return stdClass|string|null | |
| 56608 | + * @return stdClass|string | |
| 56969 | 56609 | */ |
| 56970 | - public function toSelection(): stdClass|string|null { | |
| 56610 | + public function toSelection(): stdClass|string { | |
| 56971 | 56611 | if (ConditionalPredicateTextFieldDefClass::validateSelection($this->selection)) { |
| 56972 | - if (is_null($this->selection)) { | |
| 56973 | - return $this->selection; /*null*/ | |
| 56974 | - } elseif ($this->selection instanceof Selection) { | |
| 56612 | + if ($this->selection instanceof Selection) { | |
| 56975 | 56613 | return $this->selection->to(); /*class*/ |
| 56976 | 56614 | } elseif (is_string($this->selection)) { |
| 56977 | 56615 | return $this->selection; /*string*/ |
| @@ -56986,16 +56624,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 56986 | 56624 | * A [selection name](selection.html), or a series of [composed |
| 56987 | 56625 | * selections](selection.html#compose). |
| 56988 | 56626 | * |
| 56989 | - * @param Selection|string|null | |
| 56627 | + * @param Selection|string | |
| 56990 | 56628 | * @return bool |
| 56991 | 56629 | * @throws Exception |
| 56992 | 56630 | */ |
| 56993 | - public static function validateSelection(Selection|string|null $value): bool { | |
| 56994 | - if (is_null($value)) { | |
| 56995 | - if (!is_null($value)) { | |
| 56996 | - throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::selection"); | |
| 56997 | - } | |
| 56998 | - } elseif ($value instanceof Selection) { | |
| 56631 | + public static function validateSelection(Selection|string $value): bool { | |
| 56632 | + if ($value instanceof Selection) { | |
| 56999 | 56633 | $value->validate(); |
| 57000 | 56634 | } elseif (is_string($value)) { |
| 57001 | 56635 | if (!is_string($value)) { |
| @@ -57012,9 +56646,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57012 | 56646 | * selections](selection.html#compose). |
| 57013 | 56647 | * |
| 57014 | 56648 | * @throws Exception |
| 57015 | - * @return Selection|string|null | |
| 56649 | + * @return Selection|string | |
| 57016 | 56650 | */ |
| 57017 | - public function getSelection(): Selection|string|null { | |
| 56651 | + public function getSelection(): Selection|string { | |
| 57018 | 56652 | if (ConditionalPredicateTextFieldDefClass::validateSelection($this->selection)) { |
| 57019 | 56653 | return $this->selection; |
| 57020 | 56654 | } |
| @@ -57025,9 +56659,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57025 | 56659 | * A [selection name](selection.html), or a series of [composed |
| 57026 | 56660 | * selections](selection.html#compose). |
| 57027 | 56661 | * |
| 57028 | - * @return Selection|string|null | |
| 56662 | + * @return Selection|string | |
| 57029 | 56663 | */ |
| 57030 | - public static function sampleSelection(): Selection|string|null { | |
| 56664 | + public static function sampleSelection(): Selection|string { | |
| 57031 | 56665 | return Selection::sample(); /*33:selection*/ |
| 57032 | 56666 | } |
| 57033 | 56667 | |
| @@ -57512,16 +57146,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57512 | 57146 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 57513 | 57147 | * [geographic projection](projection.html) is applied. |
| 57514 | 57148 | * |
| 57515 | - * @param ?string $value | |
| 57149 | + * @param string $value | |
| 57516 | 57150 | * @throws Exception |
| 57517 | - * @return ?Type | |
| 57151 | + * @return Type | |
| 57518 | 57152 | */ |
| 57519 | - public static function fromType(?string $value): ?Type { | |
| 57520 | - if (!is_null($value)) { | |
| 57521 | - return Type::from($value); /*enum*/ | |
| 57522 | - } else { | |
| 57523 | - return null; | |
| 57524 | - } | |
| 57153 | + public static function fromType(string $value): Type { | |
| 57154 | + return Type::from($value); /*enum*/ | |
| 57525 | 57155 | } |
| 57526 | 57156 | |
| 57527 | 57157 | /** |
| @@ -57531,15 +57161,11 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57531 | 57161 | * [geographic projection](projection.html) is applied. |
| 57532 | 57162 | * |
| 57533 | 57163 | * @throws Exception |
| 57534 | - * @return ?string | |
| 57164 | + * @return string | |
| 57535 | 57165 | */ |
| 57536 | - public function toType(): ?string { | |
| 57166 | + public function toType(): string { | |
| 57537 | 57167 | if (ConditionalPredicateTextFieldDefClass::validateType($this->type)) { |
| 57538 | - if (!is_null($this->type)) { | |
| 57539 | - return Type::to($this->type); /*enum*/ | |
| 57540 | - } else { | |
| 57541 | - return null; | |
| 57542 | - } | |
| 57168 | + return Type::to($this->type); /*enum*/ | |
| 57543 | 57169 | } |
| 57544 | 57170 | throw new Exception('never get to this ConditionalPredicateTextFieldDefClass::type'); |
| 57545 | 57171 | } |
| @@ -57550,14 +57176,12 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57550 | 57176 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 57551 | 57177 | * [geographic projection](projection.html) is applied. |
| 57552 | 57178 | * |
| 57553 | - * @param Type|null | |
| 57179 | + * @param Type | |
| 57554 | 57180 | * @return bool |
| 57555 | 57181 | * @throws Exception |
| 57556 | 57182 | */ |
| 57557 | - public static function validateType(?Type $value): bool { | |
| 57558 | - if (!is_null($value)) { | |
| 57559 | - Type::to($value); | |
| 57560 | - } | |
| 57183 | + public static function validateType(Type $value): bool { | |
| 57184 | + Type::to($value); | |
| 57561 | 57185 | return true; |
| 57562 | 57186 | } |
| 57563 | 57187 | |
| @@ -57568,9 +57192,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57568 | 57192 | * [geographic projection](projection.html) is applied. |
| 57569 | 57193 | * |
| 57570 | 57194 | * @throws Exception |
| 57571 | - * @return ?Type | |
| 57195 | + * @return Type | |
| 57572 | 57196 | */ |
| 57573 | - public function getType(): ?Type { | |
| 57197 | + public function getType(): Type { | |
| 57574 | 57198 | if (ConditionalPredicateTextFieldDefClass::validateType($this->type)) { |
| 57575 | 57199 | return $this->type; |
| 57576 | 57200 | } |
| @@ -57583,9 +57207,9 @@ class ConditionalPredicateTextFieldDefClass { | ||
| 57583 | 57207 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 57584 | 57208 | * [geographic projection](projection.html) is applied. |
| 57585 | 57209 | * |
| 57586 | - * @return ?Type | |
| 57210 | + * @return Type | |
| 57587 | 57211 | */ |
| 57588 | - public static function sampleType(): ?Type { | |
| 57212 | + public static function sampleType(): Type { | |
| 57589 | 57213 | return Type::sample(); /*enum*/ |
| 57590 | 57214 | } |
| 57591 | 57215 | |
| @@ -57671,8 +57295,8 @@ class XClass { | ||
| 57671 | 57295 | private SortField|SortOrder|null $sort; // json:sort Optional |
| 57672 | 57296 | private ?StackOffset $stack; // json:stack Optional |
| 57673 | 57297 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 57674 | - private ?Type $type; // json:type Optional | |
| 57675 | - private bool|float|string|null $value; // json:value Optional | |
| 57298 | + private Type $type; // json:type Required | |
| 57299 | + private bool|float|string $value; // json:value Required | |
| 57676 | 57300 | |
| 57677 | 57301 | /** |
| 57678 | 57302 | * @param AggregateOp|null $aggregate |
| @@ -57683,10 +57307,10 @@ class XClass { | ||
| 57683 | 57307 | * @param SortField|SortOrder|null $sort |
| 57684 | 57308 | * @param StackOffset|null $stack |
| 57685 | 57309 | * @param TimeUnit|null $timeUnit |
| 57686 | - * @param Type|null $type | |
| 57687 | - * @param bool|float|string|null $value | |
| 57310 | + * @param Type $type | |
| 57311 | + * @param bool|float|string $value | |
| 57688 | 57312 | */ |
| 57689 | - public function __construct(?AggregateOp $aggregate, ?Axis $axis, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Scale $scale, SortField|SortOrder|null $sort, ?StackOffset $stack, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) { | |
| 57313 | + public function __construct(?AggregateOp $aggregate, ?Axis $axis, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Scale $scale, SortField|SortOrder|null $sort, ?StackOffset $stack, ?TimeUnit $timeUnit, Type $type, bool|float|string $value) { | |
| 57690 | 57314 | $this->aggregate = $aggregate; |
| 57691 | 57315 | $this->axis = $axis; |
| 57692 | 57316 | $this->bin = $bin; |
| @@ -58551,16 +58175,12 @@ class XClass { | ||
| 58551 | 58175 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 58552 | 58176 | * [geographic projection](projection.html) is applied. |
| 58553 | 58177 | * |
| 58554 | - * @param ?string $value | |
| 58178 | + * @param string $value | |
| 58555 | 58179 | * @throws Exception |
| 58556 | - * @return ?Type | |
| 58180 | + * @return Type | |
| 58557 | 58181 | */ |
| 58558 | - public static function fromType(?string $value): ?Type { | |
| 58559 | - if (!is_null($value)) { | |
| 58560 | - return Type::from($value); /*enum*/ | |
| 58561 | - } else { | |
| 58562 | - return null; | |
| 58563 | - } | |
| 58182 | + public static function fromType(string $value): Type { | |
| 58183 | + return Type::from($value); /*enum*/ | |
| 58564 | 58184 | } |
| 58565 | 58185 | |
| 58566 | 58186 | /** |
| @@ -58570,15 +58190,11 @@ class XClass { | ||
| 58570 | 58190 | * [geographic projection](projection.html) is applied. |
| 58571 | 58191 | * |
| 58572 | 58192 | * @throws Exception |
| 58573 | - * @return ?string | |
| 58193 | + * @return string | |
| 58574 | 58194 | */ |
| 58575 | - public function toType(): ?string { | |
| 58195 | + public function toType(): string { | |
| 58576 | 58196 | if (XClass::validateType($this->type)) { |
| 58577 | - if (!is_null($this->type)) { | |
| 58578 | - return Type::to($this->type); /*enum*/ | |
| 58579 | - } else { | |
| 58580 | - return null; | |
| 58581 | - } | |
| 58197 | + return Type::to($this->type); /*enum*/ | |
| 58582 | 58198 | } |
| 58583 | 58199 | throw new Exception('never get to this XClass::type'); |
| 58584 | 58200 | } |
| @@ -58589,14 +58205,12 @@ class XClass { | ||
| 58589 | 58205 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 58590 | 58206 | * [geographic projection](projection.html) is applied. |
| 58591 | 58207 | * |
| 58592 | - * @param Type|null | |
| 58208 | + * @param Type | |
| 58593 | 58209 | * @return bool |
| 58594 | 58210 | * @throws Exception |
| 58595 | 58211 | */ |
| 58596 | - public static function validateType(?Type $value): bool { | |
| 58597 | - if (!is_null($value)) { | |
| 58598 | - Type::to($value); | |
| 58599 | - } | |
| 58212 | + public static function validateType(Type $value): bool { | |
| 58213 | + Type::to($value); | |
| 58600 | 58214 | return true; |
| 58601 | 58215 | } |
| 58602 | 58216 | |
| @@ -58607,9 +58221,9 @@ class XClass { | ||
| 58607 | 58221 | * [geographic projection](projection.html) is applied. |
| 58608 | 58222 | * |
| 58609 | 58223 | * @throws Exception |
| 58610 | - * @return ?Type | |
| 58224 | + * @return Type | |
| 58611 | 58225 | */ |
| 58612 | - public function getType(): ?Type { | |
| 58226 | + public function getType(): Type { | |
| 58613 | 58227 | if (XClass::validateType($this->type)) { |
| 58614 | 58228 | return $this->type; |
| 58615 | 58229 | } |
| @@ -58622,9 +58236,9 @@ class XClass { | ||
| 58622 | 58236 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 58623 | 58237 | * [geographic projection](projection.html) is applied. |
| 58624 | 58238 | * |
| 58625 | - * @return ?Type | |
| 58239 | + * @return Type | |
| 58626 | 58240 | */ |
| 58627 | - public static function sampleType(): ?Type { | |
| 58241 | + public static function sampleType(): Type { | |
| 58628 | 58242 | return Type::sample(); /*enum*/ |
| 58629 | 58243 | } |
| 58630 | 58244 | |
| @@ -58632,14 +58246,12 @@ class XClass { | ||
| 58632 | 58246 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 58633 | 58247 | * `0` to `1` for opacity). |
| 58634 | 58248 | * |
| 58635 | - * @param bool|float|string|null $value | |
| 58249 | + * @param bool|float|string $value | |
| 58636 | 58250 | * @throws Exception |
| 58637 | - * @return bool|float|string|null | |
| 58251 | + * @return bool|float|string | |
| 58638 | 58252 | */ |
| 58639 | - public static function fromValue(bool|float|string|null $value): bool|float|string|null { | |
| 58640 | - if (is_null($value)) { | |
| 58641 | - return $value; /*null*/ | |
| 58642 | - } elseif (is_bool($value)) { | |
| 58253 | + public static function fromValue(bool|float|string $value): bool|float|string { | |
| 58254 | + if (is_bool($value)) { | |
| 58643 | 58255 | return $value; /*bool*/ |
| 58644 | 58256 | } elseif (is_float($value) || is_int($value)) { |
| 58645 | 58257 | return $value; /*float*/ |
| @@ -58655,13 +58267,11 @@ class XClass { | ||
| 58655 | 58267 | * `0` to `1` for opacity). |
| 58656 | 58268 | * |
| 58657 | 58269 | * @throws Exception |
| 58658 | - * @return bool|float|string|null | |
| 58270 | + * @return bool|float|string | |
| 58659 | 58271 | */ |
| 58660 | - public function toValue(): bool|float|string|null { | |
| 58272 | + public function toValue(): bool|float|string { | |
| 58661 | 58273 | if (XClass::validateValue($this->value)) { |
| 58662 | - if (is_null($this->value)) { | |
| 58663 | - return $this->value; /*null*/ | |
| 58664 | - } elseif (is_bool($this->value)) { | |
| 58274 | + if (is_bool($this->value)) { | |
| 58665 | 58275 | return $this->value; /*bool*/ |
| 58666 | 58276 | } elseif (is_float($this->value) || is_int($this->value)) { |
| 58667 | 58277 | return $this->value; /*float*/ |
| @@ -58678,16 +58288,12 @@ class XClass { | ||
| 58678 | 58288 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 58679 | 58289 | * `0` to `1` for opacity). |
| 58680 | 58290 | * |
| 58681 | - * @param bool|float|string|null | |
| 58291 | + * @param bool|float|string | |
| 58682 | 58292 | * @return bool |
| 58683 | 58293 | * @throws Exception |
| 58684 | 58294 | */ |
| 58685 | - public static function validateValue(bool|float|string|null $value): bool { | |
| 58686 | - if (is_null($value)) { | |
| 58687 | - if (!is_null($value)) { | |
| 58688 | - throw new Exception("Attribute Error:XClass::value"); | |
| 58689 | - } | |
| 58690 | - } elseif (is_bool($value)) { | |
| 58295 | + public static function validateValue(bool|float|string $value): bool { | |
| 58296 | + if (is_bool($value)) { | |
| 58691 | 58297 | if (!is_bool($value)) { |
| 58692 | 58298 | throw new Exception("Attribute Error:XClass::value"); |
| 58693 | 58299 | } |
| @@ -58710,9 +58316,9 @@ class XClass { | ||
| 58710 | 58316 | * `0` to `1` for opacity). |
| 58711 | 58317 | * |
| 58712 | 58318 | * @throws Exception |
| 58713 | - * @return bool|float|string|null | |
| 58319 | + * @return bool|float|string | |
| 58714 | 58320 | */ |
| 58715 | - public function getValue(): bool|float|string|null { | |
| 58321 | + public function getValue(): bool|float|string { | |
| 58716 | 58322 | if (XClass::validateValue($this->value)) { |
| 58717 | 58323 | return $this->value; |
| 58718 | 58324 | } |
| @@ -58723,9 +58329,9 @@ class XClass { | ||
| 58723 | 58329 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 58724 | 58330 | * `0` to `1` for opacity). |
| 58725 | 58331 | * |
| 58726 | - * @return bool|float|string|null | |
| 58332 | + * @return bool|float|string | |
| 58727 | 58333 | */ |
| 58728 | - public static function sampleValue(): bool|float|string|null { | |
| 58334 | + public static function sampleValue(): bool|float|string { | |
| 58729 | 58335 | return true; /*40:value*/ |
| 58730 | 58336 | } |
| 58731 | 58337 | |
| @@ -60957,18 +60563,18 @@ class X2Class { | ||
| 60957 | 60563 | private BinParams|bool|null $bin; // json:bin Optional |
| 60958 | 60564 | private RepeatRef|string|null $field; // json:field Optional |
| 60959 | 60565 | private ?TimeUnit $timeUnit; // json:timeUnit Optional |
| 60960 | - private ?Type $type; // json:type Optional | |
| 60961 | - private bool|float|string|null $value; // json:value Optional | |
| 60566 | + private Type $type; // json:type Required | |
| 60567 | + private bool|float|string $value; // json:value Required | |
| 60962 | 60568 | |
| 60963 | 60569 | /** |
| 60964 | 60570 | * @param AggregateOp|null $aggregate |
| 60965 | 60571 | * @param BinParams|bool|null $bin |
| 60966 | 60572 | * @param RepeatRef|string|null $field |
| 60967 | 60573 | * @param TimeUnit|null $timeUnit |
| 60968 | - * @param Type|null $type | |
| 60969 | - * @param bool|float|string|null $value | |
| 60574 | + * @param Type $type | |
| 60575 | + * @param bool|float|string $value | |
| 60970 | 60576 | */ |
| 60971 | - public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) { | |
| 60577 | + public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, Type $type, bool|float|string $value) { | |
| 60972 | 60578 | $this->aggregate = $aggregate; |
| 60973 | 60579 | $this->bin = $bin; |
| 60974 | 60580 | $this->field = $field; |
| @@ -61386,16 +60992,12 @@ class X2Class { | ||
| 61386 | 60992 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 61387 | 60993 | * [geographic projection](projection.html) is applied. |
| 61388 | 60994 | * |
| 61389 | - * @param ?string $value | |
| 60995 | + * @param string $value | |
| 61390 | 60996 | * @throws Exception |
| 61391 | - * @return ?Type | |
| 60997 | + * @return Type | |
| 61392 | 60998 | */ |
| 61393 | - public static function fromType(?string $value): ?Type { | |
| 61394 | - if (!is_null($value)) { | |
| 61395 | - return Type::from($value); /*enum*/ | |
| 61396 | - } else { | |
| 61397 | - return null; | |
| 61398 | - } | |
| 60999 | + public static function fromType(string $value): Type { | |
| 61000 | + return Type::from($value); /*enum*/ | |
| 61399 | 61001 | } |
| 61400 | 61002 | |
| 61401 | 61003 | /** |
| @@ -61405,15 +61007,11 @@ class X2Class { | ||
| 61405 | 61007 | * [geographic projection](projection.html) is applied. |
| 61406 | 61008 | * |
| 61407 | 61009 | * @throws Exception |
| 61408 | - * @return ?string | |
| 61010 | + * @return string | |
| 61409 | 61011 | */ |
| 61410 | - public function toType(): ?string { | |
| 61012 | + public function toType(): string { | |
| 61411 | 61013 | if (X2Class::validateType($this->type)) { |
| 61412 | - if (!is_null($this->type)) { | |
| 61413 | - return Type::to($this->type); /*enum*/ | |
| 61414 | - } else { | |
| 61415 | - return null; | |
| 61416 | - } | |
| 61014 | + return Type::to($this->type); /*enum*/ | |
| 61417 | 61015 | } |
| 61418 | 61016 | throw new Exception('never get to this X2Class::type'); |
| 61419 | 61017 | } |
| @@ -61424,14 +61022,12 @@ class X2Class { | ||
| 61424 | 61022 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 61425 | 61023 | * [geographic projection](projection.html) is applied. |
| 61426 | 61024 | * |
| 61427 | - * @param Type|null | |
| 61025 | + * @param Type | |
| 61428 | 61026 | * @return bool |
| 61429 | 61027 | * @throws Exception |
| 61430 | 61028 | */ |
| 61431 | - public static function validateType(?Type $value): bool { | |
| 61432 | - if (!is_null($value)) { | |
| 61433 | - Type::to($value); | |
| 61434 | - } | |
| 61029 | + public static function validateType(Type $value): bool { | |
| 61030 | + Type::to($value); | |
| 61435 | 61031 | return true; |
| 61436 | 61032 | } |
| 61437 | 61033 | |
| @@ -61442,9 +61038,9 @@ class X2Class { | ||
| 61442 | 61038 | * [geographic projection](projection.html) is applied. |
| 61443 | 61039 | * |
| 61444 | 61040 | * @throws Exception |
| 61445 | - * @return ?Type | |
| 61041 | + * @return Type | |
| 61446 | 61042 | */ |
| 61447 | - public function getType(): ?Type { | |
| 61043 | + public function getType(): Type { | |
| 61448 | 61044 | if (X2Class::validateType($this->type)) { |
| 61449 | 61045 | return $this->type; |
| 61450 | 61046 | } |
| @@ -61457,9 +61053,9 @@ class X2Class { | ||
| 61457 | 61053 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 61458 | 61054 | * [geographic projection](projection.html) is applied. |
| 61459 | 61055 | * |
| 61460 | - * @return ?Type | |
| 61056 | + * @return Type | |
| 61461 | 61057 | */ |
| 61462 | - public static function sampleType(): ?Type { | |
| 61058 | + public static function sampleType(): Type { | |
| 61463 | 61059 | return Type::sample(); /*enum*/ |
| 61464 | 61060 | } |
| 61465 | 61061 | |
| @@ -61467,14 +61063,12 @@ class X2Class { | ||
| 61467 | 61063 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 61468 | 61064 | * `0` to `1` for opacity). |
| 61469 | 61065 | * |
| 61470 | - * @param bool|float|string|null $value | |
| 61066 | + * @param bool|float|string $value | |
| 61471 | 61067 | * @throws Exception |
| 61472 | - * @return bool|float|string|null | |
| 61068 | + * @return bool|float|string | |
| 61473 | 61069 | */ |
| 61474 | - public static function fromValue(bool|float|string|null $value): bool|float|string|null { | |
| 61475 | - if (is_null($value)) { | |
| 61476 | - return $value; /*null*/ | |
| 61477 | - } elseif (is_bool($value)) { | |
| 61070 | + public static function fromValue(bool|float|string $value): bool|float|string { | |
| 61071 | + if (is_bool($value)) { | |
| 61478 | 61072 | return $value; /*bool*/ |
| 61479 | 61073 | } elseif (is_float($value) || is_int($value)) { |
| 61480 | 61074 | return $value; /*float*/ |
| @@ -61490,13 +61084,11 @@ class X2Class { | ||
| 61490 | 61084 | * `0` to `1` for opacity). |
| 61491 | 61085 | * |
| 61492 | 61086 | * @throws Exception |
| 61493 | - * @return bool|float|string|null | |
| 61087 | + * @return bool|float|string | |
| 61494 | 61088 | */ |
| 61495 | - public function toValue(): bool|float|string|null { | |
| 61089 | + public function toValue(): bool|float|string { | |
| 61496 | 61090 | if (X2Class::validateValue($this->value)) { |
| 61497 | - if (is_null($this->value)) { | |
| 61498 | - return $this->value; /*null*/ | |
| 61499 | - } elseif (is_bool($this->value)) { | |
| 61091 | + if (is_bool($this->value)) { | |
| 61500 | 61092 | return $this->value; /*bool*/ |
| 61501 | 61093 | } elseif (is_float($this->value) || is_int($this->value)) { |
| 61502 | 61094 | return $this->value; /*float*/ |
| @@ -61513,16 +61105,12 @@ class X2Class { | ||
| 61513 | 61105 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 61514 | 61106 | * `0` to `1` for opacity). |
| 61515 | 61107 | * |
| 61516 | - * @param bool|float|string|null | |
| 61108 | + * @param bool|float|string | |
| 61517 | 61109 | * @return bool |
| 61518 | 61110 | * @throws Exception |
| 61519 | 61111 | */ |
| 61520 | - public static function validateValue(bool|float|string|null $value): bool { | |
| 61521 | - if (is_null($value)) { | |
| 61522 | - if (!is_null($value)) { | |
| 61523 | - throw new Exception("Attribute Error:X2Class::value"); | |
| 61524 | - } | |
| 61525 | - } elseif (is_bool($value)) { | |
| 61112 | + public static function validateValue(bool|float|string $value): bool { | |
| 61113 | + if (is_bool($value)) { | |
| 61526 | 61114 | if (!is_bool($value)) { |
| 61527 | 61115 | throw new Exception("Attribute Error:X2Class::value"); |
| 61528 | 61116 | } |
| @@ -61545,9 +61133,9 @@ class X2Class { | ||
| 61545 | 61133 | * `0` to `1` for opacity). |
| 61546 | 61134 | * |
| 61547 | 61135 | * @throws Exception |
| 61548 | - * @return bool|float|string|null | |
| 61136 | + * @return bool|float|string | |
| 61549 | 61137 | */ |
| 61550 | - public function getValue(): bool|float|string|null { | |
| 61138 | + public function getValue(): bool|float|string { | |
| 61551 | 61139 | if (X2Class::validateValue($this->value)) { |
| 61552 | 61140 | return $this->value; |
| 61553 | 61141 | } |
| @@ -61558,9 +61146,9 @@ class X2Class { | ||
| 61558 | 61146 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 61559 | 61147 | * `0` to `1` for opacity). |
| 61560 | 61148 | * |
| 61561 | - * @return bool|float|string|null | |
| 61149 | + * @return bool|float|string | |
| 61562 | 61150 | */ |
| 61563 | - public static function sampleValue(): bool|float|string|null { | |
| 61151 | + public static function sampleValue(): bool|float|string { | |
| 61564 | 61152 | return true; /*36:value*/ |
| 61565 | 61153 | } |
| 61566 | 61154 | |
| @@ -61823,43 +61411,43 @@ class Spec { | ||
| 61823 | 61411 | private ?Data $data; // json:data Optional |
| 61824 | 61412 | private ?string $description; // json:description Optional |
| 61825 | 61413 | private ?float $height; // json:height Optional |
| 61826 | - private ?array $layer; // json:layer Optional | |
| 61414 | + private array $layer; // json:layer Required | |
| 61827 | 61415 | private ?string $name; // json:name Optional |
| 61828 | 61416 | private ?Resolve $resolve; // json:resolve Optional |
| 61829 | 61417 | private TitleParams|string|null $title; // json:title Optional |
| 61830 | 61418 | private ?array $transform; // json:transform Optional |
| 61831 | 61419 | private ?float $width; // json:width Optional |
| 61832 | - private ?Encoding $encoding; // json:encoding Optional | |
| 61833 | - private MarkDef|Mark|null $mark; // json:mark Optional | |
| 61420 | + private Encoding $encoding; // json:encoding Required | |
| 61421 | + private MarkDef|Mark $mark; // json:mark Required | |
| 61834 | 61422 | private ?Projection $projection; // json:projection Optional |
| 61835 | 61423 | private ?stdClass $selection; // json:selection Optional |
| 61836 | - private ?FacetMapping $facet; // json:facet Optional | |
| 61837 | - private ?Spec $spec; // json:spec Optional | |
| 61838 | - private ?Repeat $repeat; // json:repeat Optional | |
| 61839 | - private ?array $vconcat; // json:vconcat Optional | |
| 61840 | - private ?array $hconcat; // json:hconcat Optional | |
| 61424 | + private FacetMapping $facet; // json:facet Required | |
| 61425 | + private Spec $spec; // json:spec Required | |
| 61426 | + private Repeat $repeat; // json:repeat Required | |
| 61427 | + private array $vconcat; // json:vconcat Required | |
| 61428 | + private array $hconcat; // json:hconcat Required | |
| 61841 | 61429 | |
| 61842 | 61430 | /** |
| 61843 | 61431 | * @param Data|null $data |
| 61844 | 61432 | * @param string|null $description |
| 61845 | 61433 | * @param float|null $height |
| 61846 | - * @param array|null $layer | |
| 61434 | + * @param array $layer | |
| 61847 | 61435 | * @param string|null $name |
| 61848 | 61436 | * @param Resolve|null $resolve |
| 61849 | 61437 | * @param TitleParams|string|null $title |
| 61850 | 61438 | * @param array|null $transform |
| 61851 | 61439 | * @param float|null $width |
| 61852 | - * @param Encoding|null $encoding | |
| 61853 | - * @param MarkDef|Mark|null $mark | |
| 61440 | + * @param Encoding $encoding | |
| 61441 | + * @param MarkDef|Mark $mark | |
| 61854 | 61442 | * @param Projection|null $projection |
| 61855 | 61443 | * @param stdClass|null $selection |
| 61856 | - * @param FacetMapping|null $facet | |
| 61857 | - * @param Spec|null $spec | |
| 61858 | - * @param Repeat|null $repeat | |
| 61859 | - * @param array|null $vconcat | |
| 61860 | - * @param array|null $hconcat | |
| 61444 | + * @param FacetMapping $facet | |
| 61445 | + * @param Spec $spec | |
| 61446 | + * @param Repeat $repeat | |
| 61447 | + * @param array $vconcat | |
| 61448 | + * @param array $hconcat | |
| 61861 | 61449 | */ |
| 61862 | - public function __construct(?Data $data, ?string $description, ?float $height, ?array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, ?Encoding $encoding, MarkDef|Mark|null $mark, ?Projection $projection, ?stdClass $selection, ?FacetMapping $facet, ?Spec $spec, ?Repeat $repeat, ?array $vconcat, ?array $hconcat) { | |
| 61450 | + public function __construct(?Data $data, ?string $description, ?float $height, array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, Encoding $encoding, MarkDef|Mark $mark, ?Projection $projection, ?stdClass $selection, FacetMapping $facet, Spec $spec, Repeat $repeat, array $vconcat, array $hconcat) { | |
| 61863 | 61451 | $this->data = $data; |
| 61864 | 61452 | $this->description = $description; |
| 61865 | 61453 | $this->height = $height; |
| @@ -62168,18 +61756,14 @@ class Spec { | ||
| 62168 | 61756 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 62169 | 61757 | * layering facet specifications is not allowed. |
| 62170 | 61758 | * |
| 62171 | - * @param ?array $value | |
| 61759 | + * @param array $value | |
| 62172 | 61760 | * @throws Exception |
| 62173 | - * @return ?array | |
| 61761 | + * @return array | |
| 62174 | 61762 | */ |
| 62175 | - public static function fromLayer(?array $value): ?array { | |
| 62176 | - if (!is_null($value)) { | |
| 62177 | - return array_map(function ($value) { | |
| 62178 | - return LayerSpec::from($value); /*class*/ | |
| 62179 | - }, $value); | |
| 62180 | - } else { | |
| 62181 | - return null; | |
| 62182 | - } | |
| 61763 | + public static function fromLayer(array $value): array { | |
| 61764 | + return array_map(function ($value) { | |
| 61765 | + return LayerSpec::from($value); /*class*/ | |
| 61766 | + }, $value); | |
| 62183 | 61767 | } |
| 62184 | 61768 | |
| 62185 | 61769 | /** |
| @@ -62189,17 +61773,13 @@ class Spec { | ||
| 62189 | 61773 | * layering facet specifications is not allowed. |
| 62190 | 61774 | * |
| 62191 | 61775 | * @throws Exception |
| 62192 | - * @return ?array | |
| 61776 | + * @return array | |
| 62193 | 61777 | */ |
| 62194 | - public function toLayer(): ?array { | |
| 61778 | + public function toLayer(): array { | |
| 62195 | 61779 | if (Spec::validateLayer($this->layer)) { |
| 62196 | - if (!is_null($this->layer)) { | |
| 62197 | - return array_map(function ($value) { | |
| 62198 | - return $value->to(); /*class*/ | |
| 62199 | - }, $this->layer); | |
| 62200 | - } else { | |
| 62201 | - return null; | |
| 62202 | - } | |
| 61780 | + return array_map(function ($value) { | |
| 61781 | + return $value->to(); /*class*/ | |
| 61782 | + }, $this->layer); | |
| 62203 | 61783 | } |
| 62204 | 61784 | throw new Exception('never get to this Spec::layer'); |
| 62205 | 61785 | } |
| @@ -62210,19 +61790,17 @@ class Spec { | ||
| 62210 | 61790 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 62211 | 61791 | * layering facet specifications is not allowed. |
| 62212 | 61792 | * |
| 62213 | - * @param array|null | |
| 61793 | + * @param array | |
| 62214 | 61794 | * @return bool |
| 62215 | 61795 | * @throws Exception |
| 62216 | 61796 | */ |
| 62217 | - public static function validateLayer(?array $value): bool { | |
| 62218 | - if (!is_null($value)) { | |
| 62219 | - if (!is_array($value)) { | |
| 62220 | - throw new Exception("Attribute Error:Spec::layer"); | |
| 62221 | - } | |
| 62222 | - array_walk($value, function($value_v) { | |
| 62223 | - $value_v->validate(); | |
| 62224 | - }); | |
| 61797 | + public static function validateLayer(array $value): bool { | |
| 61798 | + if (!is_array($value)) { | |
| 61799 | + throw new Exception("Attribute Error:Spec::layer"); | |
| 62225 | 61800 | } |
| 61801 | + array_walk($value, function($value_v) { | |
| 61802 | + $value_v->validate(); | |
| 61803 | + }); | |
| 62226 | 61804 | return true; |
| 62227 | 61805 | } |
| 62228 | 61806 | |
| @@ -62233,9 +61811,9 @@ class Spec { | ||
| 62233 | 61811 | * layering facet specifications is not allowed. |
| 62234 | 61812 | * |
| 62235 | 61813 | * @throws Exception |
| 62236 | - * @return ?array | |
| 61814 | + * @return array | |
| 62237 | 61815 | */ |
| 62238 | - public function getLayer(): ?array { | |
| 61816 | + public function getLayer(): array { | |
| 62239 | 61817 | if (Spec::validateLayer($this->layer)) { |
| 62240 | 61818 | return $this->layer; |
| 62241 | 61819 | } |
| @@ -62248,9 +61826,9 @@ class Spec { | ||
| 62248 | 61826 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 62249 | 61827 | * layering facet specifications is not allowed. |
| 62250 | 61828 | * |
| 62251 | - * @return ?array | |
| 61829 | + * @return array | |
| 62252 | 61830 | */ |
| 62253 | - public static function sampleLayer(): ?array { | |
| 61831 | + public static function sampleLayer(): array { | |
| 62254 | 61832 | return array( |
| 62255 | 61833 | LayerSpec::sample() /*34:*/ |
| 62256 | 61834 | ); /* 34:layer*/ |
| @@ -62761,31 +62339,23 @@ class Spec { | ||
| 62761 | 62339 | /** |
| 62762 | 62340 | * A key-value mapping between encoding channels and definition of fields. |
| 62763 | 62341 | * |
| 62764 | - * @param ?stdClass $value | |
| 62342 | + * @param stdClass $value | |
| 62765 | 62343 | * @throws Exception |
| 62766 | - * @return ?Encoding | |
| 62344 | + * @return Encoding | |
| 62767 | 62345 | */ |
| 62768 | - public static function fromEncoding(?stdClass $value): ?Encoding { | |
| 62769 | - if (!is_null($value)) { | |
| 62770 | - return Encoding::from($value); /*class*/ | |
| 62771 | - } else { | |
| 62772 | - return null; | |
| 62773 | - } | |
| 62346 | + public static function fromEncoding(stdClass $value): Encoding { | |
| 62347 | + return Encoding::from($value); /*class*/ | |
| 62774 | 62348 | } |
| 62775 | 62349 | |
| 62776 | 62350 | /** |
| 62777 | 62351 | * A key-value mapping between encoding channels and definition of fields. |
| 62778 | 62352 | * |
| 62779 | 62353 | * @throws Exception |
| 62780 | - * @return ?stdClass | |
| 62354 | + * @return stdClass | |
| 62781 | 62355 | */ |
| 62782 | - public function toEncoding(): ?stdClass { | |
| 62356 | + public function toEncoding(): stdClass { | |
| 62783 | 62357 | if (Spec::validateEncoding($this->encoding)) { |
| 62784 | - if (!is_null($this->encoding)) { | |
| 62785 | - return $this->encoding->to(); /*class*/ | |
| 62786 | - } else { | |
| 62787 | - return null; | |
| 62788 | - } | |
| 62358 | + return $this->encoding->to(); /*class*/ | |
| 62789 | 62359 | } |
| 62790 | 62360 | throw new Exception('never get to this Spec::encoding'); |
| 62791 | 62361 | } |
| @@ -62793,14 +62363,12 @@ class Spec { | ||
| 62793 | 62363 | /** |
| 62794 | 62364 | * A key-value mapping between encoding channels and definition of fields. |
| 62795 | 62365 | * |
| 62796 | - * @param Encoding|null | |
| 62366 | + * @param Encoding | |
| 62797 | 62367 | * @return bool |
| 62798 | 62368 | * @throws Exception |
| 62799 | 62369 | */ |
| 62800 | - public static function validateEncoding(?Encoding $value): bool { | |
| 62801 | - if (!is_null($value)) { | |
| 62802 | - $value->validate(); | |
| 62803 | - } | |
| 62370 | + public static function validateEncoding(Encoding $value): bool { | |
| 62371 | + $value->validate(); | |
| 62804 | 62372 | return true; |
| 62805 | 62373 | } |
| 62806 | 62374 | |
| @@ -62808,9 +62376,9 @@ class Spec { | ||
| 62808 | 62376 | * A key-value mapping between encoding channels and definition of fields. |
| 62809 | 62377 | * |
| 62810 | 62378 | * @throws Exception |
| 62811 | - * @return ?Encoding | |
| 62379 | + * @return Encoding | |
| 62812 | 62380 | */ |
| 62813 | - public function getEncoding(): ?Encoding { | |
| 62381 | + public function getEncoding(): Encoding { | |
| 62814 | 62382 | if (Spec::validateEncoding($this->encoding)) { |
| 62815 | 62383 | return $this->encoding; |
| 62816 | 62384 | } |
| @@ -62820,9 +62388,9 @@ class Spec { | ||
| 62820 | 62388 | /** |
| 62821 | 62389 | * A key-value mapping between encoding channels and definition of fields. |
| 62822 | 62390 | * |
| 62823 | - * @return ?Encoding | |
| 62391 | + * @return Encoding | |
| 62824 | 62392 | */ |
| 62825 | - public static function sampleEncoding(): ?Encoding { | |
| 62393 | + public static function sampleEncoding(): Encoding { | |
| 62826 | 62394 | return Encoding::sample(); /*40:encoding*/ |
| 62827 | 62395 | } |
| 62828 | 62396 | |
| @@ -62832,14 +62400,12 @@ class Spec { | ||
| 62832 | 62400 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 62833 | 62401 | * object](mark.html#mark-def). |
| 62834 | 62402 | * |
| 62835 | - * @param stdClass|string|null $value | |
| 62403 | + * @param stdClass|string $value | |
| 62836 | 62404 | * @throws Exception |
| 62837 | - * @return MarkDef|Mark|null | |
| 62405 | + * @return MarkDef|Mark | |
| 62838 | 62406 | */ |
| 62839 | - public static function fromMark(stdClass|string|null $value): MarkDef|Mark|null { | |
| 62840 | - if (is_null($value)) { | |
| 62841 | - return $value; /*null*/ | |
| 62842 | - } elseif (is_object($value)) { | |
| 62407 | + public static function fromMark(stdClass|string $value): MarkDef|Mark { | |
| 62408 | + if (is_object($value)) { | |
| 62843 | 62409 | return MarkDef::from($value); /*class*/ |
| 62844 | 62410 | } elseif (is_string($value) && in_array($value, ['area', 'bar', 'line', 'point', 'text', 'tick', 'rect', 'rule', 'circle', 'square', 'geoshape'], true)) { |
| 62845 | 62411 | return Mark::from($value); /*enum*/ |
| @@ -62855,13 +62421,11 @@ class Spec { | ||
| 62855 | 62421 | * object](mark.html#mark-def). |
| 62856 | 62422 | * |
| 62857 | 62423 | * @throws Exception |
| 62858 | - * @return stdClass|string|null | |
| 62424 | + * @return stdClass|string | |
| 62859 | 62425 | */ |
| 62860 | - public function toMark(): stdClass|string|null { | |
| 62426 | + public function toMark(): stdClass|string { | |
| 62861 | 62427 | if (Spec::validateMark($this->mark)) { |
| 62862 | - if (is_null($this->mark)) { | |
| 62863 | - return $this->mark; /*null*/ | |
| 62864 | - } elseif ($this->mark instanceof MarkDef) { | |
| 62428 | + if ($this->mark instanceof MarkDef) { | |
| 62865 | 62429 | return $this->mark->to(); /*class*/ |
| 62866 | 62430 | } elseif ($this->mark instanceof Mark) { |
| 62867 | 62431 | return Mark::to($this->mark); /*enum*/ |
| @@ -62878,16 +62442,12 @@ class Spec { | ||
| 62878 | 62442 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 62879 | 62443 | * object](mark.html#mark-def). |
| 62880 | 62444 | * |
| 62881 | - * @param MarkDef|Mark|null | |
| 62445 | + * @param MarkDef|Mark | |
| 62882 | 62446 | * @return bool |
| 62883 | 62447 | * @throws Exception |
| 62884 | 62448 | */ |
| 62885 | - public static function validateMark(MarkDef|Mark|null $value): bool { | |
| 62886 | - if (is_null($value)) { | |
| 62887 | - if (!is_null($value)) { | |
| 62888 | - throw new Exception("Attribute Error:Spec::mark"); | |
| 62889 | - } | |
| 62890 | - } elseif ($value instanceof MarkDef) { | |
| 62449 | + public static function validateMark(MarkDef|Mark $value): bool { | |
| 62450 | + if ($value instanceof MarkDef) { | |
| 62891 | 62451 | $value->validate(); |
| 62892 | 62452 | } elseif ($value instanceof Mark) { |
| 62893 | 62453 | Mark::to($value); |
| @@ -62904,9 +62464,9 @@ class Spec { | ||
| 62904 | 62464 | * object](mark.html#mark-def). |
| 62905 | 62465 | * |
| 62906 | 62466 | * @throws Exception |
| 62907 | - * @return MarkDef|Mark|null | |
| 62467 | + * @return MarkDef|Mark | |
| 62908 | 62468 | */ |
| 62909 | - public function getMark(): MarkDef|Mark|null { | |
| 62469 | + public function getMark(): MarkDef|Mark { | |
| 62910 | 62470 | if (Spec::validateMark($this->mark)) { |
| 62911 | 62471 | return $this->mark; |
| 62912 | 62472 | } |
| @@ -62919,9 +62479,9 @@ class Spec { | ||
| 62919 | 62479 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 62920 | 62480 | * object](mark.html#mark-def). |
| 62921 | 62481 | * |
| 62922 | - * @return MarkDef|Mark|null | |
| 62482 | + * @return MarkDef|Mark | |
| 62923 | 62483 | */ |
| 62924 | - public static function sampleMark(): MarkDef|Mark|null { | |
| 62484 | + public static function sampleMark(): MarkDef|Mark { | |
| 62925 | 62485 | return MarkDef::sample(); /*41:mark*/ |
| 62926 | 62486 | } |
| 62927 | 62487 | |
| @@ -63094,16 +62654,12 @@ class Spec { | ||
| 63094 | 62654 | * An object that describes mappings between `row` and `column` channels and their field |
| 63095 | 62655 | * definitions. |
| 63096 | 62656 | * |
| 63097 | - * @param ?stdClass $value | |
| 62657 | + * @param stdClass $value | |
| 63098 | 62658 | * @throws Exception |
| 63099 | - * @return ?FacetMapping | |
| 62659 | + * @return FacetMapping | |
| 63100 | 62660 | */ |
| 63101 | - public static function fromFacet(?stdClass $value): ?FacetMapping { | |
| 63102 | - if (!is_null($value)) { | |
| 63103 | - return FacetMapping::from($value); /*class*/ | |
| 63104 | - } else { | |
| 63105 | - return null; | |
| 63106 | - } | |
| 62661 | + public static function fromFacet(stdClass $value): FacetMapping { | |
| 62662 | + return FacetMapping::from($value); /*class*/ | |
| 63107 | 62663 | } |
| 63108 | 62664 | |
| 63109 | 62665 | /** |
| @@ -63111,15 +62667,11 @@ class Spec { | ||
| 63111 | 62667 | * definitions. |
| 63112 | 62668 | * |
| 63113 | 62669 | * @throws Exception |
| 63114 | - * @return ?stdClass | |
| 62670 | + * @return stdClass | |
| 63115 | 62671 | */ |
| 63116 | - public function toFacet(): ?stdClass { | |
| 62672 | + public function toFacet(): stdClass { | |
| 63117 | 62673 | if (Spec::validateFacet($this->facet)) { |
| 63118 | - if (!is_null($this->facet)) { | |
| 63119 | - return $this->facet->to(); /*class*/ | |
| 63120 | - } else { | |
| 63121 | - return null; | |
| 63122 | - } | |
| 62674 | + return $this->facet->to(); /*class*/ | |
| 63123 | 62675 | } |
| 63124 | 62676 | throw new Exception('never get to this Spec::facet'); |
| 63125 | 62677 | } |
| @@ -63128,14 +62680,12 @@ class Spec { | ||
| 63128 | 62680 | * An object that describes mappings between `row` and `column` channels and their field |
| 63129 | 62681 | * definitions. |
| 63130 | 62682 | * |
| 63131 | - * @param FacetMapping|null | |
| 62683 | + * @param FacetMapping | |
| 63132 | 62684 | * @return bool |
| 63133 | 62685 | * @throws Exception |
| 63134 | 62686 | */ |
| 63135 | - public static function validateFacet(?FacetMapping $value): bool { | |
| 63136 | - if (!is_null($value)) { | |
| 63137 | - $value->validate(); | |
| 63138 | - } | |
| 62687 | + public static function validateFacet(FacetMapping $value): bool { | |
| 62688 | + $value->validate(); | |
| 63139 | 62689 | return true; |
| 63140 | 62690 | } |
| 63141 | 62691 | |
| @@ -63144,9 +62694,9 @@ class Spec { | ||
| 63144 | 62694 | * definitions. |
| 63145 | 62695 | * |
| 63146 | 62696 | * @throws Exception |
| 63147 | - * @return ?FacetMapping | |
| 62697 | + * @return FacetMapping | |
| 63148 | 62698 | */ |
| 63149 | - public function getFacet(): ?FacetMapping { | |
| 62699 | + public function getFacet(): FacetMapping { | |
| 63150 | 62700 | if (Spec::validateFacet($this->facet)) { |
| 63151 | 62701 | return $this->facet; |
| 63152 | 62702 | } |
| @@ -63157,40 +62707,32 @@ class Spec { | ||
| 63157 | 62707 | * An object that describes mappings between `row` and `column` channels and their field |
| 63158 | 62708 | * definitions. |
| 63159 | 62709 | * |
| 63160 | - * @return ?FacetMapping | |
| 62710 | + * @return FacetMapping | |
| 63161 | 62711 | */ |
| 63162 | - public static function sampleFacet(): ?FacetMapping { | |
| 62712 | + public static function sampleFacet(): FacetMapping { | |
| 63163 | 62713 | return FacetMapping::sample(); /*44:facet*/ |
| 63164 | 62714 | } |
| 63165 | 62715 | |
| 63166 | 62716 | /** |
| 63167 | 62717 | * A specification of the view that gets faceted. |
| 63168 | 62718 | * |
| 63169 | - * @param ?stdClass $value | |
| 62719 | + * @param stdClass $value | |
| 63170 | 62720 | * @throws Exception |
| 63171 | - * @return ?Spec | |
| 62721 | + * @return Spec | |
| 63172 | 62722 | */ |
| 63173 | - public static function fromSpec(?stdClass $value): ?Spec { | |
| 63174 | - if (!is_null($value)) { | |
| 63175 | - return Spec::from($value); /*class*/ | |
| 63176 | - } else { | |
| 63177 | - return null; | |
| 63178 | - } | |
| 62723 | + public static function fromSpec(stdClass $value): Spec { | |
| 62724 | + return Spec::from($value); /*class*/ | |
| 63179 | 62725 | } |
| 63180 | 62726 | |
| 63181 | 62727 | /** |
| 63182 | 62728 | * A specification of the view that gets faceted. |
| 63183 | 62729 | * |
| 63184 | 62730 | * @throws Exception |
| 63185 | - * @return ?stdClass | |
| 62731 | + * @return stdClass | |
| 63186 | 62732 | */ |
| 63187 | - public function toSpec(): ?stdClass { | |
| 62733 | + public function toSpec(): stdClass { | |
| 63188 | 62734 | if (Spec::validateSpec($this->spec)) { |
| 63189 | - if (!is_null($this->spec)) { | |
| 63190 | - return $this->spec->to(); /*class*/ | |
| 63191 | - } else { | |
| 63192 | - return null; | |
| 63193 | - } | |
| 62735 | + return $this->spec->to(); /*class*/ | |
| 63194 | 62736 | } |
| 63195 | 62737 | throw new Exception('never get to this Spec::spec'); |
| 63196 | 62738 | } |
| @@ -63198,14 +62740,12 @@ class Spec { | ||
| 63198 | 62740 | /** |
| 63199 | 62741 | * A specification of the view that gets faceted. |
| 63200 | 62742 | * |
| 63201 | - * @param Spec|null | |
| 62743 | + * @param Spec | |
| 63202 | 62744 | * @return bool |
| 63203 | 62745 | * @throws Exception |
| 63204 | 62746 | */ |
| 63205 | - public static function validateSpec(?Spec $value): bool { | |
| 63206 | - if (!is_null($value)) { | |
| 63207 | - $value->validate(); | |
| 63208 | - } | |
| 62747 | + public static function validateSpec(Spec $value): bool { | |
| 62748 | + $value->validate(); | |
| 63209 | 62749 | return true; |
| 63210 | 62750 | } |
| 63211 | 62751 | |
| @@ -63213,9 +62753,9 @@ class Spec { | ||
| 63213 | 62753 | * A specification of the view that gets faceted. |
| 63214 | 62754 | * |
| 63215 | 62755 | * @throws Exception |
| 63216 | - * @return ?Spec | |
| 62756 | + * @return Spec | |
| 63217 | 62757 | */ |
| 63218 | - public function getSpec(): ?Spec { | |
| 62758 | + public function getSpec(): Spec { | |
| 63219 | 62759 | if (Spec::validateSpec($this->spec)) { |
| 63220 | 62760 | return $this->spec; |
| 63221 | 62761 | } |
| @@ -63225,9 +62765,9 @@ class Spec { | ||
| 63225 | 62765 | /** |
| 63226 | 62766 | * A specification of the view that gets faceted. |
| 63227 | 62767 | * |
| 63228 | - * @return ?Spec | |
| 62768 | + * @return Spec | |
| 63229 | 62769 | */ |
| 63230 | - public static function sampleSpec(): ?Spec { | |
| 62770 | + public static function sampleSpec(): Spec { | |
| 63231 | 62771 | return Spec::sample(); /*45:spec*/ |
| 63232 | 62772 | } |
| 63233 | 62773 | |
| @@ -63235,16 +62775,12 @@ class Spec { | ||
| 63235 | 62775 | * An object that describes what fields should be repeated into views that are laid out as a |
| 63236 | 62776 | * `row` or `column`. |
| 63237 | 62777 | * |
| 63238 | - * @param ?stdClass $value | |
| 62778 | + * @param stdClass $value | |
| 63239 | 62779 | * @throws Exception |
| 63240 | - * @return ?Repeat | |
| 62780 | + * @return Repeat | |
| 63241 | 62781 | */ |
| 63242 | - public static function fromRepeat(?stdClass $value): ?Repeat { | |
| 63243 | - if (!is_null($value)) { | |
| 63244 | - return Repeat::from($value); /*class*/ | |
| 63245 | - } else { | |
| 63246 | - return null; | |
| 63247 | - } | |
| 62782 | + public static function fromRepeat(stdClass $value): Repeat { | |
| 62783 | + return Repeat::from($value); /*class*/ | |
| 63248 | 62784 | } |
| 63249 | 62785 | |
| 63250 | 62786 | /** |
| @@ -63252,15 +62788,11 @@ class Spec { | ||
| 63252 | 62788 | * `row` or `column`. |
| 63253 | 62789 | * |
| 63254 | 62790 | * @throws Exception |
| 63255 | - * @return ?stdClass | |
| 62791 | + * @return stdClass | |
| 63256 | 62792 | */ |
| 63257 | - public function toRepeat(): ?stdClass { | |
| 62793 | + public function toRepeat(): stdClass { | |
| 63258 | 62794 | if (Spec::validateRepeat($this->repeat)) { |
| 63259 | - if (!is_null($this->repeat)) { | |
| 63260 | - return $this->repeat->to(); /*class*/ | |
| 63261 | - } else { | |
| 63262 | - return null; | |
| 63263 | - } | |
| 62795 | + return $this->repeat->to(); /*class*/ | |
| 63264 | 62796 | } |
| 63265 | 62797 | throw new Exception('never get to this Spec::repeat'); |
| 63266 | 62798 | } |
| @@ -63269,14 +62801,12 @@ class Spec { | ||
| 63269 | 62801 | * An object that describes what fields should be repeated into views that are laid out as a |
| 63270 | 62802 | * `row` or `column`. |
| 63271 | 62803 | * |
| 63272 | - * @param Repeat|null | |
| 62804 | + * @param Repeat | |
| 63273 | 62805 | * @return bool |
| 63274 | 62806 | * @throws Exception |
| 63275 | 62807 | */ |
| 63276 | - public static function validateRepeat(?Repeat $value): bool { | |
| 63277 | - if (!is_null($value)) { | |
| 63278 | - $value->validate(); | |
| 63279 | - } | |
| 62808 | + public static function validateRepeat(Repeat $value): bool { | |
| 62809 | + $value->validate(); | |
| 63280 | 62810 | return true; |
| 63281 | 62811 | } |
| 63282 | 62812 | |
| @@ -63285,9 +62815,9 @@ class Spec { | ||
| 63285 | 62815 | * `row` or `column`. |
| 63286 | 62816 | * |
| 63287 | 62817 | * @throws Exception |
| 63288 | - * @return ?Repeat | |
| 62818 | + * @return Repeat | |
| 63289 | 62819 | */ |
| 63290 | - public function getRepeat(): ?Repeat { | |
| 62820 | + public function getRepeat(): Repeat { | |
| 63291 | 62821 | if (Spec::validateRepeat($this->repeat)) { |
| 63292 | 62822 | return $this->repeat; |
| 63293 | 62823 | } |
| @@ -63298,44 +62828,36 @@ class Spec { | ||
| 63298 | 62828 | * An object that describes what fields should be repeated into views that are laid out as a |
| 63299 | 62829 | * `row` or `column`. |
| 63300 | 62830 | * |
| 63301 | - * @return ?Repeat | |
| 62831 | + * @return Repeat | |
| 63302 | 62832 | */ |
| 63303 | - public static function sampleRepeat(): ?Repeat { | |
| 62833 | + public static function sampleRepeat(): Repeat { | |
| 63304 | 62834 | return Repeat::sample(); /*46:repeat*/ |
| 63305 | 62835 | } |
| 63306 | 62836 | |
| 63307 | 62837 | /** |
| 63308 | 62838 | * A list of views that should be concatenated and put into a column. |
| 63309 | 62839 | * |
| 63310 | - * @param ?array $value | |
| 62840 | + * @param array $value | |
| 63311 | 62841 | * @throws Exception |
| 63312 | - * @return ?array | |
| 62842 | + * @return array | |
| 63313 | 62843 | */ |
| 63314 | - public static function fromVconcat(?array $value): ?array { | |
| 63315 | - if (!is_null($value)) { | |
| 63316 | - return array_map(function ($value) { | |
| 63317 | - return Spec::from($value); /*class*/ | |
| 63318 | - }, $value); | |
| 63319 | - } else { | |
| 63320 | - return null; | |
| 63321 | - } | |
| 62844 | + public static function fromVconcat(array $value): array { | |
| 62845 | + return array_map(function ($value) { | |
| 62846 | + return Spec::from($value); /*class*/ | |
| 62847 | + }, $value); | |
| 63322 | 62848 | } |
| 63323 | 62849 | |
| 63324 | 62850 | /** |
| 63325 | 62851 | * A list of views that should be concatenated and put into a column. |
| 63326 | 62852 | * |
| 63327 | 62853 | * @throws Exception |
| 63328 | - * @return ?array | |
| 62854 | + * @return array | |
| 63329 | 62855 | */ |
| 63330 | - public function toVconcat(): ?array { | |
| 62856 | + public function toVconcat(): array { | |
| 63331 | 62857 | if (Spec::validateVconcat($this->vconcat)) { |
| 63332 | - if (!is_null($this->vconcat)) { | |
| 63333 | - return array_map(function ($value) { | |
| 63334 | - return $value->to(); /*class*/ | |
| 63335 | - }, $this->vconcat); | |
| 63336 | - } else { | |
| 63337 | - return null; | |
| 63338 | - } | |
| 62858 | + return array_map(function ($value) { | |
| 62859 | + return $value->to(); /*class*/ | |
| 62860 | + }, $this->vconcat); | |
| 63339 | 62861 | } |
| 63340 | 62862 | throw new Exception('never get to this Spec::vconcat'); |
| 63341 | 62863 | } |
| @@ -63343,19 +62865,17 @@ class Spec { | ||
| 63343 | 62865 | /** |
| 63344 | 62866 | * A list of views that should be concatenated and put into a column. |
| 63345 | 62867 | * |
| 63346 | - * @param array|null | |
| 62868 | + * @param array | |
| 63347 | 62869 | * @return bool |
| 63348 | 62870 | * @throws Exception |
| 63349 | 62871 | */ |
| 63350 | - public static function validateVconcat(?array $value): bool { | |
| 63351 | - if (!is_null($value)) { | |
| 63352 | - if (!is_array($value)) { | |
| 63353 | - throw new Exception("Attribute Error:Spec::vconcat"); | |
| 63354 | - } | |
| 63355 | - array_walk($value, function($value_v) { | |
| 63356 | - $value_v->validate(); | |
| 63357 | - }); | |
| 62872 | + public static function validateVconcat(array $value): bool { | |
| 62873 | + if (!is_array($value)) { | |
| 62874 | + throw new Exception("Attribute Error:Spec::vconcat"); | |
| 63358 | 62875 | } |
| 62876 | + array_walk($value, function($value_v) { | |
| 62877 | + $value_v->validate(); | |
| 62878 | + }); | |
| 63359 | 62879 | return true; |
| 63360 | 62880 | } |
| 63361 | 62881 | |
| @@ -63363,9 +62883,9 @@ class Spec { | ||
| 63363 | 62883 | * A list of views that should be concatenated and put into a column. |
| 63364 | 62884 | * |
| 63365 | 62885 | * @throws Exception |
| 63366 | - * @return ?array | |
| 62886 | + * @return array | |
| 63367 | 62887 | */ |
| 63368 | - public function getVconcat(): ?array { | |
| 62888 | + public function getVconcat(): array { | |
| 63369 | 62889 | if (Spec::validateVconcat($this->vconcat)) { |
| 63370 | 62890 | return $this->vconcat; |
| 63371 | 62891 | } |
| @@ -63375,9 +62895,9 @@ class Spec { | ||
| 63375 | 62895 | /** |
| 63376 | 62896 | * A list of views that should be concatenated and put into a column. |
| 63377 | 62897 | * |
| 63378 | - * @return ?array | |
| 62898 | + * @return array | |
| 63379 | 62899 | */ |
| 63380 | - public static function sampleVconcat(): ?array { | |
| 62900 | + public static function sampleVconcat(): array { | |
| 63381 | 62901 | return array( |
| 63382 | 62902 | Spec::sample() /*47:*/ |
| 63383 | 62903 | ); /* 47:vconcat*/ |
| @@ -63386,35 +62906,27 @@ class Spec { | ||
| 63386 | 62906 | /** |
| 63387 | 62907 | * A list of views that should be concatenated and put into a row. |
| 63388 | 62908 | * |
| 63389 | - * @param ?array $value | |
| 62909 | + * @param array $value | |
| 63390 | 62910 | * @throws Exception |
| 63391 | - * @return ?array | |
| 62911 | + * @return array | |
| 63392 | 62912 | */ |
| 63393 | - public static function fromHconcat(?array $value): ?array { | |
| 63394 | - if (!is_null($value)) { | |
| 63395 | - return array_map(function ($value) { | |
| 63396 | - return Spec::from($value); /*class*/ | |
| 63397 | - }, $value); | |
| 63398 | - } else { | |
| 63399 | - return null; | |
| 63400 | - } | |
| 62913 | + public static function fromHconcat(array $value): array { | |
| 62914 | + return array_map(function ($value) { | |
| 62915 | + return Spec::from($value); /*class*/ | |
| 62916 | + }, $value); | |
| 63401 | 62917 | } |
| 63402 | 62918 | |
| 63403 | 62919 | /** |
| 63404 | 62920 | * A list of views that should be concatenated and put into a row. |
| 63405 | 62921 | * |
| 63406 | 62922 | * @throws Exception |
| 63407 | - * @return ?array | |
| 62923 | + * @return array | |
| 63408 | 62924 | */ |
| 63409 | - public function toHconcat(): ?array { | |
| 62925 | + public function toHconcat(): array { | |
| 63410 | 62926 | if (Spec::validateHconcat($this->hconcat)) { |
| 63411 | - if (!is_null($this->hconcat)) { | |
| 63412 | - return array_map(function ($value) { | |
| 63413 | - return $value->to(); /*class*/ | |
| 63414 | - }, $this->hconcat); | |
| 63415 | - } else { | |
| 63416 | - return null; | |
| 63417 | - } | |
| 62927 | + return array_map(function ($value) { | |
| 62928 | + return $value->to(); /*class*/ | |
| 62929 | + }, $this->hconcat); | |
| 63418 | 62930 | } |
| 63419 | 62931 | throw new Exception('never get to this Spec::hconcat'); |
| 63420 | 62932 | } |
| @@ -63422,19 +62934,17 @@ class Spec { | ||
| 63422 | 62934 | /** |
| 63423 | 62935 | * A list of views that should be concatenated and put into a row. |
| 63424 | 62936 | * |
| 63425 | - * @param array|null | |
| 62937 | + * @param array | |
| 63426 | 62938 | * @return bool |
| 63427 | 62939 | * @throws Exception |
| 63428 | 62940 | */ |
| 63429 | - public static function validateHconcat(?array $value): bool { | |
| 63430 | - if (!is_null($value)) { | |
| 63431 | - if (!is_array($value)) { | |
| 63432 | - throw new Exception("Attribute Error:Spec::hconcat"); | |
| 63433 | - } | |
| 63434 | - array_walk($value, function($value_v) { | |
| 63435 | - $value_v->validate(); | |
| 63436 | - }); | |
| 62941 | + public static function validateHconcat(array $value): bool { | |
| 62942 | + if (!is_array($value)) { | |
| 62943 | + throw new Exception("Attribute Error:Spec::hconcat"); | |
| 63437 | 62944 | } |
| 62945 | + array_walk($value, function($value_v) { | |
| 62946 | + $value_v->validate(); | |
| 62947 | + }); | |
| 63438 | 62948 | return true; |
| 63439 | 62949 | } |
| 63440 | 62950 | |
| @@ -63442,9 +62952,9 @@ class Spec { | ||
| 63442 | 62952 | * A list of views that should be concatenated and put into a row. |
| 63443 | 62953 | * |
| 63444 | 62954 | * @throws Exception |
| 63445 | - * @return ?array | |
| 62955 | + * @return array | |
| 63446 | 62956 | */ |
| 63447 | - public function getHconcat(): ?array { | |
| 62957 | + public function getHconcat(): array { | |
| 63448 | 62958 | if (Spec::validateHconcat($this->hconcat)) { |
| 63449 | 62959 | return $this->hconcat; |
| 63450 | 62960 | } |
| @@ -63454,9 +62964,9 @@ class Spec { | ||
| 63454 | 62964 | /** |
| 63455 | 62965 | * A list of views that should be concatenated and put into a row. |
| 63456 | 62966 | * |
| 63457 | - * @return ?array | |
| 62967 | + * @return array | |
| 63458 | 62968 | */ |
| 63459 | - public static function sampleHconcat(): ?array { | |
| 62969 | + public static function sampleHconcat(): array { | |
| 63460 | 62970 | return array( |
| 63461 | 62971 | Spec::sample() /*48:*/ |
| 63462 | 62972 | ); /* 48:hconcat*/ |
| @@ -64774,14 +64284,14 @@ class LayerSpec { | ||
| 64774 | 64284 | private ?Data $data; // json:data Optional |
| 64775 | 64285 | private ?string $description; // json:description Optional |
| 64776 | 64286 | private ?float $height; // json:height Optional |
| 64777 | - private ?array $layer; // json:layer Optional | |
| 64287 | + private array $layer; // json:layer Required | |
| 64778 | 64288 | private ?string $name; // json:name Optional |
| 64779 | 64289 | private ?Resolve $resolve; // json:resolve Optional |
| 64780 | 64290 | private TitleParams|string|null $title; // json:title Optional |
| 64781 | 64291 | private ?array $transform; // json:transform Optional |
| 64782 | 64292 | private ?float $width; // json:width Optional |
| 64783 | - private ?Encoding $encoding; // json:encoding Optional | |
| 64784 | - private MarkDef|Mark|null $mark; // json:mark Optional | |
| 64293 | + private Encoding $encoding; // json:encoding Required | |
| 64294 | + private MarkDef|Mark $mark; // json:mark Required | |
| 64785 | 64295 | private ?Projection $projection; // json:projection Optional |
| 64786 | 64296 | private ?stdClass $selection; // json:selection Optional |
| 64787 | 64297 | |
| @@ -64789,18 +64299,18 @@ class LayerSpec { | ||
| 64789 | 64299 | * @param Data|null $data |
| 64790 | 64300 | * @param string|null $description |
| 64791 | 64301 | * @param float|null $height |
| 64792 | - * @param array|null $layer | |
| 64302 | + * @param array $layer | |
| 64793 | 64303 | * @param string|null $name |
| 64794 | 64304 | * @param Resolve|null $resolve |
| 64795 | 64305 | * @param TitleParams|string|null $title |
| 64796 | 64306 | * @param array|null $transform |
| 64797 | 64307 | * @param float|null $width |
| 64798 | - * @param Encoding|null $encoding | |
| 64799 | - * @param MarkDef|Mark|null $mark | |
| 64308 | + * @param Encoding $encoding | |
| 64309 | + * @param MarkDef|Mark $mark | |
| 64800 | 64310 | * @param Projection|null $projection |
| 64801 | 64311 | * @param stdClass|null $selection |
| 64802 | 64312 | */ |
| 64803 | - public function __construct(?Data $data, ?string $description, ?float $height, ?array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, ?Encoding $encoding, MarkDef|Mark|null $mark, ?Projection $projection, ?stdClass $selection) { | |
| 64313 | + public function __construct(?Data $data, ?string $description, ?float $height, array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, Encoding $encoding, MarkDef|Mark $mark, ?Projection $projection, ?stdClass $selection) { | |
| 64804 | 64314 | $this->data = $data; |
| 64805 | 64315 | $this->description = $description; |
| 64806 | 64316 | $this->height = $height; |
| @@ -65104,18 +64614,14 @@ class LayerSpec { | ||
| 65104 | 64614 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 65105 | 64615 | * layering facet specifications is not allowed. |
| 65106 | 64616 | * |
| 65107 | - * @param ?array $value | |
| 64617 | + * @param array $value | |
| 65108 | 64618 | * @throws Exception |
| 65109 | - * @return ?array | |
| 64619 | + * @return array | |
| 65110 | 64620 | */ |
| 65111 | - public static function fromLayer(?array $value): ?array { | |
| 65112 | - if (!is_null($value)) { | |
| 65113 | - return array_map(function ($value) { | |
| 65114 | - return LayerSpec::from($value); /*class*/ | |
| 65115 | - }, $value); | |
| 65116 | - } else { | |
| 65117 | - return null; | |
| 65118 | - } | |
| 64621 | + public static function fromLayer(array $value): array { | |
| 64622 | + return array_map(function ($value) { | |
| 64623 | + return LayerSpec::from($value); /*class*/ | |
| 64624 | + }, $value); | |
| 65119 | 64625 | } |
| 65120 | 64626 | |
| 65121 | 64627 | /** |
| @@ -65125,17 +64631,13 @@ class LayerSpec { | ||
| 65125 | 64631 | * layering facet specifications is not allowed. |
| 65126 | 64632 | * |
| 65127 | 64633 | * @throws Exception |
| 65128 | - * @return ?array | |
| 64634 | + * @return array | |
| 65129 | 64635 | */ |
| 65130 | - public function toLayer(): ?array { | |
| 64636 | + public function toLayer(): array { | |
| 65131 | 64637 | if (LayerSpec::validateLayer($this->layer)) { |
| 65132 | - if (!is_null($this->layer)) { | |
| 65133 | - return array_map(function ($value) { | |
| 65134 | - return $value->to(); /*class*/ | |
| 65135 | - }, $this->layer); | |
| 65136 | - } else { | |
| 65137 | - return null; | |
| 65138 | - } | |
| 64638 | + return array_map(function ($value) { | |
| 64639 | + return $value->to(); /*class*/ | |
| 64640 | + }, $this->layer); | |
| 65139 | 64641 | } |
| 65140 | 64642 | throw new Exception('never get to this LayerSpec::layer'); |
| 65141 | 64643 | } |
| @@ -65146,19 +64648,17 @@ class LayerSpec { | ||
| 65146 | 64648 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 65147 | 64649 | * layering facet specifications is not allowed. |
| 65148 | 64650 | * |
| 65149 | - * @param array|null | |
| 64651 | + * @param array | |
| 65150 | 64652 | * @return bool |
| 65151 | 64653 | * @throws Exception |
| 65152 | 64654 | */ |
| 65153 | - public static function validateLayer(?array $value): bool { | |
| 65154 | - if (!is_null($value)) { | |
| 65155 | - if (!is_array($value)) { | |
| 65156 | - throw new Exception("Attribute Error:LayerSpec::layer"); | |
| 65157 | - } | |
| 65158 | - array_walk($value, function($value_v) { | |
| 65159 | - $value_v->validate(); | |
| 65160 | - }); | |
| 64655 | + public static function validateLayer(array $value): bool { | |
| 64656 | + if (!is_array($value)) { | |
| 64657 | + throw new Exception("Attribute Error:LayerSpec::layer"); | |
| 65161 | 64658 | } |
| 64659 | + array_walk($value, function($value_v) { | |
| 64660 | + $value_v->validate(); | |
| 64661 | + }); | |
| 65162 | 64662 | return true; |
| 65163 | 64663 | } |
| 65164 | 64664 | |
| @@ -65169,9 +64669,9 @@ class LayerSpec { | ||
| 65169 | 64669 | * layering facet specifications is not allowed. |
| 65170 | 64670 | * |
| 65171 | 64671 | * @throws Exception |
| 65172 | - * @return ?array | |
| 64672 | + * @return array | |
| 65173 | 64673 | */ |
| 65174 | - public function getLayer(): ?array { | |
| 64674 | + public function getLayer(): array { | |
| 65175 | 64675 | if (LayerSpec::validateLayer($this->layer)) { |
| 65176 | 64676 | return $this->layer; |
| 65177 | 64677 | } |
| @@ -65184,9 +64684,9 @@ class LayerSpec { | ||
| 65184 | 64684 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 65185 | 64685 | * layering facet specifications is not allowed. |
| 65186 | 64686 | * |
| 65187 | - * @return ?array | |
| 64687 | + * @return array | |
| 65188 | 64688 | */ |
| 65189 | - public static function sampleLayer(): ?array { | |
| 64689 | + public static function sampleLayer(): array { | |
| 65190 | 64690 | return array( |
| 65191 | 64691 | LayerSpec::sample() /*34:*/ |
| 65192 | 64692 | ); /* 34:layer*/ |
| @@ -65657,31 +65157,23 @@ class LayerSpec { | ||
| 65657 | 65157 | /** |
| 65658 | 65158 | * A key-value mapping between encoding channels and definition of fields. |
| 65659 | 65159 | * |
| 65660 | - * @param ?stdClass $value | |
| 65160 | + * @param stdClass $value | |
| 65661 | 65161 | * @throws Exception |
| 65662 | - * @return ?Encoding | |
| 65162 | + * @return Encoding | |
| 65663 | 65163 | */ |
| 65664 | - public static function fromEncoding(?stdClass $value): ?Encoding { | |
| 65665 | - if (!is_null($value)) { | |
| 65666 | - return Encoding::from($value); /*class*/ | |
| 65667 | - } else { | |
| 65668 | - return null; | |
| 65669 | - } | |
| 65164 | + public static function fromEncoding(stdClass $value): Encoding { | |
| 65165 | + return Encoding::from($value); /*class*/ | |
| 65670 | 65166 | } |
| 65671 | 65167 | |
| 65672 | 65168 | /** |
| 65673 | 65169 | * A key-value mapping between encoding channels and definition of fields. |
| 65674 | 65170 | * |
| 65675 | 65171 | * @throws Exception |
| 65676 | - * @return ?stdClass | |
| 65172 | + * @return stdClass | |
| 65677 | 65173 | */ |
| 65678 | - public function toEncoding(): ?stdClass { | |
| 65174 | + public function toEncoding(): stdClass { | |
| 65679 | 65175 | if (LayerSpec::validateEncoding($this->encoding)) { |
| 65680 | - if (!is_null($this->encoding)) { | |
| 65681 | - return $this->encoding->to(); /*class*/ | |
| 65682 | - } else { | |
| 65683 | - return null; | |
| 65684 | - } | |
| 65176 | + return $this->encoding->to(); /*class*/ | |
| 65685 | 65177 | } |
| 65686 | 65178 | throw new Exception('never get to this LayerSpec::encoding'); |
| 65687 | 65179 | } |
| @@ -65689,14 +65181,12 @@ class LayerSpec { | ||
| 65689 | 65181 | /** |
| 65690 | 65182 | * A key-value mapping between encoding channels and definition of fields. |
| 65691 | 65183 | * |
| 65692 | - * @param Encoding|null | |
| 65184 | + * @param Encoding | |
| 65693 | 65185 | * @return bool |
| 65694 | 65186 | * @throws Exception |
| 65695 | 65187 | */ |
| 65696 | - public static function validateEncoding(?Encoding $value): bool { | |
| 65697 | - if (!is_null($value)) { | |
| 65698 | - $value->validate(); | |
| 65699 | - } | |
| 65188 | + public static function validateEncoding(Encoding $value): bool { | |
| 65189 | + $value->validate(); | |
| 65700 | 65190 | return true; |
| 65701 | 65191 | } |
| 65702 | 65192 | |
| @@ -65704,9 +65194,9 @@ class LayerSpec { | ||
| 65704 | 65194 | * A key-value mapping between encoding channels and definition of fields. |
| 65705 | 65195 | * |
| 65706 | 65196 | * @throws Exception |
| 65707 | - * @return ?Encoding | |
| 65197 | + * @return Encoding | |
| 65708 | 65198 | */ |
| 65709 | - public function getEncoding(): ?Encoding { | |
| 65199 | + public function getEncoding(): Encoding { | |
| 65710 | 65200 | if (LayerSpec::validateEncoding($this->encoding)) { |
| 65711 | 65201 | return $this->encoding; |
| 65712 | 65202 | } |
| @@ -65716,9 +65206,9 @@ class LayerSpec { | ||
| 65716 | 65206 | /** |
| 65717 | 65207 | * A key-value mapping between encoding channels and definition of fields. |
| 65718 | 65208 | * |
| 65719 | - * @return ?Encoding | |
| 65209 | + * @return Encoding | |
| 65720 | 65210 | */ |
| 65721 | - public static function sampleEncoding(): ?Encoding { | |
| 65211 | + public static function sampleEncoding(): Encoding { | |
| 65722 | 65212 | return Encoding::sample(); /*40:encoding*/ |
| 65723 | 65213 | } |
| 65724 | 65214 | |
| @@ -65728,14 +65218,12 @@ class LayerSpec { | ||
| 65728 | 65218 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 65729 | 65219 | * object](mark.html#mark-def). |
| 65730 | 65220 | * |
| 65731 | - * @param stdClass|string|null $value | |
| 65221 | + * @param stdClass|string $value | |
| 65732 | 65222 | * @throws Exception |
| 65733 | - * @return MarkDef|Mark|null | |
| 65223 | + * @return MarkDef|Mark | |
| 65734 | 65224 | */ |
| 65735 | - public static function fromMark(stdClass|string|null $value): MarkDef|Mark|null { | |
| 65736 | - if (is_null($value)) { | |
| 65737 | - return $value; /*null*/ | |
| 65738 | - } elseif (is_object($value)) { | |
| 65225 | + public static function fromMark(stdClass|string $value): MarkDef|Mark { | |
| 65226 | + if (is_object($value)) { | |
| 65739 | 65227 | return MarkDef::from($value); /*class*/ |
| 65740 | 65228 | } elseif (is_string($value) && in_array($value, ['area', 'bar', 'line', 'point', 'text', 'tick', 'rect', 'rule', 'circle', 'square', 'geoshape'], true)) { |
| 65741 | 65229 | return Mark::from($value); /*enum*/ |
| @@ -65751,13 +65239,11 @@ class LayerSpec { | ||
| 65751 | 65239 | * object](mark.html#mark-def). |
| 65752 | 65240 | * |
| 65753 | 65241 | * @throws Exception |
| 65754 | - * @return stdClass|string|null | |
| 65242 | + * @return stdClass|string | |
| 65755 | 65243 | */ |
| 65756 | - public function toMark(): stdClass|string|null { | |
| 65244 | + public function toMark(): stdClass|string { | |
| 65757 | 65245 | if (LayerSpec::validateMark($this->mark)) { |
| 65758 | - if (is_null($this->mark)) { | |
| 65759 | - return $this->mark; /*null*/ | |
| 65760 | - } elseif ($this->mark instanceof MarkDef) { | |
| 65246 | + if ($this->mark instanceof MarkDef) { | |
| 65761 | 65247 | return $this->mark->to(); /*class*/ |
| 65762 | 65248 | } elseif ($this->mark instanceof Mark) { |
| 65763 | 65249 | return Mark::to($this->mark); /*enum*/ |
| @@ -65774,16 +65260,12 @@ class LayerSpec { | ||
| 65774 | 65260 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 65775 | 65261 | * object](mark.html#mark-def). |
| 65776 | 65262 | * |
| 65777 | - * @param MarkDef|Mark|null | |
| 65263 | + * @param MarkDef|Mark | |
| 65778 | 65264 | * @return bool |
| 65779 | 65265 | * @throws Exception |
| 65780 | 65266 | */ |
| 65781 | - public static function validateMark(MarkDef|Mark|null $value): bool { | |
| 65782 | - if (is_null($value)) { | |
| 65783 | - if (!is_null($value)) { | |
| 65784 | - throw new Exception("Attribute Error:LayerSpec::mark"); | |
| 65785 | - } | |
| 65786 | - } elseif ($value instanceof MarkDef) { | |
| 65267 | + public static function validateMark(MarkDef|Mark $value): bool { | |
| 65268 | + if ($value instanceof MarkDef) { | |
| 65787 | 65269 | $value->validate(); |
| 65788 | 65270 | } elseif ($value instanceof Mark) { |
| 65789 | 65271 | Mark::to($value); |
| @@ -65800,9 +65282,9 @@ class LayerSpec { | ||
| 65800 | 65282 | * object](mark.html#mark-def). |
| 65801 | 65283 | * |
| 65802 | 65284 | * @throws Exception |
| 65803 | - * @return MarkDef|Mark|null | |
| 65285 | + * @return MarkDef|Mark | |
| 65804 | 65286 | */ |
| 65805 | - public function getMark(): MarkDef|Mark|null { | |
| 65287 | + public function getMark(): MarkDef|Mark { | |
| 65806 | 65288 | if (LayerSpec::validateMark($this->mark)) { |
| 65807 | 65289 | return $this->mark; |
| 65808 | 65290 | } |
| @@ -65815,9 +65297,9 @@ class LayerSpec { | ||
| 65815 | 65297 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 65816 | 65298 | * object](mark.html#mark-def). |
| 65817 | 65299 | * |
| 65818 | - * @return MarkDef|Mark|null | |
| 65300 | + * @return MarkDef|Mark | |
| 65819 | 65301 | */ |
| 65820 | - public static function sampleMark(): MarkDef|Mark|null { | |
| 65302 | + public static function sampleMark(): MarkDef|Mark { | |
| 65821 | 65303 | return MarkDef::sample(); /*41:mark*/ |
| 65822 | 65304 | } |
| 65823 | 65305 | |
| @@ -73349,32 +72831,32 @@ class TitleParams { | ||
| 73349 | 72831 | // This is an autogenerated file:Transform |
| 73350 | 72832 | |
| 73351 | 72833 | class Transform { |
| 73352 | - private Predicate|string|null $filter; // json:filter Optional | |
| 72834 | + private Predicate|string $filter; // json:filter Required | |
| 73353 | 72835 | private array|string|null $as; // json:as Optional |
| 73354 | - private ?string $calculate; // json:calculate Optional | |
| 72836 | + private string $calculate; // json:calculate Required | |
| 73355 | 72837 | private ?string $default; // json:default Optional |
| 73356 | - private ?LookupData $from; // json:from Optional | |
| 73357 | - private ?string $lookup; // json:lookup Optional | |
| 73358 | - private BinParams|bool|null $bin; // json:bin Optional | |
| 73359 | - private ?string $field; // json:field Optional | |
| 73360 | - private ?TimeUnit $timeUnit; // json:timeUnit Optional | |
| 73361 | - private ?array $aggregate; // json:aggregate Optional | |
| 72838 | + private LookupData $from; // json:from Required | |
| 72839 | + private string $lookup; // json:lookup Required | |
| 72840 | + private BinParams|bool $bin; // json:bin Required | |
| 72841 | + private string $field; // json:field Required | |
| 72842 | + private TimeUnit $timeUnit; // json:timeUnit Required | |
| 72843 | + private array $aggregate; // json:aggregate Required | |
| 73362 | 72844 | private ?array $groupby; // json:groupby Optional |
| 73363 | 72845 | |
| 73364 | 72846 | /** |
| 73365 | - * @param Predicate|string|null $filter | |
| 72847 | + * @param Predicate|string $filter | |
| 73366 | 72848 | * @param array|string|null $as |
| 73367 | - * @param string|null $calculate | |
| 72849 | + * @param string $calculate | |
| 73368 | 72850 | * @param string|null $default |
| 73369 | - * @param LookupData|null $from | |
| 73370 | - * @param string|null $lookup | |
| 73371 | - * @param BinParams|bool|null $bin | |
| 73372 | - * @param string|null $field | |
| 73373 | - * @param TimeUnit|null $timeUnit | |
| 73374 | - * @param array|null $aggregate | |
| 72851 | + * @param LookupData $from | |
| 72852 | + * @param string $lookup | |
| 72853 | + * @param BinParams|bool $bin | |
| 72854 | + * @param string $field | |
| 72855 | + * @param TimeUnit $timeUnit | |
| 72856 | + * @param array $aggregate | |
| 73375 | 72857 | * @param array|null $groupby |
| 73376 | 72858 | */ |
| 73377 | - public function __construct(Predicate|string|null $filter, array|string|null $as, ?string $calculate, ?string $default, ?LookupData $from, ?string $lookup, BinParams|bool|null $bin, ?string $field, ?TimeUnit $timeUnit, ?array $aggregate, ?array $groupby) { | |
| 72859 | + public function __construct(Predicate|string $filter, array|string|null $as, string $calculate, ?string $default, LookupData $from, string $lookup, BinParams|bool $bin, string $field, TimeUnit $timeUnit, array $aggregate, ?array $groupby) { | |
| 73378 | 72860 | $this->filter = $filter; |
| 73379 | 72861 | $this->as = $as; |
| 73380 | 72862 | $this->calculate = $calculate; |
| @@ -73398,14 +72880,12 @@ class Transform { | ||
| 73398 | 72880 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 73399 | 72881 | * or (4) a logical operand that combines (1), (2), or (3). |
| 73400 | 72882 | * |
| 73401 | - * @param stdClass|string|null $value | |
| 72883 | + * @param stdClass|string $value | |
| 73402 | 72884 | * @throws Exception |
| 73403 | - * @return Predicate|string|null | |
| 72885 | + * @return Predicate|string | |
| 73404 | 72886 | */ |
| 73405 | - public static function fromFilter(stdClass|string|null $value): Predicate|string|null { | |
| 73406 | - if (is_null($value)) { | |
| 73407 | - return $value; /*null*/ | |
| 73408 | - } elseif (is_object($value)) { | |
| 72887 | + public static function fromFilter(stdClass|string $value): Predicate|string { | |
| 72888 | + if (is_object($value)) { | |
| 73409 | 72889 | return Predicate::from($value); /*class*/ |
| 73410 | 72890 | } elseif (is_string($value)) { |
| 73411 | 72891 | return $value; /*string*/ |
| @@ -73425,13 +72905,11 @@ class Transform { | ||
| 73425 | 72905 | * or (4) a logical operand that combines (1), (2), or (3). |
| 73426 | 72906 | * |
| 73427 | 72907 | * @throws Exception |
| 73428 | - * @return stdClass|string|null | |
| 72908 | + * @return stdClass|string | |
| 73429 | 72909 | */ |
| 73430 | - public function toFilter(): stdClass|string|null { | |
| 72910 | + public function toFilter(): stdClass|string { | |
| 73431 | 72911 | if (Transform::validateFilter($this->filter)) { |
| 73432 | - if (is_null($this->filter)) { | |
| 73433 | - return $this->filter; /*null*/ | |
| 73434 | - } elseif ($this->filter instanceof Predicate) { | |
| 72912 | + if ($this->filter instanceof Predicate) { | |
| 73435 | 72913 | return $this->filter->to(); /*class*/ |
| 73436 | 72914 | } elseif (is_string($this->filter)) { |
| 73437 | 72915 | return $this->filter; /*string*/ |
| @@ -73452,16 +72930,12 @@ class Transform { | ||
| 73452 | 72930 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 73453 | 72931 | * or (4) a logical operand that combines (1), (2), or (3). |
| 73454 | 72932 | * |
| 73455 | - * @param Predicate|string|null | |
| 72933 | + * @param Predicate|string | |
| 73456 | 72934 | * @return bool |
| 73457 | 72935 | * @throws Exception |
| 73458 | 72936 | */ |
| 73459 | - public static function validateFilter(Predicate|string|null $value): bool { | |
| 73460 | - if (is_null($value)) { | |
| 73461 | - if (!is_null($value)) { | |
| 73462 | - throw new Exception("Attribute Error:Transform::filter"); | |
| 73463 | - } | |
| 73464 | - } elseif ($value instanceof Predicate) { | |
| 72937 | + public static function validateFilter(Predicate|string $value): bool { | |
| 72938 | + if ($value instanceof Predicate) { | |
| 73465 | 72939 | $value->validate(); |
| 73466 | 72940 | } elseif (is_string($value)) { |
| 73467 | 72941 | if (!is_string($value)) { |
| @@ -73484,9 +72958,9 @@ class Transform { | ||
| 73484 | 72958 | * or (4) a logical operand that combines (1), (2), or (3). |
| 73485 | 72959 | * |
| 73486 | 72960 | * @throws Exception |
| 73487 | - * @return Predicate|string|null | |
| 72961 | + * @return Predicate|string | |
| 73488 | 72962 | */ |
| 73489 | - public function getFilter(): Predicate|string|null { | |
| 72963 | + public function getFilter(): Predicate|string { | |
| 73490 | 72964 | if (Transform::validateFilter($this->filter)) { |
| 73491 | 72965 | return $this->filter; |
| 73492 | 72966 | } |
| @@ -73503,9 +72977,9 @@ class Transform { | ||
| 73503 | 72977 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 73504 | 72978 | * or (4) a logical operand that combines (1), (2), or (3). |
| 73505 | 72979 | * |
| 73506 | - * @return Predicate|string|null | |
| 72980 | + * @return Predicate|string | |
| 73507 | 72981 | */ |
| 73508 | - public static function sampleFilter(): Predicate|string|null { | |
| 72982 | + public static function sampleFilter(): Predicate|string { | |
| 73509 | 72983 | return Predicate::sample(); /*31:filter*/ |
| 73510 | 72984 | } |
| 73511 | 72985 | |
| @@ -73657,16 +73131,12 @@ class Transform { | ||
| 73657 | 73131 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 73658 | 73132 | * current data object. |
| 73659 | 73133 | * |
| 73660 | - * @param ?string $value | |
| 73134 | + * @param string $value | |
| 73661 | 73135 | * @throws Exception |
| 73662 | - * @return ?string | |
| 73136 | + * @return string | |
| 73663 | 73137 | */ |
| 73664 | - public static function fromCalculate(?string $value): ?string { | |
| 73665 | - if (!is_null($value)) { | |
| 73666 | - return $value; /*string*/ | |
| 73667 | - } else { | |
| 73668 | - return null; | |
| 73669 | - } | |
| 73138 | + public static function fromCalculate(string $value): string { | |
| 73139 | + return $value; /*string*/ | |
| 73670 | 73140 | } |
| 73671 | 73141 | |
| 73672 | 73142 | /** |
| @@ -73674,15 +73144,11 @@ class Transform { | ||
| 73674 | 73144 | * current data object. |
| 73675 | 73145 | * |
| 73676 | 73146 | * @throws Exception |
| 73677 | - * @return ?string | |
| 73147 | + * @return string | |
| 73678 | 73148 | */ |
| 73679 | - public function toCalculate(): ?string { | |
| 73149 | + public function toCalculate(): string { | |
| 73680 | 73150 | if (Transform::validateCalculate($this->calculate)) { |
| 73681 | - if (!is_null($this->calculate)) { | |
| 73682 | - return $this->calculate; /*string*/ | |
| 73683 | - } else { | |
| 73684 | - return null; | |
| 73685 | - } | |
| 73151 | + return $this->calculate; /*string*/ | |
| 73686 | 73152 | } |
| 73687 | 73153 | throw new Exception('never get to this Transform::calculate'); |
| 73688 | 73154 | } |
| @@ -73691,13 +73157,11 @@ class Transform { | ||
| 73691 | 73157 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 73692 | 73158 | * current data object. |
| 73693 | 73159 | * |
| 73694 | - * @param string|null | |
| 73160 | + * @param string | |
| 73695 | 73161 | * @return bool |
| 73696 | 73162 | * @throws Exception |
| 73697 | 73163 | */ |
| 73698 | - public static function validateCalculate(?string $value): bool { | |
| 73699 | - if (!is_null($value)) { | |
| 73700 | - } | |
| 73164 | + public static function validateCalculate(string $value): bool { | |
| 73701 | 73165 | return true; |
| 73702 | 73166 | } |
| 73703 | 73167 | |
| @@ -73706,9 +73170,9 @@ class Transform { | ||
| 73706 | 73170 | * current data object. |
| 73707 | 73171 | * |
| 73708 | 73172 | * @throws Exception |
| 73709 | - * @return ?string | |
| 73173 | + * @return string | |
| 73710 | 73174 | */ |
| 73711 | - public function getCalculate(): ?string { | |
| 73175 | + public function getCalculate(): string { | |
| 73712 | 73176 | if (Transform::validateCalculate($this->calculate)) { |
| 73713 | 73177 | return $this->calculate; |
| 73714 | 73178 | } |
| @@ -73719,9 +73183,9 @@ class Transform { | ||
| 73719 | 73183 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 73720 | 73184 | * current data object. |
| 73721 | 73185 | * |
| 73722 | - * @return ?string | |
| 73186 | + * @return string | |
| 73723 | 73187 | */ |
| 73724 | - public static function sampleCalculate(): ?string { | |
| 73188 | + public static function sampleCalculate(): string { | |
| 73725 | 73189 | return 'Transform::calculate::33'; /*33:calculate*/ |
| 73726 | 73190 | } |
| 73727 | 73191 | |
| @@ -73805,31 +73269,23 @@ class Transform { | ||
| 73805 | 73269 | /** |
| 73806 | 73270 | * Secondary data reference. |
| 73807 | 73271 | * |
| 73808 | - * @param ?stdClass $value | |
| 73272 | + * @param stdClass $value | |
| 73809 | 73273 | * @throws Exception |
| 73810 | - * @return ?LookupData | |
| 73274 | + * @return LookupData | |
| 73811 | 73275 | */ |
| 73812 | - public static function fromFrom(?stdClass $value): ?LookupData { | |
| 73813 | - if (!is_null($value)) { | |
| 73814 | - return LookupData::from($value); /*class*/ | |
| 73815 | - } else { | |
| 73816 | - return null; | |
| 73817 | - } | |
| 73276 | + public static function fromFrom(stdClass $value): LookupData { | |
| 73277 | + return LookupData::from($value); /*class*/ | |
| 73818 | 73278 | } |
| 73819 | 73279 | |
| 73820 | 73280 | /** |
| 73821 | 73281 | * Secondary data reference. |
| 73822 | 73282 | * |
| 73823 | 73283 | * @throws Exception |
| 73824 | - * @return ?stdClass | |
| 73284 | + * @return stdClass | |
| 73825 | 73285 | */ |
| 73826 | - public function toFrom(): ?stdClass { | |
| 73286 | + public function toFrom(): stdClass { | |
| 73827 | 73287 | if (Transform::validateFrom($this->from)) { |
| 73828 | - if (!is_null($this->from)) { | |
| 73829 | - return $this->from->to(); /*class*/ | |
| 73830 | - } else { | |
| 73831 | - return null; | |
| 73832 | - } | |
| 73288 | + return $this->from->to(); /*class*/ | |
| 73833 | 73289 | } |
| 73834 | 73290 | throw new Exception('never get to this Transform::from'); |
| 73835 | 73291 | } |
| @@ -73837,14 +73293,12 @@ class Transform { | ||
| 73837 | 73293 | /** |
| 73838 | 73294 | * Secondary data reference. |
| 73839 | 73295 | * |
| 73840 | - * @param LookupData|null | |
| 73296 | + * @param LookupData | |
| 73841 | 73297 | * @return bool |
| 73842 | 73298 | * @throws Exception |
| 73843 | 73299 | */ |
| 73844 | - public static function validateFrom(?LookupData $value): bool { | |
| 73845 | - if (!is_null($value)) { | |
| 73846 | - $value->validate(); | |
| 73847 | - } | |
| 73300 | + public static function validateFrom(LookupData $value): bool { | |
| 73301 | + $value->validate(); | |
| 73848 | 73302 | return true; |
| 73849 | 73303 | } |
| 73850 | 73304 | |
| @@ -73852,9 +73306,9 @@ class Transform { | ||
| 73852 | 73306 | * Secondary data reference. |
| 73853 | 73307 | * |
| 73854 | 73308 | * @throws Exception |
| 73855 | - * @return ?LookupData | |
| 73309 | + * @return LookupData | |
| 73856 | 73310 | */ |
| 73857 | - public function getFrom(): ?LookupData { | |
| 73311 | + public function getFrom(): LookupData { | |
| 73858 | 73312 | if (Transform::validateFrom($this->from)) { |
| 73859 | 73313 | return $this->from; |
| 73860 | 73314 | } |
| @@ -73864,40 +73318,32 @@ class Transform { | ||
| 73864 | 73318 | /** |
| 73865 | 73319 | * Secondary data reference. |
| 73866 | 73320 | * |
| 73867 | - * @return ?LookupData | |
| 73321 | + * @return LookupData | |
| 73868 | 73322 | */ |
| 73869 | - public static function sampleFrom(): ?LookupData { | |
| 73323 | + public static function sampleFrom(): LookupData { | |
| 73870 | 73324 | return LookupData::sample(); /*35:from*/ |
| 73871 | 73325 | } |
| 73872 | 73326 | |
| 73873 | 73327 | /** |
| 73874 | 73328 | * Key in primary data source. |
| 73875 | 73329 | * |
| 73876 | - * @param ?string $value | |
| 73330 | + * @param string $value | |
| 73877 | 73331 | * @throws Exception |
| 73878 | - * @return ?string | |
| 73332 | + * @return string | |
| 73879 | 73333 | */ |
| 73880 | - public static function fromLookup(?string $value): ?string { | |
| 73881 | - if (!is_null($value)) { | |
| 73882 | - return $value; /*string*/ | |
| 73883 | - } else { | |
| 73884 | - return null; | |
| 73885 | - } | |
| 73334 | + public static function fromLookup(string $value): string { | |
| 73335 | + return $value; /*string*/ | |
| 73886 | 73336 | } |
| 73887 | 73337 | |
| 73888 | 73338 | /** |
| 73889 | 73339 | * Key in primary data source. |
| 73890 | 73340 | * |
| 73891 | 73341 | * @throws Exception |
| 73892 | - * @return ?string | |
| 73342 | + * @return string | |
| 73893 | 73343 | */ |
| 73894 | - public function toLookup(): ?string { | |
| 73344 | + public function toLookup(): string { | |
| 73895 | 73345 | if (Transform::validateLookup($this->lookup)) { |
| 73896 | - if (!is_null($this->lookup)) { | |
| 73897 | - return $this->lookup; /*string*/ | |
| 73898 | - } else { | |
| 73899 | - return null; | |
| 73900 | - } | |
| 73346 | + return $this->lookup; /*string*/ | |
| 73901 | 73347 | } |
| 73902 | 73348 | throw new Exception('never get to this Transform::lookup'); |
| 73903 | 73349 | } |
| @@ -73905,13 +73351,11 @@ class Transform { | ||
| 73905 | 73351 | /** |
| 73906 | 73352 | * Key in primary data source. |
| 73907 | 73353 | * |
| 73908 | - * @param string|null | |
| 73354 | + * @param string | |
| 73909 | 73355 | * @return bool |
| 73910 | 73356 | * @throws Exception |
| 73911 | 73357 | */ |
| 73912 | - public static function validateLookup(?string $value): bool { | |
| 73913 | - if (!is_null($value)) { | |
| 73914 | - } | |
| 73358 | + public static function validateLookup(string $value): bool { | |
| 73915 | 73359 | return true; |
| 73916 | 73360 | } |
| 73917 | 73361 | |
| @@ -73919,9 +73363,9 @@ class Transform { | ||
| 73919 | 73363 | * Key in primary data source. |
| 73920 | 73364 | * |
| 73921 | 73365 | * @throws Exception |
| 73922 | - * @return ?string | |
| 73366 | + * @return string | |
| 73923 | 73367 | */ |
| 73924 | - public function getLookup(): ?string { | |
| 73368 | + public function getLookup(): string { | |
| 73925 | 73369 | if (Transform::validateLookup($this->lookup)) { |
| 73926 | 73370 | return $this->lookup; |
| 73927 | 73371 | } |
| @@ -73931,23 +73375,21 @@ class Transform { | ||
| 73931 | 73375 | /** |
| 73932 | 73376 | * Key in primary data source. |
| 73933 | 73377 | * |
| 73934 | - * @return ?string | |
| 73378 | + * @return string | |
| 73935 | 73379 | */ |
| 73936 | - public static function sampleLookup(): ?string { | |
| 73380 | + public static function sampleLookup(): string { | |
| 73937 | 73381 | return 'Transform::lookup::36'; /*36:lookup*/ |
| 73938 | 73382 | } |
| 73939 | 73383 | |
| 73940 | 73384 | /** |
| 73941 | 73385 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 73942 | 73386 | * |
| 73943 | - * @param stdClass|bool|null $value | |
| 73387 | + * @param stdClass|bool $value | |
| 73944 | 73388 | * @throws Exception |
| 73945 | - * @return BinParams|bool|null | |
| 73389 | + * @return BinParams|bool | |
| 73946 | 73390 | */ |
| 73947 | - public static function fromBin(stdClass|bool|null $value): BinParams|bool|null { | |
| 73948 | - if (is_null($value)) { | |
| 73949 | - return $value; /*null*/ | |
| 73950 | - } elseif (is_object($value)) { | |
| 73391 | + public static function fromBin(stdClass|bool $value): BinParams|bool { | |
| 73392 | + if (is_object($value)) { | |
| 73951 | 73393 | return BinParams::from($value); /*class*/ |
| 73952 | 73394 | } elseif (is_bool($value)) { |
| 73953 | 73395 | return $value; /*bool*/ |
| @@ -73960,13 +73402,11 @@ class Transform { | ||
| 73960 | 73402 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 73961 | 73403 | * |
| 73962 | 73404 | * @throws Exception |
| 73963 | - * @return stdClass|bool|null | |
| 73405 | + * @return stdClass|bool | |
| 73964 | 73406 | */ |
| 73965 | - public function toBin(): stdClass|bool|null { | |
| 73407 | + public function toBin(): stdClass|bool { | |
| 73966 | 73408 | if (Transform::validateBin($this->bin)) { |
| 73967 | - if (is_null($this->bin)) { | |
| 73968 | - return $this->bin; /*null*/ | |
| 73969 | - } elseif ($this->bin instanceof BinParams) { | |
| 73409 | + if ($this->bin instanceof BinParams) { | |
| 73970 | 73410 | return $this->bin->to(); /*class*/ |
| 73971 | 73411 | } elseif (is_bool($this->bin)) { |
| 73972 | 73412 | return $this->bin; /*bool*/ |
| @@ -73980,16 +73420,12 @@ class Transform { | ||
| 73980 | 73420 | /** |
| 73981 | 73421 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 73982 | 73422 | * |
| 73983 | - * @param BinParams|bool|null | |
| 73423 | + * @param BinParams|bool | |
| 73984 | 73424 | * @return bool |
| 73985 | 73425 | * @throws Exception |
| 73986 | 73426 | */ |
| 73987 | - public static function validateBin(BinParams|bool|null $value): bool { | |
| 73988 | - if (is_null($value)) { | |
| 73989 | - if (!is_null($value)) { | |
| 73990 | - throw new Exception("Attribute Error:Transform::bin"); | |
| 73991 | - } | |
| 73992 | - } elseif ($value instanceof BinParams) { | |
| 73427 | + public static function validateBin(BinParams|bool $value): bool { | |
| 73428 | + if ($value instanceof BinParams) { | |
| 73993 | 73429 | $value->validate(); |
| 73994 | 73430 | } elseif (is_bool($value)) { |
| 73995 | 73431 | if (!is_bool($value)) { |
| @@ -74005,9 +73441,9 @@ class Transform { | ||
| 74005 | 73441 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 74006 | 73442 | * |
| 74007 | 73443 | * @throws Exception |
| 74008 | - * @return BinParams|bool|null | |
| 73444 | + * @return BinParams|bool | |
| 74009 | 73445 | */ |
| 74010 | - public function getBin(): BinParams|bool|null { | |
| 73446 | + public function getBin(): BinParams|bool { | |
| 74011 | 73447 | if (Transform::validateBin($this->bin)) { |
| 74012 | 73448 | return $this->bin; |
| 74013 | 73449 | } |
| @@ -74017,9 +73453,9 @@ class Transform { | ||
| 74017 | 73453 | /** |
| 74018 | 73454 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 74019 | 73455 | * |
| 74020 | - * @return BinParams|bool|null | |
| 73456 | + * @return BinParams|bool | |
| 74021 | 73457 | */ |
| 74022 | - public static function sampleBin(): BinParams|bool|null { | |
| 73458 | + public static function sampleBin(): BinParams|bool { | |
| 74023 | 73459 | return BinParams::sample(); /*37:bin*/ |
| 74024 | 73460 | } |
| 74025 | 73461 | |
| @@ -74028,16 +73464,12 @@ class Transform { | ||
| 74028 | 73464 | * |
| 74029 | 73465 | * The data field to apply time unit. |
| 74030 | 73466 | * |
| 74031 | - * @param ?string $value | |
| 73467 | + * @param string $value | |
| 74032 | 73468 | * @throws Exception |
| 74033 | - * @return ?string | |
| 73469 | + * @return string | |
| 74034 | 73470 | */ |
| 74035 | - public static function fromField(?string $value): ?string { | |
| 74036 | - if (!is_null($value)) { | |
| 74037 | - return $value; /*string*/ | |
| 74038 | - } else { | |
| 74039 | - return null; | |
| 74040 | - } | |
| 73471 | + public static function fromField(string $value): string { | |
| 73472 | + return $value; /*string*/ | |
| 74041 | 73473 | } |
| 74042 | 73474 | |
| 74043 | 73475 | /** |
| @@ -74046,15 +73478,11 @@ class Transform { | ||
| 74046 | 73478 | * The data field to apply time unit. |
| 74047 | 73479 | * |
| 74048 | 73480 | * @throws Exception |
| 74049 | - * @return ?string | |
| 73481 | + * @return string | |
| 74050 | 73482 | */ |
| 74051 | - public function toField(): ?string { | |
| 73483 | + public function toField(): string { | |
| 74052 | 73484 | if (Transform::validateField($this->field)) { |
| 74053 | - if (!is_null($this->field)) { | |
| 74054 | - return $this->field; /*string*/ | |
| 74055 | - } else { | |
| 74056 | - return null; | |
| 74057 | - } | |
| 73485 | + return $this->field; /*string*/ | |
| 74058 | 73486 | } |
| 74059 | 73487 | throw new Exception('never get to this Transform::field'); |
| 74060 | 73488 | } |
| @@ -74064,13 +73492,11 @@ class Transform { | ||
| 74064 | 73492 | * |
| 74065 | 73493 | * The data field to apply time unit. |
| 74066 | 73494 | * |
| 74067 | - * @param string|null | |
| 73495 | + * @param string | |
| 74068 | 73496 | * @return bool |
| 74069 | 73497 | * @throws Exception |
| 74070 | 73498 | */ |
| 74071 | - public static function validateField(?string $value): bool { | |
| 74072 | - if (!is_null($value)) { | |
| 74073 | - } | |
| 73499 | + public static function validateField(string $value): bool { | |
| 74074 | 73500 | return true; |
| 74075 | 73501 | } |
| 74076 | 73502 | |
| @@ -74080,9 +73506,9 @@ class Transform { | ||
| 74080 | 73506 | * The data field to apply time unit. |
| 74081 | 73507 | * |
| 74082 | 73508 | * @throws Exception |
| 74083 | - * @return ?string | |
| 73509 | + * @return string | |
| 74084 | 73510 | */ |
| 74085 | - public function getField(): ?string { | |
| 73511 | + public function getField(): string { | |
| 74086 | 73512 | if (Transform::validateField($this->field)) { |
| 74087 | 73513 | return $this->field; |
| 74088 | 73514 | } |
| @@ -74094,40 +73520,32 @@ class Transform { | ||
| 74094 | 73520 | * |
| 74095 | 73521 | * The data field to apply time unit. |
| 74096 | 73522 | * |
| 74097 | - * @return ?string | |
| 73523 | + * @return string | |
| 74098 | 73524 | */ |
| 74099 | - public static function sampleField(): ?string { | |
| 73525 | + public static function sampleField(): string { | |
| 74100 | 73526 | return 'Transform::field::38'; /*38:field*/ |
| 74101 | 73527 | } |
| 74102 | 73528 | |
| 74103 | 73529 | /** |
| 74104 | 73530 | * The timeUnit. |
| 74105 | 73531 | * |
| 74106 | - * @param ?string $value | |
| 73532 | + * @param string $value | |
| 74107 | 73533 | * @throws Exception |
| 74108 | - * @return ?TimeUnit | |
| 73534 | + * @return TimeUnit | |
| 74109 | 73535 | */ |
| 74110 | - public static function fromTimeUnit(?string $value): ?TimeUnit { | |
| 74111 | - if (!is_null($value)) { | |
| 74112 | - return TimeUnit::from($value); /*enum*/ | |
| 74113 | - } else { | |
| 74114 | - return null; | |
| 74115 | - } | |
| 73536 | + public static function fromTimeUnit(string $value): TimeUnit { | |
| 73537 | + return TimeUnit::from($value); /*enum*/ | |
| 74116 | 73538 | } |
| 74117 | 73539 | |
| 74118 | 73540 | /** |
| 74119 | 73541 | * The timeUnit. |
| 74120 | 73542 | * |
| 74121 | 73543 | * @throws Exception |
| 74122 | - * @return ?string | |
| 73544 | + * @return string | |
| 74123 | 73545 | */ |
| 74124 | - public function toTimeUnit(): ?string { | |
| 73546 | + public function toTimeUnit(): string { | |
| 74125 | 73547 | if (Transform::validateTimeUnit($this->timeUnit)) { |
| 74126 | - if (!is_null($this->timeUnit)) { | |
| 74127 | - return TimeUnit::to($this->timeUnit); /*enum*/ | |
| 74128 | - } else { | |
| 74129 | - return null; | |
| 74130 | - } | |
| 73548 | + return TimeUnit::to($this->timeUnit); /*enum*/ | |
| 74131 | 73549 | } |
| 74132 | 73550 | throw new Exception('never get to this Transform::timeUnit'); |
| 74133 | 73551 | } |
| @@ -74135,14 +73553,12 @@ class Transform { | ||
| 74135 | 73553 | /** |
| 74136 | 73554 | * The timeUnit. |
| 74137 | 73555 | * |
| 74138 | - * @param TimeUnit|null | |
| 73556 | + * @param TimeUnit | |
| 74139 | 73557 | * @return bool |
| 74140 | 73558 | * @throws Exception |
| 74141 | 73559 | */ |
| 74142 | - public static function validateTimeUnit(?TimeUnit $value): bool { | |
| 74143 | - if (!is_null($value)) { | |
| 74144 | - TimeUnit::to($value); | |
| 74145 | - } | |
| 73560 | + public static function validateTimeUnit(TimeUnit $value): bool { | |
| 73561 | + TimeUnit::to($value); | |
| 74146 | 73562 | return true; |
| 74147 | 73563 | } |
| 74148 | 73564 | |
| @@ -74150,9 +73566,9 @@ class Transform { | ||
| 74150 | 73566 | * The timeUnit. |
| 74151 | 73567 | * |
| 74152 | 73568 | * @throws Exception |
| 74153 | - * @return ?TimeUnit | |
| 73569 | + * @return TimeUnit | |
| 74154 | 73570 | */ |
| 74155 | - public function getTimeUnit(): ?TimeUnit { | |
| 73571 | + public function getTimeUnit(): TimeUnit { | |
| 74156 | 73572 | if (Transform::validateTimeUnit($this->timeUnit)) { |
| 74157 | 73573 | return $this->timeUnit; |
| 74158 | 73574 | } |
| @@ -74162,44 +73578,36 @@ class Transform { | ||
| 74162 | 73578 | /** |
| 74163 | 73579 | * The timeUnit. |
| 74164 | 73580 | * |
| 74165 | - * @return ?TimeUnit | |
| 73581 | + * @return TimeUnit | |
| 74166 | 73582 | */ |
| 74167 | - public static function sampleTimeUnit(): ?TimeUnit { | |
| 73583 | + public static function sampleTimeUnit(): TimeUnit { | |
| 74168 | 73584 | return TimeUnit::sample(); /*enum*/ |
| 74169 | 73585 | } |
| 74170 | 73586 | |
| 74171 | 73587 | /** |
| 74172 | 73588 | * Array of objects that define fields to aggregate. |
| 74173 | 73589 | * |
| 74174 | - * @param ?array $value | |
| 73590 | + * @param array $value | |
| 74175 | 73591 | * @throws Exception |
| 74176 | - * @return ?array | |
| 73592 | + * @return array | |
| 74177 | 73593 | */ |
| 74178 | - public static function fromAggregate(?array $value): ?array { | |
| 74179 | - if (!is_null($value)) { | |
| 74180 | - return array_map(function ($value) { | |
| 74181 | - return AggregatedFieldDef::from($value); /*class*/ | |
| 74182 | - }, $value); | |
| 74183 | - } else { | |
| 74184 | - return null; | |
| 74185 | - } | |
| 73594 | + public static function fromAggregate(array $value): array { | |
| 73595 | + return array_map(function ($value) { | |
| 73596 | + return AggregatedFieldDef::from($value); /*class*/ | |
| 73597 | + }, $value); | |
| 74186 | 73598 | } |
| 74187 | 73599 | |
| 74188 | 73600 | /** |
| 74189 | 73601 | * Array of objects that define fields to aggregate. |
| 74190 | 73602 | * |
| 74191 | 73603 | * @throws Exception |
| 74192 | - * @return ?array | |
| 73604 | + * @return array | |
| 74193 | 73605 | */ |
| 74194 | - public function toAggregate(): ?array { | |
| 73606 | + public function toAggregate(): array { | |
| 74195 | 73607 | if (Transform::validateAggregate($this->aggregate)) { |
| 74196 | - if (!is_null($this->aggregate)) { | |
| 74197 | - return array_map(function ($value) { | |
| 74198 | - return $value->to(); /*class*/ | |
| 74199 | - }, $this->aggregate); | |
| 74200 | - } else { | |
| 74201 | - return null; | |
| 74202 | - } | |
| 73608 | + return array_map(function ($value) { | |
| 73609 | + return $value->to(); /*class*/ | |
| 73610 | + }, $this->aggregate); | |
| 74203 | 73611 | } |
| 74204 | 73612 | throw new Exception('never get to this Transform::aggregate'); |
| 74205 | 73613 | } |
| @@ -74207,19 +73615,17 @@ class Transform { | ||
| 74207 | 73615 | /** |
| 74208 | 73616 | * Array of objects that define fields to aggregate. |
| 74209 | 73617 | * |
| 74210 | - * @param array|null | |
| 73618 | + * @param array | |
| 74211 | 73619 | * @return bool |
| 74212 | 73620 | * @throws Exception |
| 74213 | 73621 | */ |
| 74214 | - public static function validateAggregate(?array $value): bool { | |
| 74215 | - if (!is_null($value)) { | |
| 74216 | - if (!is_array($value)) { | |
| 74217 | - throw new Exception("Attribute Error:Transform::aggregate"); | |
| 74218 | - } | |
| 74219 | - array_walk($value, function($value_v) { | |
| 74220 | - $value_v->validate(); | |
| 74221 | - }); | |
| 73622 | + public static function validateAggregate(array $value): bool { | |
| 73623 | + if (!is_array($value)) { | |
| 73624 | + throw new Exception("Attribute Error:Transform::aggregate"); | |
| 74222 | 73625 | } |
| 73626 | + array_walk($value, function($value_v) { | |
| 73627 | + $value_v->validate(); | |
| 73628 | + }); | |
| 74223 | 73629 | return true; |
| 74224 | 73630 | } |
| 74225 | 73631 | |
| @@ -74227,9 +73633,9 @@ class Transform { | ||
| 74227 | 73633 | * Array of objects that define fields to aggregate. |
| 74228 | 73634 | * |
| 74229 | 73635 | * @throws Exception |
| 74230 | - * @return ?array | |
| 73636 | + * @return array | |
| 74231 | 73637 | */ |
| 74232 | - public function getAggregate(): ?array { | |
| 73638 | + public function getAggregate(): array { | |
| 74233 | 73639 | if (Transform::validateAggregate($this->aggregate)) { |
| 74234 | 73640 | return $this->aggregate; |
| 74235 | 73641 | } |
| @@ -74239,9 +73645,9 @@ class Transform { | ||
| 74239 | 73645 | /** |
| 74240 | 73646 | * Array of objects that define fields to aggregate. |
| 74241 | 73647 | * |
| 74242 | - * @return ?array | |
| 73648 | + * @return array | |
| 74243 | 73649 | */ |
| 74244 | - public static function sampleAggregate(): ?array { | |
| 73650 | + public static function sampleAggregate(): array { | |
| 74245 | 73651 | return array( |
| 74246 | 73652 | AggregatedFieldDef::sample() /*40:*/ |
| 74247 | 73653 | ); /* 40:aggregate*/ |
Mschema-pikedefault / TopLevel.pmod+140 −165
| @@ -19,7 +19,7 @@ class TopLevel { | ||
| 19 | 19 | Config|mixed config; // json: "config" |
| 20 | 20 | Data|mixed data; // json: "data" |
| 21 | 21 | mixed|string description; // json: "description" |
| 22 | - EncodingWithFacet|mixed encoding; // json: "encoding" | |
| 22 | + EncodingWithFacet encoding; // json: "encoding" | |
| 23 | 23 | float|mixed height; // json: "height" |
| 24 | 24 | AnyMark mark; // json: "mark" |
| 25 | 25 | mixed|string name; // json: "name" |
| @@ -29,13 +29,13 @@ class TopLevel { | ||
| 29 | 29 | Title title; // json: "title" |
| 30 | 30 | array(Transform)|mixed transform; // json: "transform" |
| 31 | 31 | float|mixed width; // json: "width" |
| 32 | - array(LayerSpec)|mixed layer; // json: "layer" | |
| 32 | + array(LayerSpec) layer; // json: "layer" | |
| 33 | 33 | Resolve|mixed resolve; // json: "resolve" |
| 34 | - FacetMapping|mixed facet; // json: "facet" | |
| 35 | - Spec|mixed spec; // json: "spec" | |
| 36 | - Repeat|mixed repeat; // json: "repeat" | |
| 37 | - array(Spec)|mixed vconcat; // json: "vconcat" | |
| 38 | - array(Spec)|mixed hconcat; // json: "hconcat" | |
| 34 | + FacetMapping facet; // json: "facet" | |
| 35 | + Spec spec; // json: "spec" | |
| 36 | + Repeat repeat; // json: "repeat" | |
| 37 | + array(Spec) vconcat; // json: "vconcat" | |
| 38 | + array(Spec) hconcat; // json: "hconcat" | |
| 39 | 39 | |
| 40 | 40 | string encode_json() { |
| 41 | 41 | mapping(string:mixed) json = ([ |
| @@ -1225,7 +1225,7 @@ RangeConfigValue RangeConfigValue_from_JSON(mixed json) { | ||
| 1225 | 1225 | class VgScheme { |
| 1226 | 1226 | float|mixed count; // json: "count" |
| 1227 | 1227 | array(float)|mixed extent; // json: "extent" |
| 1228 | - mixed|string scheme; // json: "scheme" | |
| 1228 | + string scheme; // json: "scheme" | |
| 1229 | 1229 | float|mixed step; // json: "step" |
| 1230 | 1230 | |
| 1231 | 1231 | string encode_json() { |
| @@ -1597,12 +1597,12 @@ SingleSelectionConfig SingleSelectionConfig_from_JSON(mixed json) { | ||
| 1597 | 1597 | } |
| 1598 | 1598 | |
| 1599 | 1599 | class VgBinding { |
| 1600 | - mixed|string element; // json: "element" | |
| 1601 | - string input; // json: "input" | |
| 1602 | - array(string)|mixed options; // json: "options" | |
| 1603 | - float|mixed max; // json: "max" | |
| 1604 | - float|mixed min; // json: "min" | |
| 1605 | - float|mixed step; // json: "step" | |
| 1600 | + mixed|string element; // json: "element" | |
| 1601 | + string input; // json: "input" | |
| 1602 | + array(string) options; // json: "options" | |
| 1603 | + float|mixed max; // json: "max" | |
| 1604 | + float|mixed min; // json: "min" | |
| 1605 | + float|mixed step; // json: "step" | |
| 1606 | 1606 | |
| 1607 | 1607 | string encode_json() { |
| 1608 | 1608 | mapping(string:mixed) json = ([ |
| @@ -2079,9 +2079,9 @@ ViewConfig ViewConfig_from_JSON(mixed json) { | ||
| 2079 | 2079 | // Secondary data source to lookup in. |
| 2080 | 2080 | class Data { |
| 2081 | 2081 | DataFormat|mixed format; // json: "format" |
| 2082 | - mixed|string url; // json: "url" | |
| 2082 | + string url; // json: "url" | |
| 2083 | 2083 | Values values; // json: "values" |
| 2084 | - mixed|string name; // json: "name" | |
| 2084 | + string name; // json: "name" | |
| 2085 | 2085 | |
| 2086 | 2086 | string encode_json() { |
| 2087 | 2087 | mapping(string:mixed) json = ([ |
| @@ -2281,16 +2281,16 @@ EncodingWithFacet EncodingWithFacet_from_JSON(mixed json) { | ||
| 2281 | 2281 | // value: ..., |
| 2282 | 2282 | // } |
| 2283 | 2283 | class MarkPropDefWithCondition { |
| 2284 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 2285 | - Bin bin; // json: "bin" | |
| 2286 | - ColorCondition condition; // json: "condition" | |
| 2287 | - Field field; // json: "field" | |
| 2288 | - Legend|mixed legend; // json: "legend" | |
| 2289 | - Scale|mixed scale; // json: "scale" | |
| 2290 | - SortUnion sort; // json: "sort" | |
| 2291 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 2292 | - Type|mixed type; // json: "type" | |
| 2293 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 2284 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 2285 | + ColorBin bin; // json: "bin" | |
| 2286 | + ColorCondition condition; // json: "condition" | |
| 2287 | + Field field; // json: "field" | |
| 2288 | + Legend|mixed legend; // json: "legend" | |
| 2289 | + Scale|mixed scale; // json: "scale" | |
| 2290 | + SortUnion sort; // json: "sort" | |
| 2291 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 2292 | + Type type; // json: "type" | |
| 2293 | + ColorValue value; // json: "value" | |
| 2294 | 2294 | |
| 2295 | 2295 | string encode_json() { |
| 2296 | 2296 | mapping(string:mixed) json = ([ |
| @@ -2351,9 +2351,9 @@ enum AggregateOp { | ||
| 2351 | 2351 | VARIANCEP = "variancep", // json: "variancep" |
| 2352 | 2352 | } |
| 2353 | 2353 | |
| 2354 | -typedef BinParams|bool Bin; | |
| 2354 | +typedef BinParams|bool ColorBin; | |
| 2355 | 2355 | |
| 2356 | -Bin Bin_from_JSON(mixed json) { | |
| 2356 | +ColorBin ColorBin_from_JSON(mixed json) { | |
| 2357 | 2357 | return json; |
| 2358 | 2358 | } |
| 2359 | 2359 | |
| @@ -2406,9 +2406,9 @@ ColorCondition ColorCondition_from_JSON(mixed json) { | ||
| 2406 | 2406 | } |
| 2407 | 2407 | |
| 2408 | 2408 | class ConditionalValueDef { |
| 2409 | - ConditionalValueDefLogicalOperandPredicate test; // json: "test" | |
| 2410 | - ConditionalValueDefValue value; // json: "value" | |
| 2411 | - ConditionalValueDefSelectionOperand selection; // json: "selection" | |
| 2409 | + LogicalOperandPredicate test; // json: "test" | |
| 2410 | + ConditionalValueDefValue value; // json: "value" | |
| 2411 | + SelectionOperand selection; // json: "selection" | |
| 2412 | 2412 | |
| 2413 | 2413 | string encode_json() { |
| 2414 | 2414 | mapping(string:mixed) json = ([ |
| @@ -2431,20 +2431,10 @@ ConditionalValueDef ConditionalValueDef_from_JSON(mixed json) { | ||
| 2431 | 2431 | return retval; |
| 2432 | 2432 | } |
| 2433 | 2433 | |
| 2434 | -// Filter using a selection name. | |
| 2435 | -// | |
| 2436 | -// A [selection name](selection.html), or a series of [composed | |
| 2437 | -// selections](selection.html#compose). | |
| 2438 | -typedef string|Selection SelectionOperandElement; | |
| 2439 | - | |
| 2440 | -SelectionOperandElement SelectionOperandElement_from_JSON(mixed json) { | |
| 2441 | - return json; | |
| 2442 | -} | |
| 2443 | - | |
| 2444 | 2434 | class Selection { |
| 2445 | - ConditionalValueDefSelectionOperand not; // json: "not" | |
| 2446 | - array(SelectionOperandElement)|mixed and; // json: "and" | |
| 2447 | - array(SelectionOperandElement)|mixed or; // json: "or" | |
| 2435 | + SelectionOperand not; // json: "not" | |
| 2436 | + array(SelectionOperand) and; // json: "and" | |
| 2437 | + array(SelectionOperand) or; // json: "or" | |
| 2448 | 2438 | |
| 2449 | 2439 | string encode_json() { |
| 2450 | 2440 | mapping(string:mixed) json = ([ |
| @@ -2471,36 +2461,22 @@ Selection Selection_from_JSON(mixed json) { | ||
| 2471 | 2461 | // |
| 2472 | 2462 | // A [selection name](selection.html), or a series of [composed |
| 2473 | 2463 | // selections](selection.html#compose). |
| 2474 | -typedef string|Selection ConditionalValueDefSelectionOperand; | |
| 2464 | +typedef string|Selection SelectionOperand; | |
| 2475 | 2465 | |
| 2476 | -ConditionalValueDefSelectionOperand ConditionalValueDefSelectionOperand_from_JSON(mixed json) { | |
| 2477 | - return json; | |
| 2478 | -} | |
| 2479 | - | |
| 2480 | -// The `filter` property must be one of the predicate definitions: | |
| 2481 | -// (1) an [expression](types.html#expression) string, | |
| 2482 | -// where `datum` can be used to refer to the current data object; | |
| 2483 | -// (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 2484 | -// [range predicate](filter.html#range-predicate), [one-of | |
| 2485 | -// predicate](filter.html#one-of-predicate); | |
| 2486 | -// (3) a [selection predicate](filter.html#selection-predicate); | |
| 2487 | -// or (4) a logical operand that combines (1), (2), or (3). | |
| 2488 | -typedef Predicate|string LogicalOperandPredicateElement; | |
| 2489 | - | |
| 2490 | -LogicalOperandPredicateElement LogicalOperandPredicateElement_from_JSON(mixed json) { | |
| 2466 | +SelectionOperand SelectionOperand_from_JSON(mixed json) { | |
| 2491 | 2467 | return json; |
| 2492 | 2468 | } |
| 2493 | 2469 | |
| 2494 | 2470 | class Predicate { |
| 2495 | - ConditionalValueDefLogicalOperandPredicate not; // json: "not" | |
| 2496 | - array(LogicalOperandPredicateElement)|mixed and; // json: "and" | |
| 2497 | - array(LogicalOperandPredicateElement)|mixed or; // json: "or" | |
| 2498 | - EqualUnion equal; // json: "equal" | |
| 2499 | - mixed|string field; // json: "field" | |
| 2500 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 2501 | - array(RangeElement)|mixed range; // json: "range" | |
| 2502 | - array(OneOfElement)|mixed one_of; // json: "oneOf" | |
| 2503 | - ConditionalValueDefSelectionOperand selection; // json: "selection" | |
| 2471 | + LogicalOperandPredicate not; // json: "not" | |
| 2472 | + array(LogicalOperandPredicate) and; // json: "and" | |
| 2473 | + array(LogicalOperandPredicate) or; // json: "or" | |
| 2474 | + Equal equal; // json: "equal" | |
| 2475 | + string field; // json: "field" | |
| 2476 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 2477 | + array(RangeElement) range; // json: "range" | |
| 2478 | + array(Equal) one_of; // json: "oneOf" | |
| 2479 | + SelectionOperand selection; // json: "selection" | |
| 2504 | 2480 | |
| 2505 | 2481 | string encode_json() { |
| 2506 | 2482 | mapping(string:mixed) json = ([ |
| @@ -2543,16 +2519,16 @@ Predicate Predicate_from_JSON(mixed json) { | ||
| 2543 | 2519 | // predicate](filter.html#one-of-predicate); |
| 2544 | 2520 | // (3) a [selection predicate](filter.html#selection-predicate); |
| 2545 | 2521 | // or (4) a logical operand that combines (1), (2), or (3). |
| 2546 | -typedef Predicate|string ConditionalValueDefLogicalOperandPredicate; | |
| 2522 | +typedef Predicate|string LogicalOperandPredicate; | |
| 2547 | 2523 | |
| 2548 | -ConditionalValueDefLogicalOperandPredicate ConditionalValueDefLogicalOperandPredicate_from_JSON(mixed json) { | |
| 2524 | +LogicalOperandPredicate LogicalOperandPredicate_from_JSON(mixed json) { | |
| 2549 | 2525 | return json; |
| 2550 | 2526 | } |
| 2551 | 2527 | |
| 2552 | 2528 | // The value that the field should be equal to. |
| 2553 | -typedef bool|DateTime|float|string EqualUnion; | |
| 2529 | +typedef bool|DateTime|float|string Equal; | |
| 2554 | 2530 | |
| 2555 | -EqualUnion EqualUnion_from_JSON(mixed json) { | |
| 2531 | +Equal Equal_from_JSON(mixed json) { | |
| 2556 | 2532 | return json; |
| 2557 | 2533 | } |
| 2558 | 2534 | |
| @@ -2627,13 +2603,6 @@ Month Month_from_JSON(mixed json) { | ||
| 2627 | 2603 | return json; |
| 2628 | 2604 | } |
| 2629 | 2605 | |
| 2630 | -// The value that the field should be equal to. | |
| 2631 | -typedef bool|DateTime|float|string OneOfElement; | |
| 2632 | - | |
| 2633 | -OneOfElement OneOfElement_from_JSON(mixed json) { | |
| 2634 | - return json; | |
| 2635 | -} | |
| 2636 | - | |
| 2637 | 2606 | typedef DateTime|float RangeElement; |
| 2638 | 2607 | |
| 2639 | 2608 | RangeElement RangeElement_from_JSON(mixed json) { |
| @@ -2698,17 +2667,17 @@ ConditionalValueDefValue ConditionalValueDefValue_from_JSON(mixed json) { | ||
| 2698 | 2667 | } |
| 2699 | 2668 | |
| 2700 | 2669 | class ConditionalPredicateMarkPropFieldDefClass { |
| 2701 | - ConditionalValueDefLogicalOperandPredicate test; // json: "test" | |
| 2702 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 2703 | - ConditionalValueDefSelectionOperand selection; // json: "selection" | |
| 2704 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 2705 | - Bin bin; // json: "bin" | |
| 2706 | - Field field; // json: "field" | |
| 2707 | - Legend|mixed legend; // json: "legend" | |
| 2708 | - Scale|mixed scale; // json: "scale" | |
| 2709 | - SortUnion sort; // json: "sort" | |
| 2710 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 2711 | - Type|mixed type; // json: "type" | |
| 2670 | + LogicalOperandPredicate test; // json: "test" | |
| 2671 | + ConditionalValueDefValue value; // json: "value" | |
| 2672 | + SelectionOperand selection; // json: "selection" | |
| 2673 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 2674 | + ColorBin bin; // json: "bin" | |
| 2675 | + Field field; // json: "field" | |
| 2676 | + Legend|mixed legend; // json: "legend" | |
| 2677 | + Scale|mixed scale; // json: "scale" | |
| 2678 | + SortUnion sort; // json: "sort" | |
| 2679 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 2680 | + Type type; // json: "type" | |
| 2712 | 2681 | |
| 2713 | 2682 | string encode_json() { |
| 2714 | 2683 | mapping(string:mixed) json = ([ |
| @@ -2921,7 +2890,7 @@ Scale Scale_from_JSON(mixed json) { | ||
| 2921 | 2890 | // |
| 2922 | 2891 | // The `selection` property can be used to [interactively |
| 2923 | 2892 | // determine](selection.html#scale-domains) the scale domain. |
| 2924 | -typedef DomainClass|Domain|array(OneOfElement) DomainUnion; | |
| 2893 | +typedef DomainClass|Domain|array(Equal) DomainUnion; | |
| 2925 | 2894 | |
| 2926 | 2895 | DomainUnion DomainUnion_from_JSON(mixed json) { |
| 2927 | 2896 | return json; |
| @@ -3195,9 +3164,9 @@ enum Type { | ||
| 3195 | 3164 | // `0` to `1` for opacity). |
| 3196 | 3165 | // |
| 3197 | 3166 | // A constant value in visual domain. |
| 3198 | -typedef bool|float|string ConditionalPredicateValueDefValue; | |
| 3167 | +typedef bool|float|string ColorValue; | |
| 3199 | 3168 | |
| 3200 | -ConditionalPredicateValueDefValue ConditionalPredicateValueDefValue_from_JSON(mixed json) { | |
| 3169 | +ColorValue ColorValue_from_JSON(mixed json) { | |
| 3201 | 3170 | return json; |
| 3202 | 3171 | } |
| 3203 | 3172 | |
| @@ -3206,7 +3175,7 @@ ConditionalPredicateValueDefValue ConditionalPredicateValueDefValue_from_JSON(mi | ||
| 3206 | 3175 | // Vertical facets for trellis plots. |
| 3207 | 3176 | class FacetFieldDef { |
| 3208 | 3177 | AggregateOp|mixed aggregate; // json: "aggregate" |
| 3209 | - Bin bin; // json: "bin" | |
| 3178 | + ColorBin bin; // json: "bin" | |
| 3210 | 3179 | Field field; // json: "field" |
| 3211 | 3180 | Header|mixed header; // json: "header" |
| 3212 | 3181 | SortEnum|mixed sort; // json: "sort" |
| @@ -3280,7 +3249,7 @@ Detail Detail_from_JSON(mixed json) { | ||
| 3280 | 3249 | // Definition object for a data field, its type and transformation of an encoding channel. |
| 3281 | 3250 | class FieldDef { |
| 3282 | 3251 | AggregateOp|mixed aggregate; // json: "aggregate" |
| 3283 | - Bin bin; // json: "bin" | |
| 3252 | + ColorBin bin; // json: "bin" | |
| 3284 | 3253 | Field field; // json: "field" |
| 3285 | 3254 | TimeUnit|mixed time_unit; // json: "timeUnit" |
| 3286 | 3255 | Type type; // json: "type" |
| @@ -3325,13 +3294,13 @@ FieldDef FieldDef_from_JSON(mixed json) { | ||
| 3325 | 3294 | // value: ..., |
| 3326 | 3295 | // } |
| 3327 | 3296 | class DefWithCondition { |
| 3328 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3329 | - Bin bin; // json: "bin" | |
| 3330 | - HrefCondition condition; // json: "condition" | |
| 3331 | - Field field; // json: "field" | |
| 3332 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3333 | - Type|mixed type; // json: "type" | |
| 3334 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 3297 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3298 | + ColorBin bin; // json: "bin" | |
| 3299 | + HrefCondition condition; // json: "condition" | |
| 3300 | + Field field; // json: "field" | |
| 3301 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3302 | + Type type; // json: "type" | |
| 3303 | + ColorValue value; // json: "value" | |
| 3335 | 3304 | |
| 3336 | 3305 | string encode_json() { |
| 3337 | 3306 | mapping(string:mixed) json = ([ |
| @@ -3369,14 +3338,14 @@ HrefCondition HrefCondition_from_JSON(mixed json) { | ||
| 3369 | 3338 | } |
| 3370 | 3339 | |
| 3371 | 3340 | class ConditionalPredicateFieldDefClass { |
| 3372 | - ConditionalValueDefLogicalOperandPredicate test; // json: "test" | |
| 3373 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 3374 | - ConditionalValueDefSelectionOperand selection; // json: "selection" | |
| 3375 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3376 | - Bin bin; // json: "bin" | |
| 3377 | - Field field; // json: "field" | |
| 3378 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3379 | - Type|mixed type; // json: "type" | |
| 3341 | + LogicalOperandPredicate test; // json: "test" | |
| 3342 | + ConditionalValueDefValue value; // json: "value" | |
| 3343 | + SelectionOperand selection; // json: "selection" | |
| 3344 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3345 | + ColorBin bin; // json: "bin" | |
| 3346 | + Field field; // json: "field" | |
| 3347 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3348 | + Type type; // json: "type" | |
| 3380 | 3349 | |
| 3381 | 3350 | string encode_json() { |
| 3382 | 3351 | mapping(string:mixed) json = ([ |
| @@ -3417,7 +3386,7 @@ Order Order_from_JSON(mixed json) { | ||
| 3417 | 3386 | |
| 3418 | 3387 | class OrderFieldDef { |
| 3419 | 3388 | AggregateOp|mixed aggregate; // json: "aggregate" |
| 3420 | - Bin bin; // json: "bin" | |
| 3389 | + ColorBin bin; // json: "bin" | |
| 3421 | 3390 | Field field; // json: "field" |
| 3422 | 3391 | SortEnum|mixed sort; // json: "sort" |
| 3423 | 3392 | TimeUnit|mixed time_unit; // json: "timeUnit" |
| @@ -3467,14 +3436,14 @@ OrderFieldDef OrderFieldDef_from_JSON(mixed json) { | ||
| 3467 | 3436 | // value: ..., |
| 3468 | 3437 | // } |
| 3469 | 3438 | class TextDefWithCondition { |
| 3470 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3471 | - Bin bin; // json: "bin" | |
| 3472 | - TextCondition condition; // json: "condition" | |
| 3473 | - Field field; // json: "field" | |
| 3474 | - mixed|string format; // json: "format" | |
| 3475 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3476 | - Type|mixed type; // json: "type" | |
| 3477 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 3439 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3440 | + ColorBin bin; // json: "bin" | |
| 3441 | + TextCondition condition; // json: "condition" | |
| 3442 | + Field field; // json: "field" | |
| 3443 | + mixed|string format; // json: "format" | |
| 3444 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3445 | + Type type; // json: "type" | |
| 3446 | + ColorValue value; // json: "value" | |
| 3478 | 3447 | |
| 3479 | 3448 | string encode_json() { |
| 3480 | 3449 | mapping(string:mixed) json = ([ |
| @@ -3514,15 +3483,15 @@ TextCondition TextCondition_from_JSON(mixed json) { | ||
| 3514 | 3483 | } |
| 3515 | 3484 | |
| 3516 | 3485 | class ConditionalPredicateTextFieldDefClass { |
| 3517 | - ConditionalValueDefLogicalOperandPredicate test; // json: "test" | |
| 3518 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 3519 | - ConditionalValueDefSelectionOperand selection; // json: "selection" | |
| 3520 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3521 | - Bin bin; // json: "bin" | |
| 3522 | - Field field; // json: "field" | |
| 3523 | - mixed|string format; // json: "format" | |
| 3524 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3525 | - Type|mixed type; // json: "type" | |
| 3486 | + LogicalOperandPredicate test; // json: "test" | |
| 3487 | + ConditionalValueDefValue value; // json: "value" | |
| 3488 | + SelectionOperand selection; // json: "selection" | |
| 3489 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3490 | + ColorBin bin; // json: "bin" | |
| 3491 | + Field field; // json: "field" | |
| 3492 | + mixed|string format; // json: "format" | |
| 3493 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3494 | + Type type; // json: "type" | |
| 3526 | 3495 | |
| 3527 | 3496 | string encode_json() { |
| 3528 | 3497 | mapping(string:mixed) json = ([ |
| @@ -3563,16 +3532,16 @@ ConditionalPredicateTextFieldDefClass ConditionalPredicateTextFieldDefClass_from | ||
| 3563 | 3532 | // |
| 3564 | 3533 | // Definition object for a constant value of an encoding channel. |
| 3565 | 3534 | class XClass { |
| 3566 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3567 | - Axis|mixed axis; // json: "axis" | |
| 3568 | - Bin bin; // json: "bin" | |
| 3569 | - Field field; // json: "field" | |
| 3570 | - Scale|mixed scale; // json: "scale" | |
| 3571 | - SortUnion sort; // json: "sort" | |
| 3572 | - StackOffset|mixed stack; // json: "stack" | |
| 3573 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3574 | - Type|mixed type; // json: "type" | |
| 3575 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 3535 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3536 | + Axis|mixed axis; // json: "axis" | |
| 3537 | + ColorBin bin; // json: "bin" | |
| 3538 | + Field field; // json: "field" | |
| 3539 | + Scale|mixed scale; // json: "scale" | |
| 3540 | + SortUnion sort; // json: "sort" | |
| 3541 | + StackOffset|mixed stack; // json: "stack" | |
| 3542 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3543 | + Type type; // json: "type" | |
| 3544 | + ConditionalValueDefValue value; // json: "value" | |
| 3576 | 3545 | |
| 3577 | 3546 | string encode_json() { |
| 3578 | 3547 | mapping(string:mixed) json = ([ |
| @@ -3706,12 +3675,12 @@ AxisValue AxisValue_from_JSON(mixed json) { | ||
| 3706 | 3675 | // |
| 3707 | 3676 | // Definition object for a constant value of an encoding channel. |
| 3708 | 3677 | class X2Class { |
| 3709 | - AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3710 | - Bin bin; // json: "bin" | |
| 3711 | - Field field; // json: "field" | |
| 3712 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3713 | - Type|mixed type; // json: "type" | |
| 3714 | - ConditionalPredicateValueDefValue value; // json: "value" | |
| 3678 | + AggregateOp|mixed aggregate; // json: "aggregate" | |
| 3679 | + ColorBin bin; // json: "bin" | |
| 3680 | + Field field; // json: "field" | |
| 3681 | + TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 3682 | + Type type; // json: "type" | |
| 3683 | + ConditionalValueDefValue value; // json: "value" | |
| 3715 | 3684 | |
| 3716 | 3685 | string encode_json() { |
| 3717 | 3686 | mapping(string:mixed) json = ([ |
| @@ -3770,21 +3739,21 @@ class Spec { | ||
| 3770 | 3739 | Data|mixed data; // json: "data" |
| 3771 | 3740 | mixed|string description; // json: "description" |
| 3772 | 3741 | float|mixed height; // json: "height" |
| 3773 | - array(LayerSpec)|mixed layer; // json: "layer" | |
| 3742 | + array(LayerSpec) layer; // json: "layer" | |
| 3774 | 3743 | mixed|string name; // json: "name" |
| 3775 | 3744 | Resolve|mixed resolve; // json: "resolve" |
| 3776 | 3745 | Title title; // json: "title" |
| 3777 | 3746 | array(Transform)|mixed transform; // json: "transform" |
| 3778 | 3747 | float|mixed width; // json: "width" |
| 3779 | - Encoding|mixed encoding; // json: "encoding" | |
| 3748 | + Encoding encoding; // json: "encoding" | |
| 3780 | 3749 | AnyMark mark; // json: "mark" |
| 3781 | 3750 | Projection|mixed projection; // json: "projection" |
| 3782 | 3751 | mapping(string:SelectionDef)|mixed selection; // json: "selection" |
| 3783 | - FacetMapping|mixed facet; // json: "facet" | |
| 3784 | - Spec|mixed spec; // json: "spec" | |
| 3785 | - Repeat|mixed repeat; // json: "repeat" | |
| 3786 | - array(Spec)|mixed vconcat; // json: "vconcat" | |
| 3787 | - array(Spec)|mixed hconcat; // json: "hconcat" | |
| 3752 | + FacetMapping facet; // json: "facet" | |
| 3753 | + Spec spec; // json: "spec" | |
| 3754 | + Repeat repeat; // json: "repeat" | |
| 3755 | + array(Spec) vconcat; // json: "vconcat" | |
| 3756 | + array(Spec) hconcat; // json: "hconcat" | |
| 3788 | 3757 | |
| 3789 | 3758 | string encode_json() { |
| 3790 | 3759 | mapping(string:mixed) json = ([ |
| @@ -3899,13 +3868,13 @@ class LayerSpec { | ||
| 3899 | 3868 | Data|mixed data; // json: "data" |
| 3900 | 3869 | mixed|string description; // json: "description" |
| 3901 | 3870 | float|mixed height; // json: "height" |
| 3902 | - array(LayerSpec)|mixed layer; // json: "layer" | |
| 3871 | + array(LayerSpec) layer; // json: "layer" | |
| 3903 | 3872 | mixed|string name; // json: "name" |
| 3904 | 3873 | Resolve|mixed resolve; // json: "resolve" |
| 3905 | 3874 | Title title; // json: "title" |
| 3906 | 3875 | array(Transform)|mixed transform; // json: "transform" |
| 3907 | 3876 | float|mixed width; // json: "width" |
| 3908 | - Encoding|mixed encoding; // json: "encoding" | |
| 3877 | + Encoding encoding; // json: "encoding" | |
| 3909 | 3878 | AnyMark mark; // json: "mark" |
| 3910 | 3879 | Projection|mixed projection; // json: "projection" |
| 3911 | 3880 | mapping(string:SelectionDef)|mixed selection; // json: "selection" |
| @@ -4412,17 +4381,17 @@ TitleParams TitleParams_from_JSON(mixed json) { | ||
| 4412 | 4381 | } |
| 4413 | 4382 | |
| 4414 | 4383 | class Transform { |
| 4415 | - ConditionalValueDefLogicalOperandPredicate filter; // json: "filter" | |
| 4416 | - Style as; // json: "as" | |
| 4417 | - mixed|string calculate; // json: "calculate" | |
| 4418 | - mixed|string transform_default; // json: "default" | |
| 4419 | - LookupData|mixed from; // json: "from" | |
| 4420 | - mixed|string lookup; // json: "lookup" | |
| 4421 | - Bin bin; // json: "bin" | |
| 4422 | - mixed|string field; // json: "field" | |
| 4423 | - TimeUnit|mixed time_unit; // json: "timeUnit" | |
| 4424 | - array(AggregatedFieldDef)|mixed aggregate; // json: "aggregate" | |
| 4425 | - array(string)|mixed groupby; // json: "groupby" | |
| 4384 | + LogicalOperandPredicate filter; // json: "filter" | |
| 4385 | + Style as; // json: "as" | |
| 4386 | + string calculate; // json: "calculate" | |
| 4387 | + mixed|string transform_default; // json: "default" | |
| 4388 | + LookupData from; // json: "from" | |
| 4389 | + string lookup; // json: "lookup" | |
| 4390 | + TransformBin bin; // json: "bin" | |
| 4391 | + string field; // json: "field" | |
| 4392 | + TimeUnit time_unit; // json: "timeUnit" | |
| 4393 | + array(AggregatedFieldDef) aggregate; // json: "aggregate" | |
| 4394 | + array(string)|mixed groupby; // json: "groupby" | |
| 4426 | 4395 | |
| 4427 | 4396 | string encode_json() { |
| 4428 | 4397 | mapping(string:mixed) json = ([ |
| @@ -4487,6 +4456,12 @@ AggregatedFieldDef AggregatedFieldDef_from_JSON(mixed json) { | ||
| 4487 | 4456 | return retval; |
| 4488 | 4457 | } |
| 4489 | 4458 | |
| 4459 | +typedef BinParams|bool TransformBin; | |
| 4460 | + | |
| 4461 | +TransformBin TransformBin_from_JSON(mixed json) { | |
| 4462 | + return json; | |
| 4463 | +} | |
| 4464 | + | |
| 4490 | 4465 | // Secondary data reference. |
| 4491 | 4466 | class LookupData { |
| 4492 | 4467 | Data data; // json: "data" |
Mschema-pythondefault / quicktype.py+346 −407
| @@ -1866,28 +1866,27 @@ class ProjectionConfig: | ||
| 1866 | 1866 | |
| 1867 | 1867 | @dataclass |
| 1868 | 1868 | class VGScheme: |
| 1869 | + scheme: str | |
| 1869 | 1870 | count: float | None = None |
| 1870 | 1871 | extent: list[float] | None = None |
| 1871 | - scheme: str | None = None | |
| 1872 | 1872 | step: float | None = None |
| 1873 | 1873 | |
| 1874 | 1874 | @staticmethod |
| 1875 | 1875 | def from_dict(obj: Any) -> 'VGScheme': |
| 1876 | 1876 | assert isinstance(obj, dict) |
| 1877 | + scheme = from_str(obj.get("scheme")) | |
| 1877 | 1878 | count = from_union([from_float, from_none], obj.get("count")) |
| 1878 | 1879 | extent = from_union([lambda x: from_list(from_float, x), from_none], obj.get("extent")) |
| 1879 | - scheme = from_union([from_str, from_none], obj.get("scheme")) | |
| 1880 | 1880 | step = from_union([from_float, from_none], obj.get("step")) |
| 1881 | - return VGScheme(count, extent, scheme, step) | |
| 1881 | + return VGScheme(scheme, count, extent, step) | |
| 1882 | 1882 | |
| 1883 | 1883 | def to_dict(self) -> dict: |
| 1884 | 1884 | result: dict = {} |
| 1885 | + result["scheme"] = from_str(self.scheme) | |
| 1885 | 1886 | if self.count is not None: |
| 1886 | 1887 | result["count"] = from_union([to_float, from_none], self.count) |
| 1887 | 1888 | if self.extent is not None: |
| 1888 | 1889 | result["extent"] = from_union([lambda x: from_list(to_float, x), from_none], self.extent) |
| 1889 | - if self.scheme is not None: | |
| 1890 | - result["scheme"] = from_union([from_str, from_none], self.scheme) | |
| 1891 | 1890 | if self.step is not None: |
| 1892 | 1891 | result["step"] = from_union([to_float, from_none], self.step) |
| 1893 | 1892 | return result |
| @@ -2360,8 +2359,8 @@ class MultiSelectionConfig: | ||
| 2360 | 2359 | @dataclass |
| 2361 | 2360 | class VGBinding: |
| 2362 | 2361 | input: str |
| 2362 | + options: list[str] | |
| 2363 | 2363 | element: str | None = None |
| 2364 | - options: list[str] | None = None | |
| 2365 | 2364 | max: float | None = None |
| 2366 | 2365 | min: float | None = None |
| 2367 | 2366 | step: float | None = None |
| @@ -2370,20 +2369,19 @@ class VGBinding: | ||
| 2370 | 2369 | def from_dict(obj: Any) -> 'VGBinding': |
| 2371 | 2370 | assert isinstance(obj, dict) |
| 2372 | 2371 | input = from_str(obj.get("input")) |
| 2372 | + options = from_list(from_str, obj.get("options")) | |
| 2373 | 2373 | element = from_union([from_str, from_none], obj.get("element")) |
| 2374 | - options = from_union([lambda x: from_list(from_str, x), from_none], obj.get("options")) | |
| 2375 | 2374 | max = from_union([from_float, from_none], obj.get("max")) |
| 2376 | 2375 | min = from_union([from_float, from_none], obj.get("min")) |
| 2377 | 2376 | step = from_union([from_float, from_none], obj.get("step")) |
| 2378 | - return VGBinding(input, element, options, max, min, step) | |
| 2377 | + return VGBinding(input, options, element, max, min, step) | |
| 2379 | 2378 | |
| 2380 | 2379 | def to_dict(self) -> dict: |
| 2381 | 2380 | result: dict = {} |
| 2382 | 2381 | result["input"] = from_str(self.input) |
| 2382 | + result["options"] = from_list(from_str, self.options) | |
| 2383 | 2383 | if self.element is not None: |
| 2384 | 2384 | result["element"] = from_union([from_str, from_none], self.element) |
| 2385 | - if self.options is not None: | |
| 2386 | - result["options"] = from_union([lambda x: from_list(from_str, x), from_none], self.options) | |
| 2387 | 2385 | if self.max is not None: |
| 2388 | 2386 | result["max"] = from_union([to_float, from_none], self.max) |
| 2389 | 2387 | if self.min is not None: |
| @@ -3900,45 +3898,43 @@ class Data: | ||
| 3900 | 3898 | |
| 3901 | 3899 | Secondary data source to lookup in. |
| 3902 | 3900 | """ |
| 3903 | - format: DataFormat | None = None | |
| 3904 | - """An object that specifies the format for parsing the data file. | |
| 3905 | - | |
| 3906 | - An object that specifies the format for parsing the data values. | |
| 3907 | - | |
| 3908 | - An object that specifies the format for parsing the data. | |
| 3909 | - """ | |
| 3910 | - url: str | None = None | |
| 3901 | + url: str | |
| 3911 | 3902 | """An URL from which to load the data set. Use the `format.type` property |
| 3912 | 3903 | to ensure the loaded data is correctly parsed. |
| 3913 | 3904 | """ |
| 3914 | - values: list[float | bool | dict[str, Any] | str] | dict[str, Any] | str | None = None | |
| 3905 | + values: list[float | bool | dict[str, Any] | str] | dict[str, Any] | str | |
| 3915 | 3906 | """The full data set, included inline. This can be an array of objects or primitive values |
| 3916 | 3907 | or a string. |
| 3917 | 3908 | Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3918 | 3909 | parsed according to the specified format type. |
| 3919 | 3910 | """ |
| 3920 | - name: str | None = None | |
| 3911 | + name: str | |
| 3921 | 3912 | """Provide a placeholder name and bind data at runtime.""" |
| 3922 | 3913 | |
| 3914 | + format: DataFormat | None = None | |
| 3915 | + """An object that specifies the format for parsing the data file. | |
| 3916 | + | |
| 3917 | + An object that specifies the format for parsing the data values. | |
| 3918 | + | |
| 3919 | + An object that specifies the format for parsing the data. | |
| 3920 | + """ | |
| 3921 | + | |
| 3923 | 3922 | @staticmethod |
| 3924 | 3923 | def from_dict(obj: Any) -> 'Data': |
| 3925 | 3924 | assert isinstance(obj, dict) |
| 3925 | + url = from_str(obj.get("url")) | |
| 3926 | + values = from_union([lambda x: from_list(lambda x: from_union([from_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str], obj.get("values")) | |
| 3927 | + name = from_str(obj.get("name")) | |
| 3926 | 3928 | format = from_union([DataFormat.from_dict, from_none], obj.get("format")) |
| 3927 | - url = from_union([from_str, from_none], obj.get("url")) | |
| 3928 | - values = from_union([lambda x: from_list(lambda x: from_union([from_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str, from_none], obj.get("values")) | |
| 3929 | - name = from_union([from_str, from_none], obj.get("name")) | |
| 3930 | - return Data(format, url, values, name) | |
| 3929 | + return Data(url, values, name, format) | |
| 3931 | 3930 | |
| 3932 | 3931 | def to_dict(self) -> dict: |
| 3933 | 3932 | result: dict = {} |
| 3933 | + result["url"] = from_str(self.url) | |
| 3934 | + result["values"] = from_union([lambda x: from_list(lambda x: from_union([to_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str], self.values) | |
| 3935 | + result["name"] = from_str(self.name) | |
| 3934 | 3936 | if self.format is not None: |
| 3935 | 3937 | result["format"] = from_union([lambda x: to_class(DataFormat, x), from_none], self.format) |
| 3936 | - if self.url is not None: | |
| 3937 | - result["url"] = from_union([from_str, from_none], self.url) | |
| 3938 | - if self.values is not None: | |
| 3939 | - result["values"] = from_union([lambda x: from_list(lambda x: from_union([to_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str, from_none], self.values) | |
| 3940 | - if self.name is not None: | |
| 3941 | - result["name"] = from_union([from_str, from_none], self.name) | |
| 3942 | 3938 | return result |
| 3943 | 3939 | |
| 3944 | 3940 | |
| @@ -4062,26 +4058,23 @@ class BinParams: | ||
| 4062 | 4058 | |
| 4063 | 4059 | @dataclass |
| 4064 | 4060 | class Selection: |
| 4065 | - selection_not: 'Selection | str | None' = None | |
| 4066 | - selection_and: 'list[Selection | str] | None' = None | |
| 4067 | - selection_or: 'list[Selection | str] | None' = None | |
| 4061 | + selection_not: 'Selection | str' | |
| 4062 | + selection_and: list['Selection | str'] | |
| 4063 | + selection_or: list['Selection | str'] | |
| 4068 | 4064 | |
| 4069 | 4065 | @staticmethod |
| 4070 | 4066 | def from_dict(obj: Any) -> 'Selection': |
| 4071 | 4067 | assert isinstance(obj, dict) |
| 4072 | - selection_not = from_union([Selection.from_dict, from_str, from_none], obj.get("not")) | |
| 4073 | - selection_and = from_union([lambda x: from_list(lambda x: from_union([Selection.from_dict, from_str], x), x), from_none], obj.get("and")) | |
| 4074 | - selection_or = from_union([lambda x: from_list(lambda x: from_union([Selection.from_dict, from_str], x), x), from_none], obj.get("or")) | |
| 4068 | + selection_not = from_union([Selection.from_dict, from_str], obj.get("not")) | |
| 4069 | + selection_and = from_list(lambda x: from_union([Selection.from_dict, from_str], x), obj.get("and")) | |
| 4070 | + selection_or = from_list(lambda x: from_union([Selection.from_dict, from_str], x), obj.get("or")) | |
| 4075 | 4071 | return Selection(selection_not, selection_and, selection_or) |
| 4076 | 4072 | |
| 4077 | 4073 | def to_dict(self) -> dict: |
| 4078 | 4074 | result: dict = {} |
| 4079 | - if self.selection_not is not None: | |
| 4080 | - result["not"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection_not) | |
| 4081 | - if self.selection_and is not None: | |
| 4082 | - result["and"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), x), from_none], self.selection_and) | |
| 4083 | - if self.selection_or is not None: | |
| 4084 | - result["or"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), x), from_none], self.selection_or) | |
| 4075 | + result["not"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection_not) | |
| 4076 | + result["and"] = from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), self.selection_and) | |
| 4077 | + result["or"] = from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), self.selection_or) | |
| 4085 | 4078 | return result |
| 4086 | 4079 | |
| 4087 | 4080 | |
| @@ -4229,78 +4222,71 @@ class TimeUnit(Enum): | ||
| 4229 | 4222 | |
| 4230 | 4223 | @dataclass |
| 4231 | 4224 | class Predicate: |
| 4232 | - predicate_not: 'Predicate | str | None' = None | |
| 4233 | - predicate_and: 'list[Predicate | str] | None' = None | |
| 4234 | - predicate_or: 'list[Predicate | str] | None' = None | |
| 4235 | - equal: float | bool | DateTime | str | None = None | |
| 4225 | + predicate_not: 'Predicate | str' | |
| 4226 | + predicate_and: list['Predicate | str'] | |
| 4227 | + predicate_or: list['Predicate | str'] | |
| 4228 | + equal: float | bool | DateTime | str | |
| 4236 | 4229 | """The value that the field should be equal to.""" |
| 4237 | 4230 | |
| 4238 | - field: str | None = None | |
| 4231 | + field: str | |
| 4239 | 4232 | """Field to be filtered. |
| 4240 | 4233 | |
| 4241 | 4234 | Field to be filtered |
| 4242 | 4235 | """ |
| 4243 | - time_unit: TimeUnit | None = None | |
| 4244 | - """Time unit for the field to be filtered. | |
| 4245 | - | |
| 4246 | - time unit for the field to be filtered. | |
| 4247 | - """ | |
| 4248 | - range: list[float | DateTime | None] | None = None | |
| 4236 | + range: list[float | DateTime | None] | |
| 4249 | 4237 | """An array of inclusive minimum and maximum values |
| 4250 | 4238 | for a field value of a data item to be included in the filtered data. |
| 4251 | 4239 | """ |
| 4252 | - one_of: list[float | bool | DateTime | str] | None = None | |
| 4240 | + one_of: list[float | bool | DateTime | str] | |
| 4253 | 4241 | """A set of values that the `field`'s value should be a member of, |
| 4254 | 4242 | for a data item included in the filtered data. |
| 4255 | 4243 | """ |
| 4256 | - selection: Selection | str | None = None | |
| 4244 | + selection: Selection | str | |
| 4257 | 4245 | """Filter using a selection name.""" |
| 4258 | 4246 | |
| 4247 | + time_unit: TimeUnit | None = None | |
| 4248 | + """Time unit for the field to be filtered. | |
| 4249 | + | |
| 4250 | + time unit for the field to be filtered. | |
| 4251 | + """ | |
| 4252 | + | |
| 4259 | 4253 | @staticmethod |
| 4260 | 4254 | def from_dict(obj: Any) -> 'Predicate': |
| 4261 | 4255 | assert isinstance(obj, dict) |
| 4262 | - predicate_not = from_union([Predicate.from_dict, from_str, from_none], obj.get("not")) | |
| 4263 | - predicate_and = from_union([lambda x: from_list(lambda x: from_union([Predicate.from_dict, from_str], x), x), from_none], obj.get("and")) | |
| 4264 | - predicate_or = from_union([lambda x: from_list(lambda x: from_union([Predicate.from_dict, from_str], x), x), from_none], obj.get("or")) | |
| 4265 | - equal = from_union([from_float, from_bool, DateTime.from_dict, from_str, from_none], obj.get("equal")) | |
| 4266 | - field = from_union([from_str, from_none], obj.get("field")) | |
| 4256 | + predicate_not = from_union([Predicate.from_dict, from_str], obj.get("not")) | |
| 4257 | + predicate_and = from_list(lambda x: from_union([Predicate.from_dict, from_str], x), obj.get("and")) | |
| 4258 | + predicate_or = from_list(lambda x: from_union([Predicate.from_dict, from_str], x), obj.get("or")) | |
| 4259 | + equal = from_union([from_float, from_bool, DateTime.from_dict, from_str], obj.get("equal")) | |
| 4260 | + field = from_str(obj.get("field")) | |
| 4261 | + range = from_list(lambda x: from_union([from_float, DateTime.from_dict, from_none], x), obj.get("range")) | |
| 4262 | + one_of = from_list(lambda x: from_union([from_float, from_bool, DateTime.from_dict, from_str], x), obj.get("oneOf")) | |
| 4263 | + selection = from_union([Selection.from_dict, from_str], obj.get("selection")) | |
| 4267 | 4264 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 4268 | - range = from_union([lambda x: from_list(lambda x: from_union([from_float, DateTime.from_dict, from_none], x), x), from_none], obj.get("range")) | |
| 4269 | - one_of = from_union([lambda x: from_list(lambda x: from_union([from_float, from_bool, DateTime.from_dict, from_str], x), x), from_none], obj.get("oneOf")) | |
| 4270 | - selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection")) | |
| 4271 | - return Predicate(predicate_not, predicate_and, predicate_or, equal, field, time_unit, range, one_of, selection) | |
| 4265 | + return Predicate(predicate_not, predicate_and, predicate_or, equal, field, range, one_of, selection, time_unit) | |
| 4272 | 4266 | |
| 4273 | 4267 | def to_dict(self) -> dict: |
| 4274 | 4268 | result: dict = {} |
| 4275 | - if self.predicate_not is not None: | |
| 4276 | - result["not"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.predicate_not) | |
| 4277 | - if self.predicate_and is not None: | |
| 4278 | - result["and"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), x), from_none], self.predicate_and) | |
| 4279 | - if self.predicate_or is not None: | |
| 4280 | - result["or"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), x), from_none], self.predicate_or) | |
| 4281 | - if self.equal is not None: | |
| 4282 | - result["equal"] = from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str, from_none], self.equal) | |
| 4283 | - if self.field is not None: | |
| 4284 | - result["field"] = from_union([from_str, from_none], self.field) | |
| 4269 | + result["not"] = from_union([lambda x: to_class(Predicate, x), from_str], self.predicate_not) | |
| 4270 | + result["and"] = from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), self.predicate_and) | |
| 4271 | + result["or"] = from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), self.predicate_or) | |
| 4272 | + result["equal"] = from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str], self.equal) | |
| 4273 | + result["field"] = from_str(self.field) | |
| 4274 | + result["range"] = from_list(lambda x: from_union([to_float, lambda x: to_class(DateTime, x), from_none], x), self.range) | |
| 4275 | + result["oneOf"] = from_list(lambda x: from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str], x), self.one_of) | |
| 4276 | + result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection) | |
| 4285 | 4277 | if self.time_unit is not None: |
| 4286 | 4278 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 4287 | - if self.range is not None: | |
| 4288 | - result["range"] = from_union([lambda x: from_list(lambda x: from_union([to_float, lambda x: to_class(DateTime, x), from_none], x), x), from_none], self.range) | |
| 4289 | - if self.one_of is not None: | |
| 4290 | - result["oneOf"] = from_union([lambda x: from_list(lambda x: from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str], x), x), from_none], self.one_of) | |
| 4291 | - if self.selection is not None: | |
| 4292 | - result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection) | |
| 4293 | 4279 | return result |
| 4294 | 4280 | |
| 4295 | 4281 | |
| 4296 | 4282 | @dataclass |
| 4297 | 4283 | class ConditionalValueDef: |
| 4284 | + test: Predicate | str | |
| 4298 | 4285 | value: float | bool | str |
| 4299 | 4286 | """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4300 | 4287 | `0` to `1` for opacity). |
| 4301 | 4288 | """ |
| 4302 | - test: Predicate | str | None = None | |
| 4303 | - selection: Selection | str | None = None | |
| 4289 | + selection: Selection | str | |
| 4304 | 4290 | """A [selection name](selection.html), or a series of [composed |
| 4305 | 4291 | selections](selection.html#compose). |
| 4306 | 4292 | """ |
| @@ -4308,18 +4294,16 @@ class ConditionalValueDef: | ||
| 4308 | 4294 | @staticmethod |
| 4309 | 4295 | def from_dict(obj: Any) -> 'ConditionalValueDef': |
| 4310 | 4296 | assert isinstance(obj, dict) |
| 4297 | + test = from_union([Predicate.from_dict, from_str], obj.get("test")) | |
| 4311 | 4298 | value = from_union([from_float, from_bool, from_str], obj.get("value")) |
| 4312 | - test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test")) | |
| 4313 | - selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection")) | |
| 4314 | - return ConditionalValueDef(value, test, selection) | |
| 4299 | + selection = from_union([Selection.from_dict, from_str], obj.get("selection")) | |
| 4300 | + return ConditionalValueDef(test, value, selection) | |
| 4315 | 4301 | |
| 4316 | 4302 | def to_dict(self) -> dict: |
| 4317 | 4303 | result: dict = {} |
| 4304 | + result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test) | |
| 4318 | 4305 | result["value"] = from_union([to_float, from_bool, from_str], self.value) |
| 4319 | - if self.test is not None: | |
| 4320 | - result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test) | |
| 4321 | - if self.selection is not None: | |
| 4322 | - result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection) | |
| 4306 | + result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection) | |
| 4323 | 4307 | return result |
| 4324 | 4308 | |
| 4325 | 4309 | |
| @@ -4929,15 +4913,21 @@ class ConditionalPredicateValueDefType(Enum): | ||
| 4929 | 4913 | |
| 4930 | 4914 | @dataclass |
| 4931 | 4915 | class ConditionalPredicateMarkPropFieldDefClass: |
| 4932 | - test: Predicate | str | None = None | |
| 4933 | - value: float | bool | str | None = None | |
| 4916 | + test: Predicate | str | |
| 4917 | + value: float | bool | str | |
| 4934 | 4918 | """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4935 | 4919 | `0` to `1` for opacity). |
| 4936 | 4920 | """ |
| 4937 | - selection: Selection | str | None = None | |
| 4921 | + selection: Selection | str | |
| 4938 | 4922 | """A [selection name](selection.html), or a series of [composed |
| 4939 | 4923 | selections](selection.html#compose). |
| 4940 | 4924 | """ |
| 4925 | + type: ConditionalPredicateValueDefType | |
| 4926 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 4927 | + `"nominal"`). | |
| 4928 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 4929 | + [geographic projection](projection.html) is applied. | |
| 4930 | + """ | |
| 4941 | 4931 | aggregate: AggregateOp | None = None |
| 4942 | 4932 | """Aggregation function for the field |
| 4943 | 4933 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -4990,19 +4980,14 @@ class ConditionalPredicateMarkPropFieldDefClass: | ||
| 4990 | 4980 | |
| 4991 | 4981 | __Default value:__ `undefined` (None) |
| 4992 | 4982 | """ |
| 4993 | - type: ConditionalPredicateValueDefType | None = None | |
| 4994 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 4995 | - `"nominal"`). | |
| 4996 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 4997 | - [geographic projection](projection.html) is applied. | |
| 4998 | - """ | |
| 4999 | 4983 | |
| 5000 | 4984 | @staticmethod |
| 5001 | 4985 | def from_dict(obj: Any) -> 'ConditionalPredicateMarkPropFieldDefClass': |
| 5002 | 4986 | assert isinstance(obj, dict) |
| 5003 | - test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test")) | |
| 5004 | - value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) | |
| 5005 | - selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection")) | |
| 4987 | + test = from_union([Predicate.from_dict, from_str], obj.get("test")) | |
| 4988 | + value = from_union([from_float, from_bool, from_str], obj.get("value")) | |
| 4989 | + selection = from_union([Selection.from_dict, from_str], obj.get("selection")) | |
| 4990 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 5006 | 4991 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 5007 | 4992 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 5008 | 4993 | field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field")) |
| @@ -5010,17 +4995,14 @@ class ConditionalPredicateMarkPropFieldDefClass: | ||
| 5010 | 4995 | scale = from_union([Scale.from_dict, from_none], obj.get("scale")) |
| 5011 | 4996 | sort = from_union([from_none, SortField.from_dict, SortEnum], obj.get("sort")) |
| 5012 | 4997 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 5013 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 5014 | - return ConditionalPredicateMarkPropFieldDefClass(test, value, selection, aggregate, bin, field, legend, scale, sort, time_unit, type) | |
| 4998 | + return ConditionalPredicateMarkPropFieldDefClass(test, value, selection, type, aggregate, bin, field, legend, scale, sort, time_unit) | |
| 5015 | 4999 | |
| 5016 | 5000 | def to_dict(self) -> dict: |
| 5017 | 5001 | result: dict = {} |
| 5018 | - if self.test is not None: | |
| 5019 | - result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test) | |
| 5020 | - if self.value is not None: | |
| 5021 | - result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) | |
| 5022 | - if self.selection is not None: | |
| 5023 | - result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection) | |
| 5002 | + result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test) | |
| 5003 | + result["value"] = from_union([to_float, from_bool, from_str], self.value) | |
| 5004 | + result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection) | |
| 5005 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 5024 | 5006 | if self.aggregate is not None: |
| 5025 | 5007 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 5026 | 5008 | if self.bin is not None: |
| @@ -5035,8 +5017,6 @@ class ConditionalPredicateMarkPropFieldDefClass: | ||
| 5035 | 5017 | result["sort"] = from_union([from_none, lambda x: to_class(SortField, x), lambda x: to_enum(SortEnum, x)], self.sort) |
| 5036 | 5018 | if self.time_unit is not None: |
| 5037 | 5019 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 5038 | - if self.type is not None: | |
| 5039 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 5040 | 5020 | return result |
| 5041 | 5021 | |
| 5042 | 5022 | |
| @@ -5084,6 +5064,12 @@ class MarkPropDefWithCondition: | ||
| 5084 | 5064 | value: ..., |
| 5085 | 5065 | } |
| 5086 | 5066 | """ |
| 5067 | + type: ConditionalPredicateValueDefType | |
| 5068 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5069 | + `"nominal"`). | |
| 5070 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5071 | + [geographic projection](projection.html) is applied. | |
| 5072 | + """ | |
| 5087 | 5073 | aggregate: AggregateOp | None = None |
| 5088 | 5074 | """Aggregation function for the field |
| 5089 | 5075 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -5145,18 +5131,13 @@ class MarkPropDefWithCondition: | ||
| 5145 | 5131 | |
| 5146 | 5132 | __Default value:__ `undefined` (None) |
| 5147 | 5133 | """ |
| 5148 | - type: ConditionalPredicateValueDefType | None = None | |
| 5149 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5150 | - `"nominal"`). | |
| 5151 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5152 | - [geographic projection](projection.html) is applied. | |
| 5153 | - """ | |
| 5154 | 5134 | value: float | bool | str | None = None |
| 5155 | 5135 | """A constant value in visual domain.""" |
| 5156 | 5136 | |
| 5157 | 5137 | @staticmethod |
| 5158 | 5138 | def from_dict(obj: Any) -> 'MarkPropDefWithCondition': |
| 5159 | 5139 | assert isinstance(obj, dict) |
| 5140 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 5160 | 5141 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 5161 | 5142 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 5162 | 5143 | condition = from_union([ConditionalPredicateMarkPropFieldDefClass.from_dict, lambda x: from_list(ConditionalValueDef.from_dict, x), from_none], obj.get("condition")) |
| @@ -5165,12 +5146,12 @@ class MarkPropDefWithCondition: | ||
| 5165 | 5146 | scale = from_union([Scale.from_dict, from_none], obj.get("scale")) |
| 5166 | 5147 | sort = from_union([from_none, SortField.from_dict, SortEnum], obj.get("sort")) |
| 5167 | 5148 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 5168 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 5169 | 5149 | value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) |
| 5170 | - return MarkPropDefWithCondition(aggregate, bin, condition, field, legend, scale, sort, time_unit, type, value) | |
| 5150 | + return MarkPropDefWithCondition(type, aggregate, bin, condition, field, legend, scale, sort, time_unit, value) | |
| 5171 | 5151 | |
| 5172 | 5152 | def to_dict(self) -> dict: |
| 5173 | 5153 | result: dict = {} |
| 5154 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 5174 | 5155 | if self.aggregate is not None: |
| 5175 | 5156 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 5176 | 5157 | if self.bin is not None: |
| @@ -5187,8 +5168,6 @@ class MarkPropDefWithCondition: | ||
| 5187 | 5168 | result["sort"] = from_union([from_none, lambda x: to_class(SortField, x), lambda x: to_enum(SortEnum, x)], self.sort) |
| 5188 | 5169 | if self.time_unit is not None: |
| 5189 | 5170 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 5190 | - if self.type is not None: | |
| 5191 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 5192 | 5171 | if self.value is not None: |
| 5193 | 5172 | result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) |
| 5194 | 5173 | return result |
| @@ -5399,15 +5378,21 @@ class FieldDef: | ||
| 5399 | 5378 | |
| 5400 | 5379 | @dataclass |
| 5401 | 5380 | class ConditionalPredicateFieldDefClass: |
| 5402 | - test: Predicate | str | None = None | |
| 5403 | - value: float | bool | str | None = None | |
| 5381 | + test: Predicate | str | |
| 5382 | + value: float | bool | str | |
| 5404 | 5383 | """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5405 | 5384 | `0` to `1` for opacity). |
| 5406 | 5385 | """ |
| 5407 | - selection: Selection | str | None = None | |
| 5386 | + selection: Selection | str | |
| 5408 | 5387 | """A [selection name](selection.html), or a series of [composed |
| 5409 | 5388 | selections](selection.html#compose). |
| 5410 | 5389 | """ |
| 5390 | + type: ConditionalPredicateValueDefType | |
| 5391 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5392 | + `"nominal"`). | |
| 5393 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5394 | + [geographic projection](projection.html) is applied. | |
| 5395 | + """ | |
| 5411 | 5396 | aggregate: AggregateOp | None = None |
| 5412 | 5397 | """Aggregation function for the field |
| 5413 | 5398 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -5439,34 +5424,26 @@ class ConditionalPredicateFieldDefClass: | ||
| 5439 | 5424 | |
| 5440 | 5425 | __Default value:__ `undefined` (None) |
| 5441 | 5426 | """ |
| 5442 | - type: ConditionalPredicateValueDefType | None = None | |
| 5443 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5444 | - `"nominal"`). | |
| 5445 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5446 | - [geographic projection](projection.html) is applied. | |
| 5447 | - """ | |
| 5448 | 5427 | |
| 5449 | 5428 | @staticmethod |
| 5450 | 5429 | def from_dict(obj: Any) -> 'ConditionalPredicateFieldDefClass': |
| 5451 | 5430 | assert isinstance(obj, dict) |
| 5452 | - test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test")) | |
| 5453 | - value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) | |
| 5454 | - selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection")) | |
| 5431 | + test = from_union([Predicate.from_dict, from_str], obj.get("test")) | |
| 5432 | + value = from_union([from_float, from_bool, from_str], obj.get("value")) | |
| 5433 | + selection = from_union([Selection.from_dict, from_str], obj.get("selection")) | |
| 5434 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 5455 | 5435 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 5456 | 5436 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 5457 | 5437 | field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field")) |
| 5458 | 5438 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 5459 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 5460 | - return ConditionalPredicateFieldDefClass(test, value, selection, aggregate, bin, field, time_unit, type) | |
| 5439 | + return ConditionalPredicateFieldDefClass(test, value, selection, type, aggregate, bin, field, time_unit) | |
| 5461 | 5440 | |
| 5462 | 5441 | def to_dict(self) -> dict: |
| 5463 | 5442 | result: dict = {} |
| 5464 | - if self.test is not None: | |
| 5465 | - result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test) | |
| 5466 | - if self.value is not None: | |
| 5467 | - result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) | |
| 5468 | - if self.selection is not None: | |
| 5469 | - result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection) | |
| 5443 | + result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test) | |
| 5444 | + result["value"] = from_union([to_float, from_bool, from_str], self.value) | |
| 5445 | + result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection) | |
| 5446 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 5470 | 5447 | if self.aggregate is not None: |
| 5471 | 5448 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 5472 | 5449 | if self.bin is not None: |
| @@ -5475,8 +5452,6 @@ class ConditionalPredicateFieldDefClass: | ||
| 5475 | 5452 | result["field"] = from_union([lambda x: to_class(RepeatRef, x), from_str, from_none], self.field) |
| 5476 | 5453 | if self.time_unit is not None: |
| 5477 | 5454 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 5478 | - if self.type is not None: | |
| 5479 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 5480 | 5455 | return result |
| 5481 | 5456 | |
| 5482 | 5457 | |
| @@ -5497,6 +5472,12 @@ class DefWithCondition: | ||
| 5497 | 5472 | value: ..., |
| 5498 | 5473 | } |
| 5499 | 5474 | """ |
| 5475 | + type: ConditionalPredicateValueDefType | |
| 5476 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5477 | + `"nominal"`). | |
| 5478 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5479 | + [geographic projection](projection.html) is applied. | |
| 5480 | + """ | |
| 5500 | 5481 | aggregate: AggregateOp | None = None |
| 5501 | 5482 | """Aggregation function for the field |
| 5502 | 5483 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -5537,29 +5518,24 @@ class DefWithCondition: | ||
| 5537 | 5518 | |
| 5538 | 5519 | __Default value:__ `undefined` (None) |
| 5539 | 5520 | """ |
| 5540 | - type: ConditionalPredicateValueDefType | None = None | |
| 5541 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5542 | - `"nominal"`). | |
| 5543 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5544 | - [geographic projection](projection.html) is applied. | |
| 5545 | - """ | |
| 5546 | 5521 | value: float | bool | str | None = None |
| 5547 | 5522 | """A constant value in visual domain.""" |
| 5548 | 5523 | |
| 5549 | 5524 | @staticmethod |
| 5550 | 5525 | def from_dict(obj: Any) -> 'DefWithCondition': |
| 5551 | 5526 | assert isinstance(obj, dict) |
| 5527 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 5552 | 5528 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 5553 | 5529 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 5554 | 5530 | condition = from_union([ConditionalPredicateFieldDefClass.from_dict, lambda x: from_list(ConditionalValueDef.from_dict, x), from_none], obj.get("condition")) |
| 5555 | 5531 | field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field")) |
| 5556 | 5532 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 5557 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 5558 | 5533 | value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) |
| 5559 | - return DefWithCondition(aggregate, bin, condition, field, time_unit, type, value) | |
| 5534 | + return DefWithCondition(type, aggregate, bin, condition, field, time_unit, value) | |
| 5560 | 5535 | |
| 5561 | 5536 | def to_dict(self) -> dict: |
| 5562 | 5537 | result: dict = {} |
| 5538 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 5563 | 5539 | if self.aggregate is not None: |
| 5564 | 5540 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 5565 | 5541 | if self.bin is not None: |
| @@ -5570,8 +5546,6 @@ class DefWithCondition: | ||
| 5570 | 5546 | result["field"] = from_union([lambda x: to_class(RepeatRef, x), from_str, from_none], self.field) |
| 5571 | 5547 | if self.time_unit is not None: |
| 5572 | 5548 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 5573 | - if self.type is not None: | |
| 5574 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 5575 | 5549 | if self.value is not None: |
| 5576 | 5550 | result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) |
| 5577 | 5551 | return result |
| @@ -5649,15 +5623,21 @@ class OrderFieldDef: | ||
| 5649 | 5623 | |
| 5650 | 5624 | @dataclass |
| 5651 | 5625 | class ConditionalPredicateTextFieldDefClass: |
| 5652 | - test: Predicate | str | None = None | |
| 5653 | - value: float | bool | str | None = None | |
| 5626 | + test: Predicate | str | |
| 5627 | + value: float | bool | str | |
| 5654 | 5628 | """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5655 | 5629 | `0` to `1` for opacity). |
| 5656 | 5630 | """ |
| 5657 | - selection: Selection | str | None = None | |
| 5631 | + selection: Selection | str | |
| 5658 | 5632 | """A [selection name](selection.html), or a series of [composed |
| 5659 | 5633 | selections](selection.html#compose). |
| 5660 | 5634 | """ |
| 5635 | + type: ConditionalPredicateValueDefType | |
| 5636 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5637 | + `"nominal"`). | |
| 5638 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5639 | + [geographic projection](projection.html) is applied. | |
| 5640 | + """ | |
| 5661 | 5641 | aggregate: AggregateOp | None = None |
| 5662 | 5642 | """Aggregation function for the field |
| 5663 | 5643 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -5693,35 +5673,27 @@ class ConditionalPredicateTextFieldDefClass: | ||
| 5693 | 5673 | |
| 5694 | 5674 | __Default value:__ `undefined` (None) |
| 5695 | 5675 | """ |
| 5696 | - type: ConditionalPredicateValueDefType | None = None | |
| 5697 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5698 | - `"nominal"`). | |
| 5699 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5700 | - [geographic projection](projection.html) is applied. | |
| 5701 | - """ | |
| 5702 | 5676 | |
| 5703 | 5677 | @staticmethod |
| 5704 | 5678 | def from_dict(obj: Any) -> 'ConditionalPredicateTextFieldDefClass': |
| 5705 | 5679 | assert isinstance(obj, dict) |
| 5706 | - test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test")) | |
| 5707 | - value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) | |
| 5708 | - selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection")) | |
| 5680 | + test = from_union([Predicate.from_dict, from_str], obj.get("test")) | |
| 5681 | + value = from_union([from_float, from_bool, from_str], obj.get("value")) | |
| 5682 | + selection = from_union([Selection.from_dict, from_str], obj.get("selection")) | |
| 5683 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 5709 | 5684 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 5710 | 5685 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 5711 | 5686 | field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field")) |
| 5712 | 5687 | format = from_union([from_str, from_none], obj.get("format")) |
| 5713 | 5688 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 5714 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 5715 | - return ConditionalPredicateTextFieldDefClass(test, value, selection, aggregate, bin, field, format, time_unit, type) | |
| 5689 | + return ConditionalPredicateTextFieldDefClass(test, value, selection, type, aggregate, bin, field, format, time_unit) | |
| 5716 | 5690 | |
| 5717 | 5691 | def to_dict(self) -> dict: |
| 5718 | 5692 | result: dict = {} |
| 5719 | - if self.test is not None: | |
| 5720 | - result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test) | |
| 5721 | - if self.value is not None: | |
| 5722 | - result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) | |
| 5723 | - if self.selection is not None: | |
| 5724 | - result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection) | |
| 5693 | + result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test) | |
| 5694 | + result["value"] = from_union([to_float, from_bool, from_str], self.value) | |
| 5695 | + result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection) | |
| 5696 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 5725 | 5697 | if self.aggregate is not None: |
| 5726 | 5698 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 5727 | 5699 | if self.bin is not None: |
| @@ -5732,8 +5704,6 @@ class ConditionalPredicateTextFieldDefClass: | ||
| 5732 | 5704 | result["format"] = from_union([from_str, from_none], self.format) |
| 5733 | 5705 | if self.time_unit is not None: |
| 5734 | 5706 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 5735 | - if self.type is not None: | |
| 5736 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 5737 | 5707 | return result |
| 5738 | 5708 | |
| 5739 | 5709 | |
| @@ -5756,6 +5726,12 @@ class TextDefWithCondition: | ||
| 5756 | 5726 | value: ..., |
| 5757 | 5727 | } |
| 5758 | 5728 | """ |
| 5729 | + type: ConditionalPredicateValueDefType | |
| 5730 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5731 | + `"nominal"`). | |
| 5732 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5733 | + [geographic projection](projection.html) is applied. | |
| 5734 | + """ | |
| 5759 | 5735 | aggregate: AggregateOp | None = None |
| 5760 | 5736 | """Aggregation function for the field |
| 5761 | 5737 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -5800,30 +5776,25 @@ class TextDefWithCondition: | ||
| 5800 | 5776 | |
| 5801 | 5777 | __Default value:__ `undefined` (None) |
| 5802 | 5778 | """ |
| 5803 | - type: ConditionalPredicateValueDefType | None = None | |
| 5804 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 5805 | - `"nominal"`). | |
| 5806 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 5807 | - [geographic projection](projection.html) is applied. | |
| 5808 | - """ | |
| 5809 | 5779 | value: float | bool | str | None = None |
| 5810 | 5780 | """A constant value in visual domain.""" |
| 5811 | 5781 | |
| 5812 | 5782 | @staticmethod |
| 5813 | 5783 | def from_dict(obj: Any) -> 'TextDefWithCondition': |
| 5814 | 5784 | assert isinstance(obj, dict) |
| 5785 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 5815 | 5786 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 5816 | 5787 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 5817 | 5788 | condition = from_union([ConditionalPredicateTextFieldDefClass.from_dict, lambda x: from_list(ConditionalValueDef.from_dict, x), from_none], obj.get("condition")) |
| 5818 | 5789 | field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field")) |
| 5819 | 5790 | format = from_union([from_str, from_none], obj.get("format")) |
| 5820 | 5791 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 5821 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 5822 | 5792 | value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) |
| 5823 | - return TextDefWithCondition(aggregate, bin, condition, field, format, time_unit, type, value) | |
| 5793 | + return TextDefWithCondition(type, aggregate, bin, condition, field, format, time_unit, value) | |
| 5824 | 5794 | |
| 5825 | 5795 | def to_dict(self) -> dict: |
| 5826 | 5796 | result: dict = {} |
| 5797 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 5827 | 5798 | if self.aggregate is not None: |
| 5828 | 5799 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 5829 | 5800 | if self.bin is not None: |
| @@ -5836,8 +5807,6 @@ class TextDefWithCondition: | ||
| 5836 | 5807 | result["format"] = from_union([from_str, from_none], self.format) |
| 5837 | 5808 | if self.time_unit is not None: |
| 5838 | 5809 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 5839 | - if self.type is not None: | |
| 5840 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 5841 | 5810 | if self.value is not None: |
| 5842 | 5811 | result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) |
| 5843 | 5812 | return result |
| @@ -6072,6 +6041,16 @@ class XClass: | ||
| 6072 | 6041 | |
| 6073 | 6042 | Definition object for a constant value of an encoding channel. |
| 6074 | 6043 | """ |
| 6044 | + type: ConditionalPredicateValueDefType | |
| 6045 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 6046 | + `"nominal"`). | |
| 6047 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 6048 | + [geographic projection](projection.html) is applied. | |
| 6049 | + """ | |
| 6050 | + value: float | bool | str | |
| 6051 | + """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 6052 | + `0` to `1` for opacity). | |
| 6053 | + """ | |
| 6075 | 6054 | aggregate: AggregateOp | None = None |
| 6076 | 6055 | """Aggregation function for the field |
| 6077 | 6056 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -6146,20 +6125,12 @@ class XClass: | ||
| 6146 | 6125 | |
| 6147 | 6126 | __Default value:__ `undefined` (None) |
| 6148 | 6127 | """ |
| 6149 | - type: ConditionalPredicateValueDefType | None = None | |
| 6150 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 6151 | - `"nominal"`). | |
| 6152 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 6153 | - [geographic projection](projection.html) is applied. | |
| 6154 | - """ | |
| 6155 | - value: float | bool | str | None = None | |
| 6156 | - """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 6157 | - `0` to `1` for opacity). | |
| 6158 | - """ | |
| 6159 | 6128 | |
| 6160 | 6129 | @staticmethod |
| 6161 | 6130 | def from_dict(obj: Any) -> 'XClass': |
| 6162 | 6131 | assert isinstance(obj, dict) |
| 6132 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 6133 | + value = from_union([from_float, from_bool, from_str], obj.get("value")) | |
| 6163 | 6134 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 6164 | 6135 | axis = from_union([Axis.from_dict, from_none], obj.get("axis")) |
| 6165 | 6136 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| @@ -6168,12 +6139,12 @@ class XClass: | ||
| 6168 | 6139 | sort = from_union([from_none, SortField.from_dict, SortEnum], obj.get("sort")) |
| 6169 | 6140 | stack = from_union([StackOffset, from_none], obj.get("stack")) |
| 6170 | 6141 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 6171 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 6172 | - value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) | |
| 6173 | - return XClass(aggregate, axis, bin, field, scale, sort, stack, time_unit, type, value) | |
| 6142 | + return XClass(type, value, aggregate, axis, bin, field, scale, sort, stack, time_unit) | |
| 6174 | 6143 | |
| 6175 | 6144 | def to_dict(self) -> dict: |
| 6176 | 6145 | result: dict = {} |
| 6146 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 6147 | + result["value"] = from_union([to_float, from_bool, from_str], self.value) | |
| 6177 | 6148 | if self.aggregate is not None: |
| 6178 | 6149 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 6179 | 6150 | if self.axis is not None: |
| @@ -6190,10 +6161,6 @@ class XClass: | ||
| 6190 | 6161 | result["stack"] = from_union([lambda x: to_enum(StackOffset, x), from_none], self.stack) |
| 6191 | 6162 | if self.time_unit is not None: |
| 6192 | 6163 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 6193 | - if self.type is not None: | |
| 6194 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 6195 | - if self.value is not None: | |
| 6196 | - result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) | |
| 6197 | 6164 | return result |
| 6198 | 6165 | |
| 6199 | 6166 | |
| @@ -6207,6 +6174,16 @@ class X2Class: | ||
| 6207 | 6174 | |
| 6208 | 6175 | Definition object for a constant value of an encoding channel. |
| 6209 | 6176 | """ |
| 6177 | + type: ConditionalPredicateValueDefType | |
| 6178 | + """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 6179 | + `"nominal"`). | |
| 6180 | + It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 6181 | + [geographic projection](projection.html) is applied. | |
| 6182 | + """ | |
| 6183 | + value: float | bool | str | |
| 6184 | + """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 6185 | + `0` to `1` for opacity). | |
| 6186 | + """ | |
| 6210 | 6187 | aggregate: AggregateOp | None = None |
| 6211 | 6188 | """Aggregation function for the field |
| 6212 | 6189 | (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -6238,30 +6215,22 @@ class X2Class: | ||
| 6238 | 6215 | |
| 6239 | 6216 | __Default value:__ `undefined` (None) |
| 6240 | 6217 | """ |
| 6241 | - type: ConditionalPredicateValueDefType | None = None | |
| 6242 | - """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or | |
| 6243 | - `"nominal"`). | |
| 6244 | - It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a | |
| 6245 | - [geographic projection](projection.html) is applied. | |
| 6246 | - """ | |
| 6247 | - value: float | bool | str | None = None | |
| 6248 | - """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between | |
| 6249 | - `0` to `1` for opacity). | |
| 6250 | - """ | |
| 6251 | 6218 | |
| 6252 | 6219 | @staticmethod |
| 6253 | 6220 | def from_dict(obj: Any) -> 'X2Class': |
| 6254 | 6221 | assert isinstance(obj, dict) |
| 6222 | + type = ConditionalPredicateValueDefType(obj.get("type")) | |
| 6223 | + value = from_union([from_float, from_bool, from_str], obj.get("value")) | |
| 6255 | 6224 | aggregate = from_union([AggregateOp, from_none], obj.get("aggregate")) |
| 6256 | 6225 | bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) |
| 6257 | 6226 | field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field")) |
| 6258 | 6227 | time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) |
| 6259 | - type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type")) | |
| 6260 | - value = from_union([from_float, from_bool, from_str, from_none], obj.get("value")) | |
| 6261 | - return X2Class(aggregate, bin, field, time_unit, type, value) | |
| 6228 | + return X2Class(type, value, aggregate, bin, field, time_unit) | |
| 6262 | 6229 | |
| 6263 | 6230 | def to_dict(self) -> dict: |
| 6264 | 6231 | result: dict = {} |
| 6232 | + result["type"] = to_enum(ConditionalPredicateValueDefType, self.type) | |
| 6233 | + result["value"] = from_union([to_float, from_bool, from_str], self.value) | |
| 6265 | 6234 | if self.aggregate is not None: |
| 6266 | 6235 | result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate) |
| 6267 | 6236 | if self.bin is not None: |
| @@ -6270,10 +6239,6 @@ class X2Class: | ||
| 6270 | 6239 | result["field"] = from_union([lambda x: to_class(RepeatRef, x), from_str, from_none], self.field) |
| 6271 | 6240 | if self.time_unit is not None: |
| 6272 | 6241 | result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) |
| 6273 | - if self.type is not None: | |
| 6274 | - result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type) | |
| 6275 | - if self.value is not None: | |
| 6276 | - result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value) | |
| 6277 | 6242 | return result |
| 6278 | 6243 | |
| 6279 | 6244 | |
| @@ -7350,7 +7315,7 @@ class LookupData: | ||
| 7350 | 7315 | |
| 7351 | 7316 | @dataclass |
| 7352 | 7317 | class Transform: |
| 7353 | - filter: Predicate | str | None = None | |
| 7318 | + filter: Predicate | str | |
| 7354 | 7319 | """The `filter` property must be one of the predicate definitions: |
| 7355 | 7320 | (1) an [expression](types.html#expression) string, |
| 7356 | 7321 | where `datum` can be used to refer to the current data object; |
| @@ -7360,47 +7325,47 @@ class Transform: | ||
| 7360 | 7325 | (3) a [selection predicate](filter.html#selection-predicate); |
| 7361 | 7326 | or (4) a logical operand that combines (1), (2), or (3). |
| 7362 | 7327 | """ |
| 7363 | - transform_as: list[str] | str | None = None | |
| 7364 | - """The field for storing the computed formula value. | |
| 7365 | - | |
| 7366 | - The field or fields for storing the computed formula value. | |
| 7367 | - If `from.fields` is specified, the transform will use the same names for `as`. | |
| 7368 | - If `from.fields` is not specified, `as` has to be a string and we put the whole object | |
| 7369 | - into the data under the specified name. | |
| 7370 | - | |
| 7371 | - The output fields at which to write the start and end bin values. | |
| 7372 | - | |
| 7373 | - The output field to write the timeUnit value. | |
| 7374 | - """ | |
| 7375 | - calculate: str | None = None | |
| 7328 | + calculate: str | |
| 7376 | 7329 | """A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 7377 | 7330 | current data object. |
| 7378 | 7331 | """ |
| 7379 | - default: str | None = None | |
| 7380 | - """The default value to use if lookup fails. | |
| 7381 | - | |
| 7382 | - __Default value:__ `null` | |
| 7383 | - """ | |
| 7384 | - transform_from: LookupData | None = None | |
| 7332 | + transform_from: LookupData | |
| 7385 | 7333 | """Secondary data reference.""" |
| 7386 | 7334 | |
| 7387 | - lookup: str | None = None | |
| 7335 | + lookup: str | |
| 7388 | 7336 | """Key in primary data source.""" |
| 7389 | 7337 | |
| 7390 | - bin: bool | BinParams | None = None | |
| 7338 | + bin: bool | BinParams | |
| 7391 | 7339 | """An object indicating bin properties, or simply `true` for using default bin parameters.""" |
| 7392 | 7340 | |
| 7393 | - field: str | None = None | |
| 7341 | + field: str | |
| 7394 | 7342 | """The data field to bin. |
| 7395 | 7343 | |
| 7396 | 7344 | The data field to apply time unit. |
| 7397 | 7345 | """ |
| 7398 | - time_unit: TimeUnit | None = None | |
| 7346 | + time_unit: TimeUnit | |
| 7399 | 7347 | """The timeUnit.""" |
| 7400 | 7348 | |
| 7401 | - aggregate: list[AggregatedFieldDef] | None = None | |
| 7349 | + aggregate: list[AggregatedFieldDef] | |
| 7402 | 7350 | """Array of objects that define fields to aggregate.""" |
| 7403 | 7351 | |
| 7352 | + transform_as: list[str] | str | None = None | |
| 7353 | + """The field for storing the computed formula value. | |
| 7354 | + | |
| 7355 | + The field or fields for storing the computed formula value. | |
| 7356 | + If `from.fields` is specified, the transform will use the same names for `as`. | |
| 7357 | + If `from.fields` is not specified, `as` has to be a string and we put the whole object | |
| 7358 | + into the data under the specified name. | |
| 7359 | + | |
| 7360 | + The output fields at which to write the start and end bin values. | |
| 7361 | + | |
| 7362 | + The output field to write the timeUnit value. | |
| 7363 | + """ | |
| 7364 | + default: str | None = None | |
| 7365 | + """The default value to use if lookup fails. | |
| 7366 | + | |
| 7367 | + __Default value:__ `null` | |
| 7368 | + """ | |
| 7404 | 7369 | groupby: list[str] | None = None |
| 7405 | 7370 | """The data fields to group by. If not specified, a single group containing all data objects |
| 7406 | 7371 | will be used. |
| @@ -7409,41 +7374,33 @@ class Transform: | ||
| 7409 | 7374 | @staticmethod |
| 7410 | 7375 | def from_dict(obj: Any) -> 'Transform': |
| 7411 | 7376 | assert isinstance(obj, dict) |
| 7412 | - filter = from_union([Predicate.from_dict, from_str, from_none], obj.get("filter")) | |
| 7377 | + filter = from_union([Predicate.from_dict, from_str], obj.get("filter")) | |
| 7378 | + calculate = from_str(obj.get("calculate")) | |
| 7379 | + transform_from = LookupData.from_dict(obj.get("from")) | |
| 7380 | + lookup = from_str(obj.get("lookup")) | |
| 7381 | + bin = from_union([from_bool, BinParams.from_dict], obj.get("bin")) | |
| 7382 | + field = from_str(obj.get("field")) | |
| 7383 | + time_unit = TimeUnit(obj.get("timeUnit")) | |
| 7384 | + aggregate = from_list(AggregatedFieldDef.from_dict, obj.get("aggregate")) | |
| 7413 | 7385 | transform_as = from_union([lambda x: from_list(from_str, x), from_str, from_none], obj.get("as")) |
| 7414 | - calculate = from_union([from_str, from_none], obj.get("calculate")) | |
| 7415 | 7386 | default = from_union([from_str, from_none], obj.get("default")) |
| 7416 | - transform_from = from_union([LookupData.from_dict, from_none], obj.get("from")) | |
| 7417 | - lookup = from_union([from_str, from_none], obj.get("lookup")) | |
| 7418 | - bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin")) | |
| 7419 | - field = from_union([from_str, from_none], obj.get("field")) | |
| 7420 | - time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit")) | |
| 7421 | - aggregate = from_union([lambda x: from_list(AggregatedFieldDef.from_dict, x), from_none], obj.get("aggregate")) | |
| 7422 | 7387 | groupby = from_union([lambda x: from_list(from_str, x), from_none], obj.get("groupby")) |
| 7423 | - return Transform(filter, transform_as, calculate, default, transform_from, lookup, bin, field, time_unit, aggregate, groupby) | |
| 7388 | + return Transform(filter, calculate, transform_from, lookup, bin, field, time_unit, aggregate, transform_as, default, groupby) | |
| 7424 | 7389 | |
| 7425 | 7390 | def to_dict(self) -> dict: |
| 7426 | 7391 | result: dict = {} |
| 7427 | - if self.filter is not None: | |
| 7428 | - result["filter"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.filter) | |
| 7392 | + result["filter"] = from_union([lambda x: to_class(Predicate, x), from_str], self.filter) | |
| 7393 | + result["calculate"] = from_str(self.calculate) | |
| 7394 | + result["from"] = to_class(LookupData, self.transform_from) | |
| 7395 | + result["lookup"] = from_str(self.lookup) | |
| 7396 | + result["bin"] = from_union([from_bool, lambda x: to_class(BinParams, x)], self.bin) | |
| 7397 | + result["field"] = from_str(self.field) | |
| 7398 | + result["timeUnit"] = to_enum(TimeUnit, self.time_unit) | |
| 7399 | + result["aggregate"] = from_list(lambda x: to_class(AggregatedFieldDef, x), self.aggregate) | |
| 7429 | 7400 | if self.transform_as is not None: |
| 7430 | 7401 | result["as"] = from_union([lambda x: from_list(from_str, x), from_str, from_none], self.transform_as) |
| 7431 | - if self.calculate is not None: | |
| 7432 | - result["calculate"] = from_union([from_str, from_none], self.calculate) | |
| 7433 | 7402 | if self.default is not None: |
| 7434 | 7403 | result["default"] = from_union([from_str, from_none], self.default) |
| 7435 | - if self.transform_from is not None: | |
| 7436 | - result["from"] = from_union([lambda x: to_class(LookupData, x), from_none], self.transform_from) | |
| 7437 | - if self.lookup is not None: | |
| 7438 | - result["lookup"] = from_union([from_str, from_none], self.lookup) | |
| 7439 | - if self.bin is not None: | |
| 7440 | - result["bin"] = from_union([from_bool, lambda x: to_class(BinParams, x), from_none], self.bin) | |
| 7441 | - if self.field is not None: | |
| 7442 | - result["field"] = from_union([from_str, from_none], self.field) | |
| 7443 | - if self.time_unit is not None: | |
| 7444 | - result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit) | |
| 7445 | - if self.aggregate is not None: | |
| 7446 | - result["aggregate"] = from_union([lambda x: from_list(lambda x: to_class(AggregatedFieldDef, x), x), from_none], self.aggregate) | |
| 7447 | 7404 | if self.groupby is not None: |
| 7448 | 7405 | result["groupby"] = from_union([lambda x: from_list(from_str, x), from_none], self.groupby) |
| 7449 | 7406 | return result |
| @@ -7453,6 +7410,21 @@ class Transform: | ||
| 7453 | 7410 | class LayerSpec: |
| 7454 | 7411 | """Unit spec that can have a composite mark.""" |
| 7455 | 7412 | |
| 7413 | + layer: list['LayerSpec'] | |
| 7414 | + """Layer or single view specifications to be layered. | |
| 7415 | + | |
| 7416 | + __Note__: Specifications inside `layer` cannot use `row` and `column` channels as | |
| 7417 | + layering facet specifications is not allowed. | |
| 7418 | + """ | |
| 7419 | + encoding: Encoding | |
| 7420 | + """A key-value mapping between encoding channels and definition of fields.""" | |
| 7421 | + | |
| 7422 | + mark: MarkDef | Mark | |
| 7423 | + """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, | |
| 7424 | + `"line"`, | |
| 7425 | + * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition | |
| 7426 | + object](mark.html#mark-def). | |
| 7427 | + """ | |
| 7456 | 7428 | data: Data | None = None |
| 7457 | 7429 | """An object describing the data source""" |
| 7458 | 7430 | |
| @@ -7478,12 +7450,6 @@ class LayerSpec: | ||
| 7478 | 7450 | |
| 7479 | 7451 | __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 7480 | 7452 | """ |
| 7481 | - layer: 'list[LayerSpec] | None' = None | |
| 7482 | - """Layer or single view specifications to be layered. | |
| 7483 | - | |
| 7484 | - __Note__: Specifications inside `layer` cannot use `row` and `column` channels as | |
| 7485 | - layering facet specifications is not allowed. | |
| 7486 | - """ | |
| 7487 | 7453 | name: str | None = None |
| 7488 | 7454 | """Name of the visualization for later reference.""" |
| 7489 | 7455 | |
| @@ -7518,15 +7484,6 @@ class LayerSpec: | ||
| 7518 | 7484 | |
| 7519 | 7485 | __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 7520 | 7486 | """ |
| 7521 | - encoding: Encoding | None = None | |
| 7522 | - """A key-value mapping between encoding channels and definition of fields.""" | |
| 7523 | - | |
| 7524 | - mark: MarkDef | Mark | None = None | |
| 7525 | - """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, | |
| 7526 | - `"line"`, | |
| 7527 | - * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition | |
| 7528 | - object](mark.html#mark-def). | |
| 7529 | - """ | |
| 7530 | 7487 | projection: Projection | None = None |
| 7531 | 7488 | """An object defining properties of geographic projection. |
| 7532 | 7489 | |
| @@ -7539,31 +7496,32 @@ class LayerSpec: | ||
| 7539 | 7496 | @staticmethod |
| 7540 | 7497 | def from_dict(obj: Any) -> 'LayerSpec': |
| 7541 | 7498 | assert isinstance(obj, dict) |
| 7499 | + layer = from_list(LayerSpec.from_dict, obj.get("layer")) | |
| 7500 | + encoding = Encoding.from_dict(obj.get("encoding")) | |
| 7501 | + mark = from_union([MarkDef.from_dict, Mark], obj.get("mark")) | |
| 7542 | 7502 | data = from_union([Data.from_dict, from_none], obj.get("data")) |
| 7543 | 7503 | description = from_union([from_str, from_none], obj.get("description")) |
| 7544 | 7504 | height = from_union([from_float, from_none], obj.get("height")) |
| 7545 | - layer = from_union([lambda x: from_list(LayerSpec.from_dict, x), from_none], obj.get("layer")) | |
| 7546 | 7505 | name = from_union([from_str, from_none], obj.get("name")) |
| 7547 | 7506 | resolve = from_union([Resolve.from_dict, from_none], obj.get("resolve")) |
| 7548 | 7507 | title = from_union([TitleParams.from_dict, from_str, from_none], obj.get("title")) |
| 7549 | 7508 | transform = from_union([lambda x: from_list(Transform.from_dict, x), from_none], obj.get("transform")) |
| 7550 | 7509 | width = from_union([from_float, from_none], obj.get("width")) |
| 7551 | - encoding = from_union([Encoding.from_dict, from_none], obj.get("encoding")) | |
| 7552 | - mark = from_union([MarkDef.from_dict, Mark, from_none], obj.get("mark")) | |
| 7553 | 7510 | projection = from_union([Projection.from_dict, from_none], obj.get("projection")) |
| 7554 | 7511 | selection = from_union([lambda x: from_dict(SelectionDef.from_dict, x), from_none], obj.get("selection")) |
| 7555 | - return LayerSpec(data, description, height, layer, name, resolve, title, transform, width, encoding, mark, projection, selection) | |
| 7512 | + return LayerSpec(layer, encoding, mark, data, description, height, name, resolve, title, transform, width, projection, selection) | |
| 7556 | 7513 | |
| 7557 | 7514 | def to_dict(self) -> dict: |
| 7558 | 7515 | result: dict = {} |
| 7516 | + result["layer"] = from_list(lambda x: to_class(LayerSpec, x), self.layer) | |
| 7517 | + result["encoding"] = to_class(Encoding, self.encoding) | |
| 7518 | + result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x)], self.mark) | |
| 7559 | 7519 | if self.data is not None: |
| 7560 | 7520 | result["data"] = from_union([lambda x: to_class(Data, x), from_none], self.data) |
| 7561 | 7521 | if self.description is not None: |
| 7562 | 7522 | result["description"] = from_union([from_str, from_none], self.description) |
| 7563 | 7523 | if self.height is not None: |
| 7564 | 7524 | result["height"] = from_union([to_float, from_none], self.height) |
| 7565 | - if self.layer is not None: | |
| 7566 | - result["layer"] = from_union([lambda x: from_list(lambda x: to_class(LayerSpec, x), x), from_none], self.layer) | |
| 7567 | 7525 | if self.name is not None: |
| 7568 | 7526 | result["name"] = from_union([from_str, from_none], self.name) |
| 7569 | 7527 | if self.resolve is not None: |
| @@ -7574,10 +7532,6 @@ class LayerSpec: | ||
| 7574 | 7532 | result["transform"] = from_union([lambda x: from_list(lambda x: to_class(Transform, x), x), from_none], self.transform) |
| 7575 | 7533 | if self.width is not None: |
| 7576 | 7534 | result["width"] = from_union([to_float, from_none], self.width) |
| 7577 | - if self.encoding is not None: | |
| 7578 | - result["encoding"] = from_union([lambda x: to_class(Encoding, x), from_none], self.encoding) | |
| 7579 | - if self.mark is not None: | |
| 7580 | - result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x), from_none], self.mark) | |
| 7581 | 7535 | if self.projection is not None: |
| 7582 | 7536 | result["projection"] = from_union([lambda x: to_class(Projection, x), from_none], self.projection) |
| 7583 | 7537 | if self.selection is not None: |
| @@ -7616,6 +7570,38 @@ class Repeat: | ||
| 7616 | 7570 | class Spec: |
| 7617 | 7571 | """Unit spec that can have a composite mark.""" |
| 7618 | 7572 | |
| 7573 | + layer: list[LayerSpec] | |
| 7574 | + """Layer or single view specifications to be layered. | |
| 7575 | + | |
| 7576 | + __Note__: Specifications inside `layer` cannot use `row` and `column` channels as | |
| 7577 | + layering facet specifications is not allowed. | |
| 7578 | + """ | |
| 7579 | + encoding: Encoding | |
| 7580 | + """A key-value mapping between encoding channels and definition of fields.""" | |
| 7581 | + | |
| 7582 | + mark: MarkDef | Mark | |
| 7583 | + """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, | |
| 7584 | + `"line"`, | |
| 7585 | + * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition | |
| 7586 | + object](mark.html#mark-def). | |
| 7587 | + """ | |
| 7588 | + facet: FacetMapping | |
| 7589 | + """An object that describes mappings between `row` and `column` channels and their field | |
| 7590 | + definitions. | |
| 7591 | + """ | |
| 7592 | + spec: 'Spec' | |
| 7593 | + """A specification of the view that gets faceted.""" | |
| 7594 | + | |
| 7595 | + repeat: Repeat | |
| 7596 | + """An object that describes what fields should be repeated into views that are laid out as a | |
| 7597 | + `row` or `column`. | |
| 7598 | + """ | |
| 7599 | + vconcat: list['Spec'] | |
| 7600 | + """A list of views that should be concatenated and put into a column.""" | |
| 7601 | + | |
| 7602 | + hconcat: list['Spec'] | |
| 7603 | + """A list of views that should be concatenated and put into a row.""" | |
| 7604 | + | |
| 7619 | 7605 | data: Data | None = None |
| 7620 | 7606 | """An object describing the data source""" |
| 7621 | 7607 | |
| @@ -7641,12 +7627,6 @@ class Spec: | ||
| 7641 | 7627 | |
| 7642 | 7628 | __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 7643 | 7629 | """ |
| 7644 | - layer: list[LayerSpec] | None = None | |
| 7645 | - """Layer or single view specifications to be layered. | |
| 7646 | - | |
| 7647 | - __Note__: Specifications inside `layer` cannot use `row` and `column` channels as | |
| 7648 | - layering facet specifications is not allowed. | |
| 7649 | - """ | |
| 7650 | 7630 | name: str | None = None |
| 7651 | 7631 | """Name of the visualization for later reference.""" |
| 7652 | 7632 | |
| @@ -7689,15 +7669,6 @@ class Spec: | ||
| 7689 | 7669 | |
| 7690 | 7670 | __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 7691 | 7671 | """ |
| 7692 | - encoding: Encoding | None = None | |
| 7693 | - """A key-value mapping between encoding channels and definition of fields.""" | |
| 7694 | - | |
| 7695 | - mark: MarkDef | Mark | None = None | |
| 7696 | - """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, | |
| 7697 | - `"line"`, | |
| 7698 | - * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition | |
| 7699 | - object](mark.html#mark-def). | |
| 7700 | - """ | |
| 7701 | 7672 | projection: Projection | None = None |
| 7702 | 7673 | """An object defining properties of geographic projection. |
| 7703 | 7674 | |
| @@ -7707,56 +7678,45 @@ class Spec: | ||
| 7707 | 7678 | selection: dict[str, SelectionDef] | None = None |
| 7708 | 7679 | """A key-value mapping between selection names and definitions.""" |
| 7709 | 7680 | |
| 7710 | - facet: FacetMapping | None = None | |
| 7711 | - """An object that describes mappings between `row` and `column` channels and their field | |
| 7712 | - definitions. | |
| 7713 | - """ | |
| 7714 | - spec: 'Spec | None' = None | |
| 7715 | - """A specification of the view that gets faceted.""" | |
| 7716 | - | |
| 7717 | - repeat: Repeat | None = None | |
| 7718 | - """An object that describes what fields should be repeated into views that are laid out as a | |
| 7719 | - `row` or `column`. | |
| 7720 | - """ | |
| 7721 | - vconcat: 'list[Spec] | None' = None | |
| 7722 | - """A list of views that should be concatenated and put into a column.""" | |
| 7723 | - | |
| 7724 | - hconcat: 'list[Spec] | None' = None | |
| 7725 | - """A list of views that should be concatenated and put into a row.""" | |
| 7726 | - | |
| 7727 | 7681 | @staticmethod |
| 7728 | 7682 | def from_dict(obj: Any) -> 'Spec': |
| 7729 | 7683 | assert isinstance(obj, dict) |
| 7684 | + layer = from_list(LayerSpec.from_dict, obj.get("layer")) | |
| 7685 | + encoding = Encoding.from_dict(obj.get("encoding")) | |
| 7686 | + mark = from_union([MarkDef.from_dict, Mark], obj.get("mark")) | |
| 7687 | + facet = FacetMapping.from_dict(obj.get("facet")) | |
| 7688 | + spec = Spec.from_dict(obj.get("spec")) | |
| 7689 | + repeat = Repeat.from_dict(obj.get("repeat")) | |
| 7690 | + vconcat = from_list(Spec.from_dict, obj.get("vconcat")) | |
| 7691 | + hconcat = from_list(Spec.from_dict, obj.get("hconcat")) | |
| 7730 | 7692 | data = from_union([Data.from_dict, from_none], obj.get("data")) |
| 7731 | 7693 | description = from_union([from_str, from_none], obj.get("description")) |
| 7732 | 7694 | height = from_union([from_float, from_none], obj.get("height")) |
| 7733 | - layer = from_union([lambda x: from_list(LayerSpec.from_dict, x), from_none], obj.get("layer")) | |
| 7734 | 7695 | name = from_union([from_str, from_none], obj.get("name")) |
| 7735 | 7696 | resolve = from_union([Resolve.from_dict, from_none], obj.get("resolve")) |
| 7736 | 7697 | title = from_union([TitleParams.from_dict, from_str, from_none], obj.get("title")) |
| 7737 | 7698 | transform = from_union([lambda x: from_list(Transform.from_dict, x), from_none], obj.get("transform")) |
| 7738 | 7699 | width = from_union([from_float, from_none], obj.get("width")) |
| 7739 | - encoding = from_union([Encoding.from_dict, from_none], obj.get("encoding")) | |
| 7740 | - mark = from_union([MarkDef.from_dict, Mark, from_none], obj.get("mark")) | |
| 7741 | 7700 | projection = from_union([Projection.from_dict, from_none], obj.get("projection")) |
| 7742 | 7701 | selection = from_union([lambda x: from_dict(SelectionDef.from_dict, x), from_none], obj.get("selection")) |
| 7743 | - facet = from_union([FacetMapping.from_dict, from_none], obj.get("facet")) | |
| 7744 | - spec = from_union([Spec.from_dict, from_none], obj.get("spec")) | |
| 7745 | - repeat = from_union([Repeat.from_dict, from_none], obj.get("repeat")) | |
| 7746 | - vconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("vconcat")) | |
| 7747 | - hconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("hconcat")) | |
| 7748 | - return Spec(data, description, height, layer, name, resolve, title, transform, width, encoding, mark, projection, selection, facet, spec, repeat, vconcat, hconcat) | |
| 7702 | + return Spec(layer, encoding, mark, facet, spec, repeat, vconcat, hconcat, data, description, height, name, resolve, title, transform, width, projection, selection) | |
| 7749 | 7703 | |
| 7750 | 7704 | def to_dict(self) -> dict: |
| 7751 | 7705 | result: dict = {} |
| 7706 | + result["layer"] = from_list(lambda x: to_class(LayerSpec, x), self.layer) | |
| 7707 | + result["encoding"] = to_class(Encoding, self.encoding) | |
| 7708 | + result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x)], self.mark) | |
| 7709 | + result["facet"] = to_class(FacetMapping, self.facet) | |
| 7710 | + result["spec"] = to_class(Spec, self.spec) | |
| 7711 | + result["repeat"] = to_class(Repeat, self.repeat) | |
| 7712 | + result["vconcat"] = from_list(lambda x: to_class(Spec, x), self.vconcat) | |
| 7713 | + result["hconcat"] = from_list(lambda x: to_class(Spec, x), self.hconcat) | |
| 7752 | 7714 | if self.data is not None: |
| 7753 | 7715 | result["data"] = from_union([lambda x: to_class(Data, x), from_none], self.data) |
| 7754 | 7716 | if self.description is not None: |
| 7755 | 7717 | result["description"] = from_union([from_str, from_none], self.description) |
| 7756 | 7718 | if self.height is not None: |
| 7757 | 7719 | result["height"] = from_union([to_float, from_none], self.height) |
| 7758 | - if self.layer is not None: | |
| 7759 | - result["layer"] = from_union([lambda x: from_list(lambda x: to_class(LayerSpec, x), x), from_none], self.layer) | |
| 7760 | 7720 | if self.name is not None: |
| 7761 | 7721 | result["name"] = from_union([from_str, from_none], self.name) |
| 7762 | 7722 | if self.resolve is not None: |
| @@ -7767,29 +7727,47 @@ class Spec: | ||
| 7767 | 7727 | result["transform"] = from_union([lambda x: from_list(lambda x: to_class(Transform, x), x), from_none], self.transform) |
| 7768 | 7728 | if self.width is not None: |
| 7769 | 7729 | result["width"] = from_union([to_float, from_none], self.width) |
| 7770 | - if self.encoding is not None: | |
| 7771 | - result["encoding"] = from_union([lambda x: to_class(Encoding, x), from_none], self.encoding) | |
| 7772 | - if self.mark is not None: | |
| 7773 | - result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x), from_none], self.mark) | |
| 7774 | 7730 | if self.projection is not None: |
| 7775 | 7731 | result["projection"] = from_union([lambda x: to_class(Projection, x), from_none], self.projection) |
| 7776 | 7732 | if self.selection is not None: |
| 7777 | 7733 | result["selection"] = from_union([lambda x: from_dict(lambda x: to_class(SelectionDef, x), x), from_none], self.selection) |
| 7778 | - if self.facet is not None: | |
| 7779 | - result["facet"] = from_union([lambda x: to_class(FacetMapping, x), from_none], self.facet) | |
| 7780 | - if self.spec is not None: | |
| 7781 | - result["spec"] = from_union([lambda x: to_class(Spec, x), from_none], self.spec) | |
| 7782 | - if self.repeat is not None: | |
| 7783 | - result["repeat"] = from_union([lambda x: to_class(Repeat, x), from_none], self.repeat) | |
| 7784 | - if self.vconcat is not None: | |
| 7785 | - result["vconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.vconcat) | |
| 7786 | - if self.hconcat is not None: | |
| 7787 | - result["hconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.hconcat) | |
| 7788 | 7734 | return result |
| 7789 | 7735 | |
| 7790 | 7736 | |
| 7791 | 7737 | @dataclass |
| 7792 | 7738 | class TopLevel: |
| 7739 | + encoding: EncodingWithFacet | |
| 7740 | + """A key-value mapping between encoding channels and definition of fields.""" | |
| 7741 | + | |
| 7742 | + mark: MarkDef | Mark | |
| 7743 | + """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, | |
| 7744 | + `"line"`, | |
| 7745 | + * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition | |
| 7746 | + object](mark.html#mark-def). | |
| 7747 | + """ | |
| 7748 | + layer: list[LayerSpec] | |
| 7749 | + """Layer or single view specifications to be layered. | |
| 7750 | + | |
| 7751 | + __Note__: Specifications inside `layer` cannot use `row` and `column` channels as | |
| 7752 | + layering facet specifications is not allowed. | |
| 7753 | + """ | |
| 7754 | + facet: FacetMapping | |
| 7755 | + """An object that describes mappings between `row` and `column` channels and their field | |
| 7756 | + definitions. | |
| 7757 | + """ | |
| 7758 | + spec: Spec | |
| 7759 | + """A specification of the view that gets faceted.""" | |
| 7760 | + | |
| 7761 | + repeat: Repeat | |
| 7762 | + """An object that describes what fields should be repeated into views that are laid out as a | |
| 7763 | + `row` or `column`. | |
| 7764 | + """ | |
| 7765 | + vconcat: list[Spec] | |
| 7766 | + """A list of views that should be concatenated and put into a column.""" | |
| 7767 | + | |
| 7768 | + hconcat: list[Spec] | |
| 7769 | + """A list of views that should be concatenated and put into a row.""" | |
| 7770 | + | |
| 7793 | 7771 | schema: str | None = None |
| 7794 | 7772 | """URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you |
| 7795 | 7773 | have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`. |
| @@ -7820,9 +7798,6 @@ class TopLevel: | ||
| 7820 | 7798 | description: str | None = None |
| 7821 | 7799 | """Description of this mark for commenting purpose.""" |
| 7822 | 7800 | |
| 7823 | - encoding: EncodingWithFacet | None = None | |
| 7824 | - """A key-value mapping between encoding channels and definition of fields.""" | |
| 7825 | - | |
| 7826 | 7801 | height: float | None = None |
| 7827 | 7802 | """The height of a visualization. |
| 7828 | 7803 | |
| @@ -7842,12 +7817,6 @@ class TopLevel: | ||
| 7842 | 7817 | |
| 7843 | 7818 | __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 7844 | 7819 | """ |
| 7845 | - mark: MarkDef | Mark | None = None | |
| 7846 | - """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, | |
| 7847 | - `"line"`, | |
| 7848 | - * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition | |
| 7849 | - object](mark.html#mark-def). | |
| 7850 | - """ | |
| 7851 | 7820 | name: str | None = None |
| 7852 | 7821 | """Name of the visualization for later reference.""" |
| 7853 | 7822 | |
| @@ -7896,12 +7865,6 @@ class TopLevel: | ||
| 7896 | 7865 | |
| 7897 | 7866 | __See also:__ The documentation for [width and height](size.html) contains more examples. |
| 7898 | 7867 | """ |
| 7899 | - layer: list[LayerSpec] | None = None | |
| 7900 | - """Layer or single view specifications to be layered. | |
| 7901 | - | |
| 7902 | - __Note__: Specifications inside `layer` cannot use `row` and `column` channels as | |
| 7903 | - layering facet specifications is not allowed. | |
| 7904 | - """ | |
| 7905 | 7868 | resolve: Resolve | None = None |
| 7906 | 7869 | """Scale, axis, and legend resolutions for layers. |
| 7907 | 7870 | |
| @@ -7913,35 +7876,25 @@ class TopLevel: | ||
| 7913 | 7876 | |
| 7914 | 7877 | Scale, axis, and legend resolutions for horizontally concatenated charts. |
| 7915 | 7878 | """ |
| 7916 | - facet: FacetMapping | None = None | |
| 7917 | - """An object that describes mappings between `row` and `column` channels and their field | |
| 7918 | - definitions. | |
| 7919 | - """ | |
| 7920 | - spec: Spec | None = None | |
| 7921 | - """A specification of the view that gets faceted.""" | |
| 7922 | - | |
| 7923 | - repeat: Repeat | None = None | |
| 7924 | - """An object that describes what fields should be repeated into views that are laid out as a | |
| 7925 | - `row` or `column`. | |
| 7926 | - """ | |
| 7927 | - vconcat: list[Spec] | None = None | |
| 7928 | - """A list of views that should be concatenated and put into a column.""" | |
| 7929 | - | |
| 7930 | - hconcat: list[Spec] | None = None | |
| 7931 | - """A list of views that should be concatenated and put into a row.""" | |
| 7932 | 7879 | |
| 7933 | 7880 | @staticmethod |
| 7934 | 7881 | def from_dict(obj: Any) -> 'TopLevel': |
| 7935 | 7882 | assert isinstance(obj, dict) |
| 7883 | + encoding = EncodingWithFacet.from_dict(obj.get("encoding")) | |
| 7884 | + mark = from_union([MarkDef.from_dict, Mark], obj.get("mark")) | |
| 7885 | + layer = from_list(LayerSpec.from_dict, obj.get("layer")) | |
| 7886 | + facet = FacetMapping.from_dict(obj.get("facet")) | |
| 7887 | + spec = Spec.from_dict(obj.get("spec")) | |
| 7888 | + repeat = Repeat.from_dict(obj.get("repeat")) | |
| 7889 | + vconcat = from_list(Spec.from_dict, obj.get("vconcat")) | |
| 7890 | + hconcat = from_list(Spec.from_dict, obj.get("hconcat")) | |
| 7936 | 7891 | schema = from_union([from_str, from_none], obj.get("$schema")) |
| 7937 | 7892 | autosize = from_union([AutoSizeParams.from_dict, AutosizeType, from_none], obj.get("autosize")) |
| 7938 | 7893 | background = from_union([from_str, from_none], obj.get("background")) |
| 7939 | 7894 | config = from_union([Config.from_dict, from_none], obj.get("config")) |
| 7940 | 7895 | data = from_union([Data.from_dict, from_none], obj.get("data")) |
| 7941 | 7896 | description = from_union([from_str, from_none], obj.get("description")) |
| 7942 | - encoding = from_union([EncodingWithFacet.from_dict, from_none], obj.get("encoding")) | |
| 7943 | 7897 | height = from_union([from_float, from_none], obj.get("height")) |
| 7944 | - mark = from_union([MarkDef.from_dict, Mark, from_none], obj.get("mark")) | |
| 7945 | 7898 | name = from_union([from_str, from_none], obj.get("name")) |
| 7946 | 7899 | padding = from_union([from_float, PaddingClass.from_dict, from_none], obj.get("padding")) |
| 7947 | 7900 | projection = from_union([Projection.from_dict, from_none], obj.get("projection")) |
| @@ -7949,17 +7902,19 @@ class TopLevel: | ||
| 7949 | 7902 | title = from_union([TitleParams.from_dict, from_str, from_none], obj.get("title")) |
| 7950 | 7903 | transform = from_union([lambda x: from_list(Transform.from_dict, x), from_none], obj.get("transform")) |
| 7951 | 7904 | width = from_union([from_float, from_none], obj.get("width")) |
| 7952 | - layer = from_union([lambda x: from_list(LayerSpec.from_dict, x), from_none], obj.get("layer")) | |
| 7953 | 7905 | resolve = from_union([Resolve.from_dict, from_none], obj.get("resolve")) |
| 7954 | - facet = from_union([FacetMapping.from_dict, from_none], obj.get("facet")) | |
| 7955 | - spec = from_union([Spec.from_dict, from_none], obj.get("spec")) | |
| 7956 | - repeat = from_union([Repeat.from_dict, from_none], obj.get("repeat")) | |
| 7957 | - vconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("vconcat")) | |
| 7958 | - hconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("hconcat")) | |
| 7959 | - return TopLevel(schema, autosize, background, config, data, description, encoding, height, mark, name, padding, projection, selection, title, transform, width, layer, resolve, facet, spec, repeat, vconcat, hconcat) | |
| 7906 | + return TopLevel(encoding, mark, layer, facet, spec, repeat, vconcat, hconcat, schema, autosize, background, config, data, description, height, name, padding, projection, selection, title, transform, width, resolve) | |
| 7960 | 7907 | |
| 7961 | 7908 | def to_dict(self) -> dict: |
| 7962 | 7909 | result: dict = {} |
| 7910 | + result["encoding"] = to_class(EncodingWithFacet, self.encoding) | |
| 7911 | + result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x)], self.mark) | |
| 7912 | + result["layer"] = from_list(lambda x: to_class(LayerSpec, x), self.layer) | |
| 7913 | + result["facet"] = to_class(FacetMapping, self.facet) | |
| 7914 | + result["spec"] = to_class(Spec, self.spec) | |
| 7915 | + result["repeat"] = to_class(Repeat, self.repeat) | |
| 7916 | + result["vconcat"] = from_list(lambda x: to_class(Spec, x), self.vconcat) | |
| 7917 | + result["hconcat"] = from_list(lambda x: to_class(Spec, x), self.hconcat) | |
| 7963 | 7918 | if self.schema is not None: |
| 7964 | 7919 | result["$schema"] = from_union([from_str, from_none], self.schema) |
| 7965 | 7920 | if self.autosize is not None: |
| @@ -7972,12 +7927,8 @@ class TopLevel: | ||
| 7972 | 7927 | result["data"] = from_union([lambda x: to_class(Data, x), from_none], self.data) |
| 7973 | 7928 | if self.description is not None: |
| 7974 | 7929 | result["description"] = from_union([from_str, from_none], self.description) |
| 7975 | - if self.encoding is not None: | |
| 7976 | - result["encoding"] = from_union([lambda x: to_class(EncodingWithFacet, x), from_none], self.encoding) | |
| 7977 | 7930 | if self.height is not None: |
| 7978 | 7931 | result["height"] = from_union([to_float, from_none], self.height) |
| 7979 | - if self.mark is not None: | |
| 7980 | - result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x), from_none], self.mark) | |
| 7981 | 7932 | if self.name is not None: |
| 7982 | 7933 | result["name"] = from_union([from_str, from_none], self.name) |
| 7983 | 7934 | if self.padding is not None: |
| @@ -7992,20 +7943,8 @@ class TopLevel: | ||
| 7992 | 7943 | result["transform"] = from_union([lambda x: from_list(lambda x: to_class(Transform, x), x), from_none], self.transform) |
| 7993 | 7944 | if self.width is not None: |
| 7994 | 7945 | result["width"] = from_union([to_float, from_none], self.width) |
| 7995 | - if self.layer is not None: | |
| 7996 | - result["layer"] = from_union([lambda x: from_list(lambda x: to_class(LayerSpec, x), x), from_none], self.layer) | |
| 7997 | 7946 | if self.resolve is not None: |
| 7998 | 7947 | result["resolve"] = from_union([lambda x: to_class(Resolve, x), from_none], self.resolve) |
| 7999 | - if self.facet is not None: | |
| 8000 | - result["facet"] = from_union([lambda x: to_class(FacetMapping, x), from_none], self.facet) | |
| 8001 | - if self.spec is not None: | |
| 8002 | - result["spec"] = from_union([lambda x: to_class(Spec, x), from_none], self.spec) | |
| 8003 | - if self.repeat is not None: | |
| 8004 | - result["repeat"] = from_union([lambda x: to_class(Repeat, x), from_none], self.repeat) | |
| 8005 | - if self.vconcat is not None: | |
| 8006 | - result["vconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.vconcat) | |
| 8007 | - if self.hconcat is not None: | |
| 8008 | - result["hconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.hconcat) | |
| 8009 | 7948 | return result |
Mschema-rubydefault / TopLevel.rb+176 −176
| @@ -4,7 +4,7 @@ | ||
| 4 | 4 | # To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do: |
| 5 | 5 | # |
| 6 | 6 | # top_level = TopLevel.from_json! "{…}" |
| 7 | -# puts top_level.hconcat&.first.hconcat&.first.hconcat&.first | |
| 7 | +# puts top_level.hconcat.first.hconcat.first.hconcat.first | |
| 8 | 8 | # |
| 9 | 9 | # If from_json! succeeds, the value returned matches the schema. |
| 10 | 10 | |
| @@ -1962,7 +1962,7 @@ end | ||
| 1962 | 1962 | class VGScheme < Dry::Struct |
| 1963 | 1963 | attribute :count, Types::Double.optional |
| 1964 | 1964 | attribute :extent, Types.Array(Types::Double).optional |
| 1965 | - attribute :scheme, Types::String.optional | |
| 1965 | + attribute :scheme, Types::String | |
| 1966 | 1966 | attribute :step, Types::Double.optional |
| 1967 | 1967 | |
| 1968 | 1968 | def self.from_dynamic!(d) |
| @@ -1970,7 +1970,7 @@ class VGScheme < Dry::Struct | ||
| 1970 | 1970 | new( |
| 1971 | 1971 | count: d["count"], |
| 1972 | 1972 | extent: d["extent"], |
| 1973 | - scheme: d["scheme"], | |
| 1973 | + scheme: d.fetch("scheme"), | |
| 1974 | 1974 | step: d["step"], |
| 1975 | 1975 | ) |
| 1976 | 1976 | end |
| @@ -2543,7 +2543,7 @@ end | ||
| 2543 | 2543 | class VGBinding < Dry::Struct |
| 2544 | 2544 | attribute :element, Types::String.optional |
| 2545 | 2545 | attribute :input, Types::String |
| 2546 | - attribute :vg_binding_options, Types.Array(Types::String).optional | |
| 2546 | + attribute :vg_binding_options, Types.Array(Types::String) | |
| 2547 | 2547 | attribute :max, Types::Double.optional |
| 2548 | 2548 | attribute :min, Types::Double.optional |
| 2549 | 2549 | attribute :step, Types::Double.optional |
| @@ -2553,7 +2553,7 @@ class VGBinding < Dry::Struct | ||
| 2553 | 2553 | new( |
| 2554 | 2554 | element: d["element"], |
| 2555 | 2555 | input: d.fetch("input"), |
| 2556 | - vg_binding_options: d["options"], | |
| 2556 | + vg_binding_options: d.fetch("options"), | |
| 2557 | 2557 | max: d["max"], |
| 2558 | 2558 | min: d["min"], |
| 2559 | 2559 | step: d["step"], |
| @@ -4134,24 +4134,24 @@ class DataClass < Dry::Struct | ||
| 4134 | 4134 | |
| 4135 | 4135 | # An URL from which to load the data set. Use the `format.type` property |
| 4136 | 4136 | # to ensure the loaded data is correctly parsed. |
| 4137 | - attribute :url, Types::String.optional | |
| 4137 | + attribute :url, Types::String | |
| 4138 | 4138 | |
| 4139 | 4139 | # The full data set, included inline. This can be an array of objects or primitive values |
| 4140 | 4140 | # or a string. |
| 4141 | 4141 | # Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 4142 | 4142 | # parsed according to the specified format type. |
| 4143 | - attribute :values, Types.Instance(Values).optional | |
| 4143 | + attribute :values, Types.Instance(Values) | |
| 4144 | 4144 | |
| 4145 | 4145 | # Provide a placeholder name and bind data at runtime. |
| 4146 | - attribute :data_name, Types::String.optional | |
| 4146 | + attribute :data_name, Types::String | |
| 4147 | 4147 | |
| 4148 | 4148 | def self.from_dynamic!(d) |
| 4149 | 4149 | d = Types::Hash[d] |
| 4150 | 4150 | new( |
| 4151 | 4151 | data_format: d["format"] ? DataFormat.from_dynamic!(d["format"]) : nil, |
| 4152 | - url: d["url"], | |
| 4153 | - values: d["values"] ? Values.from_dynamic!(d["values"]) : nil, | |
| 4154 | - data_name: d["name"], | |
| 4152 | + url: d.fetch("url"), | |
| 4153 | + values: Values.from_dynamic!(d.fetch("values")), | |
| 4154 | + data_name: d.fetch("name"), | |
| 4155 | 4155 | ) |
| 4156 | 4156 | end |
| 4157 | 4157 | |
| @@ -4163,7 +4163,7 @@ class DataClass < Dry::Struct | ||
| 4163 | 4163 | { |
| 4164 | 4164 | "format" => data_format&.to_dynamic, |
| 4165 | 4165 | "url" => url, |
| 4166 | - "values" => values&.to_dynamic, | |
| 4166 | + "values" => values.to_dynamic, | |
| 4167 | 4167 | "name" => data_name, |
| 4168 | 4168 | } |
| 4169 | 4169 | end |
| @@ -4608,16 +4608,16 @@ class SelectionOperand < Dry::Struct | ||
| 4608 | 4608 | end |
| 4609 | 4609 | |
| 4610 | 4610 | class Selection < Dry::Struct |
| 4611 | - attribute :selection_not, Types.Instance(SelectionOperand).optional | |
| 4612 | - attribute :selection_and, Types.Array(Types.Instance(SelectionOperand)).optional | |
| 4613 | - attribute :selection_or, Types.Array(Types.Instance(SelectionOperand)).optional | |
| 4611 | + attribute :selection_not, Types.Instance(SelectionOperand) | |
| 4612 | + attribute :selection_and, Types.Array(Types.Instance(SelectionOperand)) | |
| 4613 | + attribute :selection_or, Types.Array(Types.Instance(SelectionOperand)) | |
| 4614 | 4614 | |
| 4615 | 4615 | def self.from_dynamic!(d) |
| 4616 | 4616 | d = Types::Hash[d] |
| 4617 | 4617 | new( |
| 4618 | - selection_not: d["not"] ? SelectionOperand.from_dynamic!(d["not"]) : nil, | |
| 4619 | - selection_and: d["and"]&.map { |x| SelectionOperand.from_dynamic!(x) }, | |
| 4620 | - selection_or: d["or"]&.map { |x| SelectionOperand.from_dynamic!(x) }, | |
| 4618 | + selection_not: SelectionOperand.from_dynamic!(d.fetch("not")), | |
| 4619 | + selection_and: d.fetch("and").map { |x| SelectionOperand.from_dynamic!(x) }, | |
| 4620 | + selection_or: d.fetch("or").map { |x| SelectionOperand.from_dynamic!(x) }, | |
| 4621 | 4621 | ) |
| 4622 | 4622 | end |
| 4623 | 4623 | |
| @@ -4627,9 +4627,9 @@ class Selection < Dry::Struct | ||
| 4627 | 4627 | |
| 4628 | 4628 | def to_dynamic |
| 4629 | 4629 | { |
| 4630 | - "not" => selection_not&.to_dynamic, | |
| 4631 | - "and" => selection_and&.map { |x| x.to_dynamic }, | |
| 4632 | - "or" => selection_or&.map { |x| x.to_dynamic }, | |
| 4630 | + "not" => selection_not.to_dynamic, | |
| 4631 | + "and" => selection_and.map { |x| x.to_dynamic }, | |
| 4632 | + "or" => selection_or.map { |x| x.to_dynamic }, | |
| 4633 | 4633 | } |
| 4634 | 4634 | end |
| 4635 | 4635 | |
| @@ -4739,17 +4739,17 @@ class LogicalOperandPredicate < Dry::Struct | ||
| 4739 | 4739 | end |
| 4740 | 4740 | |
| 4741 | 4741 | class Predicate < Dry::Struct |
| 4742 | - attribute :predicate_not, Types.Instance(LogicalOperandPredicate).optional | |
| 4743 | - attribute :predicate_and, Types.Array(Types.Instance(LogicalOperandPredicate)).optional | |
| 4744 | - attribute :predicate_or, Types.Array(Types.Instance(LogicalOperandPredicate)).optional | |
| 4742 | + attribute :predicate_not, Types.Instance(LogicalOperandPredicate) | |
| 4743 | + attribute :predicate_and, Types.Array(Types.Instance(LogicalOperandPredicate)) | |
| 4744 | + attribute :predicate_or, Types.Array(Types.Instance(LogicalOperandPredicate)) | |
| 4745 | 4745 | |
| 4746 | 4746 | # The value that the field should be equal to. |
| 4747 | - attribute :equal, Types.Instance(Equal).optional | |
| 4747 | + attribute :equal, Types.Instance(Equal) | |
| 4748 | 4748 | |
| 4749 | 4749 | # Field to be filtered. |
| 4750 | 4750 | # |
| 4751 | 4751 | # Field to be filtered |
| 4752 | - attribute :field, Types::String.optional | |
| 4752 | + attribute :field, Types::String | |
| 4753 | 4753 | |
| 4754 | 4754 | # Time unit for the field to be filtered. |
| 4755 | 4755 | # |
| @@ -4758,27 +4758,27 @@ class Predicate < Dry::Struct | ||
| 4758 | 4758 | |
| 4759 | 4759 | # An array of inclusive minimum and maximum values |
| 4760 | 4760 | # for a field value of a data item to be included in the filtered data. |
| 4761 | - attribute :range, Types.Array(Types.Instance(RangeElement)).optional | |
| 4761 | + attribute :range, Types.Array(Types.Instance(RangeElement)) | |
| 4762 | 4762 | |
| 4763 | 4763 | # A set of values that the `field`'s value should be a member of, |
| 4764 | 4764 | # for a data item included in the filtered data. |
| 4765 | - attribute :one_of, Types.Array(Types.Instance(Equal)).optional | |
| 4765 | + attribute :one_of, Types.Array(Types.Instance(Equal)) | |
| 4766 | 4766 | |
| 4767 | 4767 | # Filter using a selection name. |
| 4768 | - attribute :selection, Types.Instance(SelectionOperand).optional | |
| 4768 | + attribute :selection, Types.Instance(SelectionOperand) | |
| 4769 | 4769 | |
| 4770 | 4770 | def self.from_dynamic!(d) |
| 4771 | 4771 | d = Types::Hash[d] |
| 4772 | 4772 | new( |
| 4773 | - predicate_not: d["not"] ? LogicalOperandPredicate.from_dynamic!(d["not"]) : nil, | |
| 4774 | - predicate_and: d["and"]&.map { |x| LogicalOperandPredicate.from_dynamic!(x) }, | |
| 4775 | - predicate_or: d["or"]&.map { |x| LogicalOperandPredicate.from_dynamic!(x) }, | |
| 4776 | - equal: d["equal"] ? Equal.from_dynamic!(d["equal"]) : nil, | |
| 4777 | - field: d["field"], | |
| 4773 | + predicate_not: LogicalOperandPredicate.from_dynamic!(d.fetch("not")), | |
| 4774 | + predicate_and: d.fetch("and").map { |x| LogicalOperandPredicate.from_dynamic!(x) }, | |
| 4775 | + predicate_or: d.fetch("or").map { |x| LogicalOperandPredicate.from_dynamic!(x) }, | |
| 4776 | + equal: Equal.from_dynamic!(d.fetch("equal")), | |
| 4777 | + field: d.fetch("field"), | |
| 4778 | 4778 | time_unit: d["timeUnit"], |
| 4779 | - range: d["range"]&.map { |x| RangeElement.from_dynamic!(x) }, | |
| 4780 | - one_of: d["oneOf"]&.map { |x| Equal.from_dynamic!(x) }, | |
| 4781 | - selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil, | |
| 4779 | + range: d.fetch("range").map { |x| RangeElement.from_dynamic!(x) }, | |
| 4780 | + one_of: d.fetch("oneOf").map { |x| Equal.from_dynamic!(x) }, | |
| 4781 | + selection: SelectionOperand.from_dynamic!(d.fetch("selection")), | |
| 4782 | 4782 | ) |
| 4783 | 4783 | end |
| 4784 | 4784 | |
| @@ -4788,15 +4788,15 @@ class Predicate < Dry::Struct | ||
| 4788 | 4788 | |
| 4789 | 4789 | def to_dynamic |
| 4790 | 4790 | { |
| 4791 | - "not" => predicate_not&.to_dynamic, | |
| 4792 | - "and" => predicate_and&.map { |x| x.to_dynamic }, | |
| 4793 | - "or" => predicate_or&.map { |x| x.to_dynamic }, | |
| 4794 | - "equal" => equal&.to_dynamic, | |
| 4791 | + "not" => predicate_not.to_dynamic, | |
| 4792 | + "and" => predicate_and.map { |x| x.to_dynamic }, | |
| 4793 | + "or" => predicate_or.map { |x| x.to_dynamic }, | |
| 4794 | + "equal" => equal.to_dynamic, | |
| 4795 | 4795 | "field" => field, |
| 4796 | 4796 | "timeUnit" => time_unit, |
| 4797 | - "range" => range&.map { |x| x.to_dynamic }, | |
| 4798 | - "oneOf" => one_of&.map { |x| x.to_dynamic }, | |
| 4799 | - "selection" => selection&.to_dynamic, | |
| 4797 | + "range" => range.map { |x| x.to_dynamic }, | |
| 4798 | + "oneOf" => one_of.map { |x| x.to_dynamic }, | |
| 4799 | + "selection" => selection.to_dynamic, | |
| 4800 | 4800 | } |
| 4801 | 4801 | end |
| 4802 | 4802 | |
| @@ -4847,7 +4847,7 @@ class ConditionalValueDefValue < Dry::Struct | ||
| 4847 | 4847 | end |
| 4848 | 4848 | |
| 4849 | 4849 | class ConditionalValueDef < Dry::Struct |
| 4850 | - attribute :conditional_value_def_test, Types.Instance(LogicalOperandPredicate).optional | |
| 4850 | + attribute :conditional_value_def_test, Types.Instance(LogicalOperandPredicate) | |
| 4851 | 4851 | |
| 4852 | 4852 | # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4853 | 4853 | # `0` to `1` for opacity). |
| @@ -4855,14 +4855,14 @@ class ConditionalValueDef < Dry::Struct | ||
| 4855 | 4855 | |
| 4856 | 4856 | # A [selection name](selection.html), or a series of [composed |
| 4857 | 4857 | # selections](selection.html#compose). |
| 4858 | - attribute :selection, Types.Instance(SelectionOperand).optional | |
| 4858 | + attribute :selection, Types.Instance(SelectionOperand) | |
| 4859 | 4859 | |
| 4860 | 4860 | def self.from_dynamic!(d) |
| 4861 | 4861 | d = Types::Hash[d] |
| 4862 | 4862 | new( |
| 4863 | - conditional_value_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil, | |
| 4863 | + conditional_value_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")), | |
| 4864 | 4864 | value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")), |
| 4865 | - selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil, | |
| 4865 | + selection: SelectionOperand.from_dynamic!(d.fetch("selection")), | |
| 4866 | 4866 | ) |
| 4867 | 4867 | end |
| 4868 | 4868 | |
| @@ -4872,9 +4872,9 @@ class ConditionalValueDef < Dry::Struct | ||
| 4872 | 4872 | |
| 4873 | 4873 | def to_dynamic |
| 4874 | 4874 | { |
| 4875 | - "test" => conditional_value_def_test&.to_dynamic, | |
| 4875 | + "test" => conditional_value_def_test.to_dynamic, | |
| 4876 | 4876 | "value" => value.to_dynamic, |
| 4877 | - "selection" => selection&.to_dynamic, | |
| 4877 | + "selection" => selection.to_dynamic, | |
| 4878 | 4878 | } |
| 4879 | 4879 | end |
| 4880 | 4880 | |
| @@ -5917,15 +5917,15 @@ class SortUnion < Dry::Struct | ||
| 5917 | 5917 | end |
| 5918 | 5918 | |
| 5919 | 5919 | class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct |
| 5920 | - attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate).optional | |
| 5920 | + attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate) | |
| 5921 | 5921 | |
| 5922 | 5922 | # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5923 | 5923 | # `0` to `1` for opacity). |
| 5924 | - attribute :value, Types.Instance(ConditionalValueDefValue).optional | |
| 5924 | + attribute :value, Types.Instance(ConditionalValueDefValue) | |
| 5925 | 5925 | |
| 5926 | 5926 | # A [selection name](selection.html), or a series of [composed |
| 5927 | 5927 | # selections](selection.html#compose). |
| 5928 | - attribute :selection, Types.Instance(SelectionOperand).optional | |
| 5928 | + attribute :selection, Types.Instance(SelectionOperand) | |
| 5929 | 5929 | |
| 5930 | 5930 | # Aggregation function for the field |
| 5931 | 5931 | # (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -5983,14 +5983,14 @@ class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct | ||
| 5983 | 5983 | # `"nominal"`). |
| 5984 | 5984 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5985 | 5985 | # [geographic projection](projection.html) is applied. |
| 5986 | - attribute :conditional_def_type, Types::Type.optional | |
| 5986 | + attribute :conditional_def_type, Types::Type | |
| 5987 | 5987 | |
| 5988 | 5988 | def self.from_dynamic!(d) |
| 5989 | 5989 | d = Types::Hash[d] |
| 5990 | 5990 | new( |
| 5991 | - conditional_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil, | |
| 5992 | - value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, | |
| 5993 | - selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil, | |
| 5991 | + conditional_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")), | |
| 5992 | + value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")), | |
| 5993 | + selection: SelectionOperand.from_dynamic!(d.fetch("selection")), | |
| 5994 | 5994 | aggregate: d["aggregate"], |
| 5995 | 5995 | bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil, |
| 5996 | 5996 | field: d["field"] ? Field.from_dynamic!(d["field"]) : nil, |
| @@ -5998,7 +5998,7 @@ class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct | ||
| 5998 | 5998 | scale: d["scale"] ? Scale.from_dynamic!(d["scale"]) : nil, |
| 5999 | 5999 | sort: d["sort"] ? SortUnion.from_dynamic!(d["sort"]) : nil, |
| 6000 | 6000 | time_unit: d["timeUnit"], |
| 6001 | - conditional_def_type: d["type"], | |
| 6001 | + conditional_def_type: d.fetch("type"), | |
| 6002 | 6002 | ) |
| 6003 | 6003 | end |
| 6004 | 6004 | |
| @@ -6008,9 +6008,9 @@ class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct | ||
| 6008 | 6008 | |
| 6009 | 6009 | def to_dynamic |
| 6010 | 6010 | { |
| 6011 | - "test" => conditional_def_test&.to_dynamic, | |
| 6012 | - "value" => value&.to_dynamic, | |
| 6013 | - "selection" => selection&.to_dynamic, | |
| 6011 | + "test" => conditional_def_test.to_dynamic, | |
| 6012 | + "value" => value.to_dynamic, | |
| 6013 | + "selection" => selection.to_dynamic, | |
| 6014 | 6014 | "aggregate" => aggregate, |
| 6015 | 6015 | "bin" => bin&.to_dynamic, |
| 6016 | 6016 | "field" => field&.to_dynamic, |
| @@ -6174,7 +6174,7 @@ class MarkPropDefWithCondition < Dry::Struct | ||
| 6174 | 6174 | # `"nominal"`). |
| 6175 | 6175 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6176 | 6176 | # [geographic projection](projection.html) is applied. |
| 6177 | - attribute :mark_prop_def_with_condition_type, Types::Type.optional | |
| 6177 | + attribute :mark_prop_def_with_condition_type, Types::Type | |
| 6178 | 6178 | |
| 6179 | 6179 | # A constant value in visual domain. |
| 6180 | 6180 | attribute :value, Types.Instance(ConditionalValueDefValue).optional |
| @@ -6190,7 +6190,7 @@ class MarkPropDefWithCondition < Dry::Struct | ||
| 6190 | 6190 | scale: d["scale"] ? Scale.from_dynamic!(d["scale"]) : nil, |
| 6191 | 6191 | sort: d["sort"] ? SortUnion.from_dynamic!(d["sort"]) : nil, |
| 6192 | 6192 | time_unit: d["timeUnit"], |
| 6193 | - mark_prop_def_with_condition_type: d["type"], | |
| 6193 | + mark_prop_def_with_condition_type: d.fetch("type"), | |
| 6194 | 6194 | value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, |
| 6195 | 6195 | ) |
| 6196 | 6196 | end |
| @@ -6473,15 +6473,15 @@ class Detail < Dry::Struct | ||
| 6473 | 6473 | end |
| 6474 | 6474 | |
| 6475 | 6475 | class ConditionalPredicateFieldDefClass < Dry::Struct |
| 6476 | - attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate).optional | |
| 6476 | + attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate) | |
| 6477 | 6477 | |
| 6478 | 6478 | # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6479 | 6479 | # `0` to `1` for opacity). |
| 6480 | - attribute :value, Types.Instance(ConditionalValueDefValue).optional | |
| 6480 | + attribute :value, Types.Instance(ConditionalValueDefValue) | |
| 6481 | 6481 | |
| 6482 | 6482 | # A [selection name](selection.html), or a series of [composed |
| 6483 | 6483 | # selections](selection.html#compose). |
| 6484 | - attribute :selection, Types.Instance(SelectionOperand).optional | |
| 6484 | + attribute :selection, Types.Instance(SelectionOperand) | |
| 6485 | 6485 | |
| 6486 | 6486 | # Aggregation function for the field |
| 6487 | 6487 | # (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -6518,19 +6518,19 @@ class ConditionalPredicateFieldDefClass < Dry::Struct | ||
| 6518 | 6518 | # `"nominal"`). |
| 6519 | 6519 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6520 | 6520 | # [geographic projection](projection.html) is applied. |
| 6521 | - attribute :conditional_def_type, Types::Type.optional | |
| 6521 | + attribute :conditional_def_type, Types::Type | |
| 6522 | 6522 | |
| 6523 | 6523 | def self.from_dynamic!(d) |
| 6524 | 6524 | d = Types::Hash[d] |
| 6525 | 6525 | new( |
| 6526 | - conditional_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil, | |
| 6527 | - value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, | |
| 6528 | - selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil, | |
| 6526 | + conditional_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")), | |
| 6527 | + value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")), | |
| 6528 | + selection: SelectionOperand.from_dynamic!(d.fetch("selection")), | |
| 6529 | 6529 | aggregate: d["aggregate"], |
| 6530 | 6530 | bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil, |
| 6531 | 6531 | field: d["field"] ? Field.from_dynamic!(d["field"]) : nil, |
| 6532 | 6532 | time_unit: d["timeUnit"], |
| 6533 | - conditional_def_type: d["type"], | |
| 6533 | + conditional_def_type: d.fetch("type"), | |
| 6534 | 6534 | ) |
| 6535 | 6535 | end |
| 6536 | 6536 | |
| @@ -6540,9 +6540,9 @@ class ConditionalPredicateFieldDefClass < Dry::Struct | ||
| 6540 | 6540 | |
| 6541 | 6541 | def to_dynamic |
| 6542 | 6542 | { |
| 6543 | - "test" => conditional_def_test&.to_dynamic, | |
| 6544 | - "value" => value&.to_dynamic, | |
| 6545 | - "selection" => selection&.to_dynamic, | |
| 6543 | + "test" => conditional_def_test.to_dynamic, | |
| 6544 | + "value" => value.to_dynamic, | |
| 6545 | + "selection" => selection.to_dynamic, | |
| 6546 | 6546 | "aggregate" => aggregate, |
| 6547 | 6547 | "bin" => bin&.to_dynamic, |
| 6548 | 6548 | "field" => field&.to_dynamic, |
| @@ -6655,7 +6655,7 @@ class DefWithCondition < Dry::Struct | ||
| 6655 | 6655 | # `"nominal"`). |
| 6656 | 6656 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6657 | 6657 | # [geographic projection](projection.html) is applied. |
| 6658 | - attribute :def_with_condition_type, Types::Type.optional | |
| 6658 | + attribute :def_with_condition_type, Types::Type | |
| 6659 | 6659 | |
| 6660 | 6660 | # A constant value in visual domain. |
| 6661 | 6661 | attribute :value, Types.Instance(ConditionalValueDefValue).optional |
| @@ -6668,7 +6668,7 @@ class DefWithCondition < Dry::Struct | ||
| 6668 | 6668 | condition: d["condition"] ? HrefCondition.from_dynamic!(d["condition"]) : nil, |
| 6669 | 6669 | field: d["field"] ? Field.from_dynamic!(d["field"]) : nil, |
| 6670 | 6670 | time_unit: d["timeUnit"], |
| 6671 | - def_with_condition_type: d["type"], | |
| 6671 | + def_with_condition_type: d.fetch("type"), | |
| 6672 | 6672 | value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, |
| 6673 | 6673 | ) |
| 6674 | 6674 | end |
| @@ -6808,15 +6808,15 @@ class Order < Dry::Struct | ||
| 6808 | 6808 | end |
| 6809 | 6809 | |
| 6810 | 6810 | class ConditionalPredicateTextFieldDefClass < Dry::Struct |
| 6811 | - attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate).optional | |
| 6811 | + attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate) | |
| 6812 | 6812 | |
| 6813 | 6813 | # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6814 | 6814 | # `0` to `1` for opacity). |
| 6815 | - attribute :value, Types.Instance(ConditionalValueDefValue).optional | |
| 6815 | + attribute :value, Types.Instance(ConditionalValueDefValue) | |
| 6816 | 6816 | |
| 6817 | 6817 | # A [selection name](selection.html), or a series of [composed |
| 6818 | 6818 | # selections](selection.html#compose). |
| 6819 | - attribute :selection, Types.Instance(SelectionOperand).optional | |
| 6819 | + attribute :selection, Types.Instance(SelectionOperand) | |
| 6820 | 6820 | |
| 6821 | 6821 | # Aggregation function for the field |
| 6822 | 6822 | # (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -6857,20 +6857,20 @@ class ConditionalPredicateTextFieldDefClass < Dry::Struct | ||
| 6857 | 6857 | # `"nominal"`). |
| 6858 | 6858 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6859 | 6859 | # [geographic projection](projection.html) is applied. |
| 6860 | - attribute :conditional_def_type, Types::Type.optional | |
| 6860 | + attribute :conditional_def_type, Types::Type | |
| 6861 | 6861 | |
| 6862 | 6862 | def self.from_dynamic!(d) |
| 6863 | 6863 | d = Types::Hash[d] |
| 6864 | 6864 | new( |
| 6865 | - conditional_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil, | |
| 6866 | - value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, | |
| 6867 | - selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil, | |
| 6865 | + conditional_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")), | |
| 6866 | + value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")), | |
| 6867 | + selection: SelectionOperand.from_dynamic!(d.fetch("selection")), | |
| 6868 | 6868 | aggregate: d["aggregate"], |
| 6869 | 6869 | bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil, |
| 6870 | 6870 | field: d["field"] ? Field.from_dynamic!(d["field"]) : nil, |
| 6871 | 6871 | conditional_def_format: d["format"], |
| 6872 | 6872 | time_unit: d["timeUnit"], |
| 6873 | - conditional_def_type: d["type"], | |
| 6873 | + conditional_def_type: d.fetch("type"), | |
| 6874 | 6874 | ) |
| 6875 | 6875 | end |
| 6876 | 6876 | |
| @@ -6880,9 +6880,9 @@ class ConditionalPredicateTextFieldDefClass < Dry::Struct | ||
| 6880 | 6880 | |
| 6881 | 6881 | def to_dynamic |
| 6882 | 6882 | { |
| 6883 | - "test" => conditional_def_test&.to_dynamic, | |
| 6884 | - "value" => value&.to_dynamic, | |
| 6885 | - "selection" => selection&.to_dynamic, | |
| 6883 | + "test" => conditional_def_test.to_dynamic, | |
| 6884 | + "value" => value.to_dynamic, | |
| 6885 | + "selection" => selection.to_dynamic, | |
| 6886 | 6886 | "aggregate" => aggregate, |
| 6887 | 6887 | "bin" => bin&.to_dynamic, |
| 6888 | 6888 | "field" => field&.to_dynamic, |
| @@ -7002,7 +7002,7 @@ class TextDefWithCondition < Dry::Struct | ||
| 7002 | 7002 | # `"nominal"`). |
| 7003 | 7003 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 7004 | 7004 | # [geographic projection](projection.html) is applied. |
| 7005 | - attribute :text_def_with_condition_type, Types::Type.optional | |
| 7005 | + attribute :text_def_with_condition_type, Types::Type | |
| 7006 | 7006 | |
| 7007 | 7007 | # A constant value in visual domain. |
| 7008 | 7008 | attribute :value, Types.Instance(ConditionalValueDefValue).optional |
| @@ -7016,7 +7016,7 @@ class TextDefWithCondition < Dry::Struct | ||
| 7016 | 7016 | field: d["field"] ? Field.from_dynamic!(d["field"]) : nil, |
| 7017 | 7017 | text_def_with_condition_format: d["format"], |
| 7018 | 7018 | time_unit: d["timeUnit"], |
| 7019 | - text_def_with_condition_type: d["type"], | |
| 7019 | + text_def_with_condition_type: d.fetch("type"), | |
| 7020 | 7020 | value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, |
| 7021 | 7021 | ) |
| 7022 | 7022 | end |
| @@ -7371,11 +7371,11 @@ class XClass < Dry::Struct | ||
| 7371 | 7371 | # `"nominal"`). |
| 7372 | 7372 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 7373 | 7373 | # [geographic projection](projection.html) is applied. |
| 7374 | - attribute :def_type, Types::Type.optional | |
| 7374 | + attribute :def_type, Types::Type | |
| 7375 | 7375 | |
| 7376 | 7376 | # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 7377 | 7377 | # `0` to `1` for opacity). |
| 7378 | - attribute :value, Types.Instance(ConditionalValueDefValue).optional | |
| 7378 | + attribute :value, Types.Instance(ConditionalValueDefValue) | |
| 7379 | 7379 | |
| 7380 | 7380 | def self.from_dynamic!(d) |
| 7381 | 7381 | d = Types::Hash[d] |
| @@ -7388,8 +7388,8 @@ class XClass < Dry::Struct | ||
| 7388 | 7388 | sort: d["sort"] ? SortUnion.from_dynamic!(d["sort"]) : nil, |
| 7389 | 7389 | stack: d["stack"], |
| 7390 | 7390 | time_unit: d["timeUnit"], |
| 7391 | - def_type: d["type"], | |
| 7392 | - value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, | |
| 7391 | + def_type: d.fetch("type"), | |
| 7392 | + value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")), | |
| 7393 | 7393 | ) |
| 7394 | 7394 | end |
| 7395 | 7395 | |
| @@ -7408,7 +7408,7 @@ class XClass < Dry::Struct | ||
| 7408 | 7408 | "stack" => stack, |
| 7409 | 7409 | "timeUnit" => time_unit, |
| 7410 | 7410 | "type" => def_type, |
| 7411 | - "value" => value&.to_dynamic, | |
| 7411 | + "value" => value.to_dynamic, | |
| 7412 | 7412 | } |
| 7413 | 7413 | end |
| 7414 | 7414 | |
| @@ -7461,11 +7461,11 @@ class X2Class < Dry::Struct | ||
| 7461 | 7461 | # `"nominal"`). |
| 7462 | 7462 | # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 7463 | 7463 | # [geographic projection](projection.html) is applied. |
| 7464 | - attribute :def_type, Types::Type.optional | |
| 7464 | + attribute :def_type, Types::Type | |
| 7465 | 7465 | |
| 7466 | 7466 | # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 7467 | 7467 | # `0` to `1` for opacity). |
| 7468 | - attribute :value, Types.Instance(ConditionalValueDefValue).optional | |
| 7468 | + attribute :value, Types.Instance(ConditionalValueDefValue) | |
| 7469 | 7469 | |
| 7470 | 7470 | def self.from_dynamic!(d) |
| 7471 | 7471 | d = Types::Hash[d] |
| @@ -7474,8 +7474,8 @@ class X2Class < Dry::Struct | ||
| 7474 | 7474 | bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil, |
| 7475 | 7475 | field: d["field"] ? Field.from_dynamic!(d["field"]) : nil, |
| 7476 | 7476 | time_unit: d["timeUnit"], |
| 7477 | - def_type: d["type"], | |
| 7478 | - value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil, | |
| 7477 | + def_type: d.fetch("type"), | |
| 7478 | + value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")), | |
| 7479 | 7479 | ) |
| 7480 | 7480 | end |
| 7481 | 7481 | |
| @@ -7490,7 +7490,7 @@ class X2Class < Dry::Struct | ||
| 7490 | 7490 | "field" => field&.to_dynamic, |
| 7491 | 7491 | "timeUnit" => time_unit, |
| 7492 | 7492 | "type" => def_type, |
| 7493 | - "value" => value&.to_dynamic, | |
| 7493 | + "value" => value.to_dynamic, | |
| 7494 | 7494 | } |
| 7495 | 7495 | end |
| 7496 | 7496 | |
| @@ -8744,7 +8744,7 @@ class Transform < Dry::Struct | ||
| 8744 | 8744 | # predicate](filter.html#one-of-predicate); |
| 8745 | 8745 | # (3) a [selection predicate](filter.html#selection-predicate); |
| 8746 | 8746 | # or (4) a logical operand that combines (1), (2), or (3). |
| 8747 | - attribute :filter, Types.Instance(LogicalOperandPredicate).optional | |
| 8747 | + attribute :filter, Types.Instance(LogicalOperandPredicate) | |
| 8748 | 8748 | |
| 8749 | 8749 | # The field for storing the computed formula value. |
| 8750 | 8750 | # |
| @@ -8760,7 +8760,7 @@ class Transform < Dry::Struct | ||
| 8760 | 8760 | |
| 8761 | 8761 | # A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 8762 | 8762 | # current data object. |
| 8763 | - attribute :calculate, Types::String.optional | |
| 8763 | + attribute :calculate, Types::String | |
| 8764 | 8764 | |
| 8765 | 8765 | # The default value to use if lookup fails. |
| 8766 | 8766 | # |
| @@ -8768,24 +8768,24 @@ class Transform < Dry::Struct | ||
| 8768 | 8768 | attribute :transform_default, Types::String.optional |
| 8769 | 8769 | |
| 8770 | 8770 | # Secondary data reference. |
| 8771 | - attribute :from, LookupData.optional | |
| 8771 | + attribute :from, LookupData | |
| 8772 | 8772 | |
| 8773 | 8773 | # Key in primary data source. |
| 8774 | - attribute :lookup, Types::String.optional | |
| 8774 | + attribute :lookup, Types::String | |
| 8775 | 8775 | |
| 8776 | 8776 | # An object indicating bin properties, or simply `true` for using default bin parameters. |
| 8777 | - attribute :bin, Types.Instance(Bin).optional | |
| 8777 | + attribute :bin, Types.Instance(Bin) | |
| 8778 | 8778 | |
| 8779 | 8779 | # The data field to bin. |
| 8780 | 8780 | # |
| 8781 | 8781 | # The data field to apply time unit. |
| 8782 | - attribute :field, Types::String.optional | |
| 8782 | + attribute :field, Types::String | |
| 8783 | 8783 | |
| 8784 | 8784 | # The timeUnit. |
| 8785 | - attribute :time_unit, Types::TimeUnit.optional | |
| 8785 | + attribute :time_unit, Types::TimeUnit | |
| 8786 | 8786 | |
| 8787 | 8787 | # Array of objects that define fields to aggregate. |
| 8788 | - attribute :aggregate, Types.Array(AggregatedFieldDef).optional | |
| 8788 | + attribute :aggregate, Types.Array(AggregatedFieldDef) | |
| 8789 | 8789 | |
| 8790 | 8790 | # The data fields to group by. If not specified, a single group containing all data objects |
| 8791 | 8791 | # will be used. |
| @@ -8794,16 +8794,16 @@ class Transform < Dry::Struct | ||
| 8794 | 8794 | def self.from_dynamic!(d) |
| 8795 | 8795 | d = Types::Hash[d] |
| 8796 | 8796 | new( |
| 8797 | - filter: d["filter"] ? LogicalOperandPredicate.from_dynamic!(d["filter"]) : nil, | |
| 8797 | + filter: LogicalOperandPredicate.from_dynamic!(d.fetch("filter")), | |
| 8798 | 8798 | as: d["as"] ? Style.from_dynamic!(d["as"]) : nil, |
| 8799 | - calculate: d["calculate"], | |
| 8799 | + calculate: d.fetch("calculate"), | |
| 8800 | 8800 | transform_default: d["default"], |
| 8801 | - from: d["from"] ? LookupData.from_dynamic!(d["from"]) : nil, | |
| 8802 | - lookup: d["lookup"], | |
| 8803 | - bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil, | |
| 8804 | - field: d["field"], | |
| 8805 | - time_unit: d["timeUnit"], | |
| 8806 | - aggregate: d["aggregate"]&.map { |x| AggregatedFieldDef.from_dynamic!(x) }, | |
| 8801 | + from: LookupData.from_dynamic!(d.fetch("from")), | |
| 8802 | + lookup: d.fetch("lookup"), | |
| 8803 | + bin: Bin.from_dynamic!(d.fetch("bin")), | |
| 8804 | + field: d.fetch("field"), | |
| 8805 | + time_unit: d.fetch("timeUnit"), | |
| 8806 | + aggregate: d.fetch("aggregate").map { |x| AggregatedFieldDef.from_dynamic!(x) }, | |
| 8807 | 8807 | groupby: d["groupby"], |
| 8808 | 8808 | ) |
| 8809 | 8809 | end |
| @@ -8814,16 +8814,16 @@ class Transform < Dry::Struct | ||
| 8814 | 8814 | |
| 8815 | 8815 | def to_dynamic |
| 8816 | 8816 | { |
| 8817 | - "filter" => filter&.to_dynamic, | |
| 8817 | + "filter" => filter.to_dynamic, | |
| 8818 | 8818 | "as" => as&.to_dynamic, |
| 8819 | 8819 | "calculate" => calculate, |
| 8820 | 8820 | "default" => transform_default, |
| 8821 | - "from" => from&.to_dynamic, | |
| 8821 | + "from" => from.to_dynamic, | |
| 8822 | 8822 | "lookup" => lookup, |
| 8823 | - "bin" => bin&.to_dynamic, | |
| 8823 | + "bin" => bin.to_dynamic, | |
| 8824 | 8824 | "field" => field, |
| 8825 | 8825 | "timeUnit" => time_unit, |
| 8826 | - "aggregate" => aggregate&.map { |x| x.to_dynamic }, | |
| 8826 | + "aggregate" => aggregate.map { |x| x.to_dynamic }, | |
| 8827 | 8827 | "groupby" => groupby, |
| 8828 | 8828 | } |
| 8829 | 8829 | end |
| @@ -8865,7 +8865,7 @@ class LayerSpec < Dry::Struct | ||
| 8865 | 8865 | # |
| 8866 | 8866 | # __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 8867 | 8867 | # layering facet specifications is not allowed. |
| 8868 | - attribute :layer, Types.Array(LayerSpec).optional | |
| 8868 | + attribute :layer, Types.Array(LayerSpec) | |
| 8869 | 8869 | |
| 8870 | 8870 | # Name of the visualization for later reference. |
| 8871 | 8871 | attribute :layer_spec_name, Types::String.optional |
| @@ -8902,13 +8902,13 @@ class LayerSpec < Dry::Struct | ||
| 8902 | 8902 | attribute :width, Types::Double.optional |
| 8903 | 8903 | |
| 8904 | 8904 | # A key-value mapping between encoding channels and definition of fields. |
| 8905 | - attribute :encoding, EncodingClass.optional | |
| 8905 | + attribute :encoding, EncodingClass | |
| 8906 | 8906 | |
| 8907 | 8907 | # A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 8908 | 8908 | # `"line"`, |
| 8909 | 8909 | # * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 8910 | 8910 | # object](mark.html#mark-def). |
| 8911 | - attribute :mark, Types.Instance(AnyMark).optional | |
| 8911 | + attribute :mark, Types.Instance(AnyMark) | |
| 8912 | 8912 | |
| 8913 | 8913 | # An object defining properties of geographic projection. |
| 8914 | 8914 | # |
| @@ -8925,14 +8925,14 @@ class LayerSpec < Dry::Struct | ||
| 8925 | 8925 | data: d["data"] ? DataClass.from_dynamic!(d["data"]) : nil, |
| 8926 | 8926 | description: d["description"], |
| 8927 | 8927 | height: d["height"], |
| 8928 | - layer: d["layer"]&.map { |x| LayerSpec.from_dynamic!(x) }, | |
| 8928 | + layer: d.fetch("layer").map { |x| LayerSpec.from_dynamic!(x) }, | |
| 8929 | 8929 | layer_spec_name: d["name"], |
| 8930 | 8930 | resolve: d["resolve"] ? Resolve.from_dynamic!(d["resolve"]) : nil, |
| 8931 | 8931 | title: d["title"] ? Title.from_dynamic!(d["title"]) : nil, |
| 8932 | 8932 | transform: d["transform"]&.map { |x| Transform.from_dynamic!(x) }, |
| 8933 | 8933 | width: d["width"], |
| 8934 | - encoding: d["encoding"] ? EncodingClass.from_dynamic!(d["encoding"]) : nil, | |
| 8935 | - mark: d["mark"] ? AnyMark.from_dynamic!(d["mark"]) : nil, | |
| 8934 | + encoding: EncodingClass.from_dynamic!(d.fetch("encoding")), | |
| 8935 | + mark: AnyMark.from_dynamic!(d.fetch("mark")), | |
| 8936 | 8936 | projection: d["projection"] ? Projection.from_dynamic!(d["projection"]) : nil, |
| 8937 | 8937 | selection: Types::Hash.optional[d["selection"]]&.map { |k, v| [k, SelectionDef.from_dynamic!(v)] }&.to_h, |
| 8938 | 8938 | ) |
| @@ -8947,14 +8947,14 @@ class LayerSpec < Dry::Struct | ||
| 8947 | 8947 | "data" => data&.to_dynamic, |
| 8948 | 8948 | "description" => description, |
| 8949 | 8949 | "height" => height, |
| 8950 | - "layer" => layer&.map { |x| x.to_dynamic }, | |
| 8950 | + "layer" => layer.map { |x| x.to_dynamic }, | |
| 8951 | 8951 | "name" => layer_spec_name, |
| 8952 | 8952 | "resolve" => resolve&.to_dynamic, |
| 8953 | 8953 | "title" => title&.to_dynamic, |
| 8954 | 8954 | "transform" => transform&.map { |x| x.to_dynamic }, |
| 8955 | 8955 | "width" => width, |
| 8956 | - "encoding" => encoding&.to_dynamic, | |
| 8957 | - "mark" => mark&.to_dynamic, | |
| 8956 | + "encoding" => encoding.to_dynamic, | |
| 8957 | + "mark" => mark.to_dynamic, | |
| 8958 | 8958 | "projection" => projection&.to_dynamic, |
| 8959 | 8959 | "selection" => selection&.map { |k, v| [k, v.to_dynamic] }.to_h, |
| 8960 | 8960 | } |
| @@ -9031,7 +9031,7 @@ class Spec < Dry::Struct | ||
| 9031 | 9031 | # |
| 9032 | 9032 | # __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 9033 | 9033 | # layering facet specifications is not allowed. |
| 9034 | - attribute :layer, Types.Array(LayerSpec).optional | |
| 9034 | + attribute :layer, Types.Array(LayerSpec) | |
| 9035 | 9035 | |
| 9036 | 9036 | # Name of the visualization for later reference. |
| 9037 | 9037 | attribute :spec_name, Types::String.optional |
| @@ -9076,13 +9076,13 @@ class Spec < Dry::Struct | ||
| 9076 | 9076 | attribute :width, Types::Double.optional |
| 9077 | 9077 | |
| 9078 | 9078 | # A key-value mapping between encoding channels and definition of fields. |
| 9079 | - attribute :encoding, EncodingClass.optional | |
| 9079 | + attribute :encoding, EncodingClass | |
| 9080 | 9080 | |
| 9081 | 9081 | # A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 9082 | 9082 | # `"line"`, |
| 9083 | 9083 | # * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 9084 | 9084 | # object](mark.html#mark-def). |
| 9085 | - attribute :mark, Types.Instance(AnyMark).optional | |
| 9085 | + attribute :mark, Types.Instance(AnyMark) | |
| 9086 | 9086 | |
| 9087 | 9087 | # An object defining properties of geographic projection. |
| 9088 | 9088 | # |
| @@ -9095,20 +9095,20 @@ class Spec < Dry::Struct | ||
| 9095 | 9095 | |
| 9096 | 9096 | # An object that describes mappings between `row` and `column` channels and their field |
| 9097 | 9097 | # definitions. |
| 9098 | - attribute :facet, FacetMapping.optional | |
| 9098 | + attribute :facet, FacetMapping | |
| 9099 | 9099 | |
| 9100 | 9100 | # A specification of the view that gets faceted. |
| 9101 | - attribute :spec, Spec.optional | |
| 9101 | + attribute :spec, Spec | |
| 9102 | 9102 | |
| 9103 | 9103 | # An object that describes what fields should be repeated into views that are laid out as a |
| 9104 | 9104 | # `row` or `column`. |
| 9105 | - attribute :repeat, Repeat.optional | |
| 9105 | + attribute :repeat, Repeat | |
| 9106 | 9106 | |
| 9107 | 9107 | # A list of views that should be concatenated and put into a column. |
| 9108 | - attribute :vconcat, Types.Array(Spec).optional | |
| 9108 | + attribute :vconcat, Types.Array(Spec) | |
| 9109 | 9109 | |
| 9110 | 9110 | # A list of views that should be concatenated and put into a row. |
| 9111 | - attribute :hconcat, Types.Array(Spec).optional | |
| 9111 | + attribute :hconcat, Types.Array(Spec) | |
| 9112 | 9112 | |
| 9113 | 9113 | def self.from_dynamic!(d) |
| 9114 | 9114 | d = Types::Hash[d] |
| @@ -9116,21 +9116,21 @@ class Spec < Dry::Struct | ||
| 9116 | 9116 | data: d["data"] ? DataClass.from_dynamic!(d["data"]) : nil, |
| 9117 | 9117 | description: d["description"], |
| 9118 | 9118 | height: d["height"], |
| 9119 | - layer: d["layer"]&.map { |x| LayerSpec.from_dynamic!(x) }, | |
| 9119 | + layer: d.fetch("layer").map { |x| LayerSpec.from_dynamic!(x) }, | |
| 9120 | 9120 | spec_name: d["name"], |
| 9121 | 9121 | resolve: d["resolve"] ? Resolve.from_dynamic!(d["resolve"]) : nil, |
| 9122 | 9122 | title: d["title"] ? Title.from_dynamic!(d["title"]) : nil, |
| 9123 | 9123 | transform: d["transform"]&.map { |x| Transform.from_dynamic!(x) }, |
| 9124 | 9124 | width: d["width"], |
| 9125 | - encoding: d["encoding"] ? EncodingClass.from_dynamic!(d["encoding"]) : nil, | |
| 9126 | - mark: d["mark"] ? AnyMark.from_dynamic!(d["mark"]) : nil, | |
| 9125 | + encoding: EncodingClass.from_dynamic!(d.fetch("encoding")), | |
| 9126 | + mark: AnyMark.from_dynamic!(d.fetch("mark")), | |
| 9127 | 9127 | projection: d["projection"] ? Projection.from_dynamic!(d["projection"]) : nil, |
| 9128 | 9128 | selection: Types::Hash.optional[d["selection"]]&.map { |k, v| [k, SelectionDef.from_dynamic!(v)] }&.to_h, |
| 9129 | - facet: d["facet"] ? FacetMapping.from_dynamic!(d["facet"]) : nil, | |
| 9130 | - spec: d["spec"] ? Spec.from_dynamic!(d["spec"]) : nil, | |
| 9131 | - repeat: d["repeat"] ? Repeat.from_dynamic!(d["repeat"]) : nil, | |
| 9132 | - vconcat: d["vconcat"]&.map { |x| Spec.from_dynamic!(x) }, | |
| 9133 | - hconcat: d["hconcat"]&.map { |x| Spec.from_dynamic!(x) }, | |
| 9129 | + facet: FacetMapping.from_dynamic!(d.fetch("facet")), | |
| 9130 | + spec: Spec.from_dynamic!(d.fetch("spec")), | |
| 9131 | + repeat: Repeat.from_dynamic!(d.fetch("repeat")), | |
| 9132 | + vconcat: d.fetch("vconcat").map { |x| Spec.from_dynamic!(x) }, | |
| 9133 | + hconcat: d.fetch("hconcat").map { |x| Spec.from_dynamic!(x) }, | |
| 9134 | 9134 | ) |
| 9135 | 9135 | end |
| 9136 | 9136 | |
| @@ -9143,21 +9143,21 @@ class Spec < Dry::Struct | ||
| 9143 | 9143 | "data" => data&.to_dynamic, |
| 9144 | 9144 | "description" => description, |
| 9145 | 9145 | "height" => height, |
| 9146 | - "layer" => layer&.map { |x| x.to_dynamic }, | |
| 9146 | + "layer" => layer.map { |x| x.to_dynamic }, | |
| 9147 | 9147 | "name" => spec_name, |
| 9148 | 9148 | "resolve" => resolve&.to_dynamic, |
| 9149 | 9149 | "title" => title&.to_dynamic, |
| 9150 | 9150 | "transform" => transform&.map { |x| x.to_dynamic }, |
| 9151 | 9151 | "width" => width, |
| 9152 | - "encoding" => encoding&.to_dynamic, | |
| 9153 | - "mark" => mark&.to_dynamic, | |
| 9152 | + "encoding" => encoding.to_dynamic, | |
| 9153 | + "mark" => mark.to_dynamic, | |
| 9154 | 9154 | "projection" => projection&.to_dynamic, |
| 9155 | 9155 | "selection" => selection&.map { |k, v| [k, v.to_dynamic] }.to_h, |
| 9156 | - "facet" => facet&.to_dynamic, | |
| 9157 | - "spec" => spec&.to_dynamic, | |
| 9158 | - "repeat" => repeat&.to_dynamic, | |
| 9159 | - "vconcat" => vconcat&.map { |x| x.to_dynamic }, | |
| 9160 | - "hconcat" => hconcat&.map { |x| x.to_dynamic }, | |
| 9156 | + "facet" => facet.to_dynamic, | |
| 9157 | + "spec" => spec.to_dynamic, | |
| 9158 | + "repeat" => repeat.to_dynamic, | |
| 9159 | + "vconcat" => vconcat.map { |x| x.to_dynamic }, | |
| 9160 | + "hconcat" => hconcat.map { |x| x.to_dynamic }, | |
| 9161 | 9161 | } |
| 9162 | 9162 | end |
| 9163 | 9163 | |
| @@ -9199,7 +9199,7 @@ class TopLevel < Dry::Struct | ||
| 9199 | 9199 | attribute :description, Types::String.optional |
| 9200 | 9200 | |
| 9201 | 9201 | # A key-value mapping between encoding channels and definition of fields. |
| 9202 | - attribute :encoding, EncodingWithFacet.optional | |
| 9202 | + attribute :encoding, EncodingWithFacet | |
| 9203 | 9203 | |
| 9204 | 9204 | # The height of a visualization. |
| 9205 | 9205 | # |
| @@ -9224,7 +9224,7 @@ class TopLevel < Dry::Struct | ||
| 9224 | 9224 | # `"line"`, |
| 9225 | 9225 | # * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 9226 | 9226 | # object](mark.html#mark-def). |
| 9227 | - attribute :mark, Types.Instance(AnyMark).optional | |
| 9227 | + attribute :mark, Types.Instance(AnyMark) | |
| 9228 | 9228 | |
| 9229 | 9229 | # Name of the visualization for later reference. |
| 9230 | 9230 | attribute :top_level_name, Types::String.optional |
| @@ -9278,7 +9278,7 @@ class TopLevel < Dry::Struct | ||
| 9278 | 9278 | # |
| 9279 | 9279 | # __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 9280 | 9280 | # layering facet specifications is not allowed. |
| 9281 | - attribute :layer, Types.Array(LayerSpec).optional | |
| 9281 | + attribute :layer, Types.Array(LayerSpec) | |
| 9282 | 9282 | |
| 9283 | 9283 | # Scale, axis, and legend resolutions for layers. |
| 9284 | 9284 | # |
| @@ -9293,20 +9293,20 @@ class TopLevel < Dry::Struct | ||
| 9293 | 9293 | |
| 9294 | 9294 | # An object that describes mappings between `row` and `column` channels and their field |
| 9295 | 9295 | # definitions. |
| 9296 | - attribute :facet, FacetMapping.optional | |
| 9296 | + attribute :facet, FacetMapping | |
| 9297 | 9297 | |
| 9298 | 9298 | # A specification of the view that gets faceted. |
| 9299 | - attribute :spec, Spec.optional | |
| 9299 | + attribute :spec, Spec | |
| 9300 | 9300 | |
| 9301 | 9301 | # An object that describes what fields should be repeated into views that are laid out as a |
| 9302 | 9302 | # `row` or `column`. |
| 9303 | - attribute :repeat, Repeat.optional | |
| 9303 | + attribute :repeat, Repeat | |
| 9304 | 9304 | |
| 9305 | 9305 | # A list of views that should be concatenated and put into a column. |
| 9306 | - attribute :vconcat, Types.Array(Spec).optional | |
| 9306 | + attribute :vconcat, Types.Array(Spec) | |
| 9307 | 9307 | |
| 9308 | 9308 | # A list of views that should be concatenated and put into a row. |
| 9309 | - attribute :hconcat, Types.Array(Spec).optional | |
| 9309 | + attribute :hconcat, Types.Array(Spec) | |
| 9310 | 9310 | |
| 9311 | 9311 | def self.from_dynamic!(d) |
| 9312 | 9312 | d = Types::Hash[d] |
| @@ -9317,9 +9317,9 @@ class TopLevel < Dry::Struct | ||
| 9317 | 9317 | config: d["config"] ? Config.from_dynamic!(d["config"]) : nil, |
| 9318 | 9318 | data: d["data"] ? DataClass.from_dynamic!(d["data"]) : nil, |
| 9319 | 9319 | description: d["description"], |
| 9320 | - encoding: d["encoding"] ? EncodingWithFacet.from_dynamic!(d["encoding"]) : nil, | |
| 9320 | + encoding: EncodingWithFacet.from_dynamic!(d.fetch("encoding")), | |
| 9321 | 9321 | height: d["height"], |
| 9322 | - mark: d["mark"] ? AnyMark.from_dynamic!(d["mark"]) : nil, | |
| 9322 | + mark: AnyMark.from_dynamic!(d.fetch("mark")), | |
| 9323 | 9323 | top_level_name: d["name"], |
| 9324 | 9324 | padding: d["padding"] ? Padding.from_dynamic!(d["padding"]) : nil, |
| 9325 | 9325 | projection: d["projection"] ? Projection.from_dynamic!(d["projection"]) : nil, |
| @@ -9327,13 +9327,13 @@ class TopLevel < Dry::Struct | ||
| 9327 | 9327 | title: d["title"] ? Title.from_dynamic!(d["title"]) : nil, |
| 9328 | 9328 | transform: d["transform"]&.map { |x| Transform.from_dynamic!(x) }, |
| 9329 | 9329 | width: d["width"], |
| 9330 | - layer: d["layer"]&.map { |x| LayerSpec.from_dynamic!(x) }, | |
| 9330 | + layer: d.fetch("layer").map { |x| LayerSpec.from_dynamic!(x) }, | |
| 9331 | 9331 | resolve: d["resolve"] ? Resolve.from_dynamic!(d["resolve"]) : nil, |
| 9332 | - facet: d["facet"] ? FacetMapping.from_dynamic!(d["facet"]) : nil, | |
| 9333 | - spec: d["spec"] ? Spec.from_dynamic!(d["spec"]) : nil, | |
| 9334 | - repeat: d["repeat"] ? Repeat.from_dynamic!(d["repeat"]) : nil, | |
| 9335 | - vconcat: d["vconcat"]&.map { |x| Spec.from_dynamic!(x) }, | |
| 9336 | - hconcat: d["hconcat"]&.map { |x| Spec.from_dynamic!(x) }, | |
| 9332 | + facet: FacetMapping.from_dynamic!(d.fetch("facet")), | |
| 9333 | + spec: Spec.from_dynamic!(d.fetch("spec")), | |
| 9334 | + repeat: Repeat.from_dynamic!(d.fetch("repeat")), | |
| 9335 | + vconcat: d.fetch("vconcat").map { |x| Spec.from_dynamic!(x) }, | |
| 9336 | + hconcat: d.fetch("hconcat").map { |x| Spec.from_dynamic!(x) }, | |
| 9337 | 9337 | ) |
| 9338 | 9338 | end |
| 9339 | 9339 | |
| @@ -9349,9 +9349,9 @@ class TopLevel < Dry::Struct | ||
| 9349 | 9349 | "config" => config&.to_dynamic, |
| 9350 | 9350 | "data" => data&.to_dynamic, |
| 9351 | 9351 | "description" => description, |
| 9352 | - "encoding" => encoding&.to_dynamic, | |
| 9352 | + "encoding" => encoding.to_dynamic, | |
| 9353 | 9353 | "height" => height, |
| 9354 | - "mark" => mark&.to_dynamic, | |
| 9354 | + "mark" => mark.to_dynamic, | |
| 9355 | 9355 | "name" => top_level_name, |
| 9356 | 9356 | "padding" => padding&.to_dynamic, |
| 9357 | 9357 | "projection" => projection&.to_dynamic, |
| @@ -9359,13 +9359,13 @@ class TopLevel < Dry::Struct | ||
| 9359 | 9359 | "title" => title&.to_dynamic, |
| 9360 | 9360 | "transform" => transform&.map { |x| x.to_dynamic }, |
| 9361 | 9361 | "width" => width, |
| 9362 | - "layer" => layer&.map { |x| x.to_dynamic }, | |
| 9362 | + "layer" => layer.map { |x| x.to_dynamic }, | |
| 9363 | 9363 | "resolve" => resolve&.to_dynamic, |
| 9364 | - "facet" => facet&.to_dynamic, | |
| 9365 | - "spec" => spec&.to_dynamic, | |
| 9366 | - "repeat" => repeat&.to_dynamic, | |
| 9367 | - "vconcat" => vconcat&.map { |x| x.to_dynamic }, | |
| 9368 | - "hconcat" => hconcat&.map { |x| x.to_dynamic }, | |
| 9364 | + "facet" => facet.to_dynamic, | |
| 9365 | + "spec" => spec.to_dynamic, | |
| 9366 | + "repeat" => repeat.to_dynamic, | |
| 9367 | + "vconcat" => vconcat.map { |x| x.to_dynamic }, | |
| 9368 | + "hconcat" => hconcat.map { |x| x.to_dynamic }, | |
| 9369 | 9369 | } |
| 9370 | 9370 | end |
Mschema-rustdefault / module_under_test.rs+92 −125
| @@ -48,7 +48,7 @@ pub struct TopLevel { | ||
| 48 | 48 | pub description: Option<String>, |
| 49 | 49 | |
| 50 | 50 | /// A key-value mapping between encoding channels and definition of fields. |
| 51 | - pub encoding: Option<EncodingWithFacet>, | |
| 51 | + pub encoding: EncodingWithFacet, | |
| 52 | 52 | |
| 53 | 53 | /// The height of a visualization. |
| 54 | 54 | /// |
| @@ -73,7 +73,7 @@ pub struct TopLevel { | ||
| 73 | 73 | /// `"line"`, |
| 74 | 74 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 75 | 75 | /// object](mark.html#mark-def). |
| 76 | - pub mark: Option<AnyMark>, | |
| 76 | + pub mark: AnyMark, | |
| 77 | 77 | |
| 78 | 78 | /// Name of the visualization for later reference. |
| 79 | 79 | pub name: Option<String>, |
| @@ -127,7 +127,7 @@ pub struct TopLevel { | ||
| 127 | 127 | /// |
| 128 | 128 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 129 | 129 | /// layering facet specifications is not allowed. |
| 130 | - pub layer: Option<Vec<LayerSpec>>, | |
| 130 | + pub layer: Vec<LayerSpec>, | |
| 131 | 131 | |
| 132 | 132 | /// Scale, axis, and legend resolutions for layers. |
| 133 | 133 | /// |
| @@ -142,20 +142,20 @@ pub struct TopLevel { | ||
| 142 | 142 | |
| 143 | 143 | /// An object that describes mappings between `row` and `column` channels and their field |
| 144 | 144 | /// definitions. |
| 145 | - pub facet: Option<FacetMapping>, | |
| 145 | + pub facet: FacetMapping, | |
| 146 | 146 | |
| 147 | 147 | /// A specification of the view that gets faceted. |
| 148 | - pub spec: Box<Option<Spec>>, | |
| 148 | + pub spec: Box<Spec>, | |
| 149 | 149 | |
| 150 | 150 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 151 | 151 | /// `row` or `column`. |
| 152 | - pub repeat: Option<Repeat>, | |
| 152 | + pub repeat: Repeat, | |
| 153 | 153 | |
| 154 | 154 | /// A list of views that should be concatenated and put into a column. |
| 155 | - pub vconcat: Option<Vec<Spec>>, | |
| 155 | + pub vconcat: Vec<Spec>, | |
| 156 | 156 | |
| 157 | 157 | /// A list of views that should be concatenated and put into a row. |
| 158 | - pub hconcat: Option<Vec<Spec>>, | |
| 158 | + pub hconcat: Vec<Spec>, | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /// Sets how the visualization size should be determined. If a string, should be one of |
| @@ -1712,7 +1712,7 @@ pub struct VgScheme { | ||
| 1712 | 1712 | |
| 1713 | 1713 | pub extent: Option<Vec<f64>>, |
| 1714 | 1714 | |
| 1715 | - pub scheme: Option<String>, | |
| 1715 | + pub scheme: String, | |
| 1716 | 1716 | |
| 1717 | 1717 | pub step: Option<f64>, |
| 1718 | 1718 | } |
| @@ -2148,7 +2148,7 @@ pub struct VgBinding { | ||
| 2148 | 2148 | |
| 2149 | 2149 | pub input: String, |
| 2150 | 2150 | |
| 2151 | - pub options: Option<Vec<String>>, | |
| 2151 | + pub options: Vec<String>, | |
| 2152 | 2152 | |
| 2153 | 2153 | pub max: Option<f64>, |
| 2154 | 2154 | |
| @@ -2800,16 +2800,16 @@ pub struct Data { | ||
| 2800 | 2800 | |
| 2801 | 2801 | /// An URL from which to load the data set. Use the `format.type` property |
| 2802 | 2802 | /// to ensure the loaded data is correctly parsed. |
| 2803 | - pub url: Option<String>, | |
| 2803 | + pub url: String, | |
| 2804 | 2804 | |
| 2805 | 2805 | /// The full data set, included inline. This can be an array of objects or primitive values |
| 2806 | 2806 | /// or a string. |
| 2807 | 2807 | /// Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 2808 | 2808 | /// parsed according to the specified format type. |
| 2809 | - pub values: Option<Values>, | |
| 2809 | + pub values: Values, | |
| 2810 | 2810 | |
| 2811 | 2811 | /// Provide a placeholder name and bind data at runtime. |
| 2812 | - pub name: Option<String>, | |
| 2812 | + pub name: String, | |
| 2813 | 2813 | } |
| 2814 | 2814 | |
| 2815 | 2815 | /// An object that specifies the format for parsing the data file. |
| @@ -3050,7 +3050,7 @@ pub struct MarkPropDefWithCondition { | ||
| 3050 | 3050 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 3051 | 3051 | /// |
| 3052 | 3052 | /// __Default value:__ `false` |
| 3053 | - pub bin: Option<Bin>, | |
| 3053 | + pub bin: Option<ColorBin>, | |
| 3054 | 3054 | |
| 3055 | 3055 | /// One or more value definition(s) with a selection predicate. |
| 3056 | 3056 | /// |
| @@ -3105,10 +3105,10 @@ pub struct MarkPropDefWithCondition { | ||
| 3105 | 3105 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3106 | 3106 | /// [geographic projection](projection.html) is applied. |
| 3107 | 3107 | #[serde(rename = "type")] |
| 3108 | - pub mark_prop_def_with_condition_type: Option<Type>, | |
| 3108 | + pub mark_prop_def_with_condition_type: Type, | |
| 3109 | 3109 | |
| 3110 | 3110 | /// A constant value in visual domain. |
| 3111 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 3111 | + pub value: Option<ColorValue>, | |
| 3112 | 3112 | } |
| 3113 | 3113 | |
| 3114 | 3114 | /// Aggregation function for the field |
| @@ -3177,7 +3177,7 @@ pub enum AggregateOp { | ||
| 3177 | 3177 | |
| 3178 | 3178 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3179 | 3179 | #[serde(untagged)] |
| 3180 | -pub enum Bin { | |
| 3180 | +pub enum ColorBin { | |
| 3181 | 3181 | BinParams(BinParams), |
| 3182 | 3182 | |
| 3183 | 3183 | Bool(bool), |
| @@ -3234,7 +3234,7 @@ pub enum ColorCondition { | ||
| 3234 | 3234 | |
| 3235 | 3235 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3236 | 3236 | pub struct ConditionalValueDef { |
| 3237 | - pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>, | |
| 3237 | + pub test: Box<LogicalOperandPredicate>, | |
| 3238 | 3238 | |
| 3239 | 3239 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 3240 | 3240 | /// `0` to `1` for opacity). |
| @@ -3242,28 +3242,16 @@ pub struct ConditionalValueDef { | ||
| 3242 | 3242 | |
| 3243 | 3243 | /// A [selection name](selection.html), or a series of [composed |
| 3244 | 3244 | /// selections](selection.html#compose). |
| 3245 | - pub selection: Option<Box<ConditionalValueDefSelectionOperand>>, | |
| 3246 | -} | |
| 3247 | - | |
| 3248 | -/// Filter using a selection name. | |
| 3249 | -/// | |
| 3250 | -/// A [selection name](selection.html), or a series of [composed | |
| 3251 | -/// selections](selection.html#compose). | |
| 3252 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 3253 | -#[serde(untagged)] | |
| 3254 | -pub enum SelectionOperandElement { | |
| 3255 | - PurpleString(String), | |
| 3256 | - | |
| 3257 | - Selection(Selection), | |
| 3245 | + pub selection: Box<SelectionOperand>, | |
| 3258 | 3246 | } |
| 3259 | 3247 | |
| 3260 | 3248 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3261 | 3249 | pub struct Selection { |
| 3262 | - pub not: Option<Box<ConditionalValueDefSelectionOperand>>, | |
| 3250 | + pub not: Box<SelectionOperand>, | |
| 3263 | 3251 | |
| 3264 | - pub and: Option<Vec<SelectionOperandElement>>, | |
| 3252 | + pub and: Vec<Box<SelectionOperand>>, | |
| 3265 | 3253 | |
| 3266 | - pub or: Option<Vec<SelectionOperandElement>>, | |
| 3254 | + pub or: Vec<Box<SelectionOperand>>, | |
| 3267 | 3255 | } |
| 3268 | 3256 | |
| 3269 | 3257 | /// Filter using a selection name. |
| @@ -3272,44 +3260,28 @@ pub struct Selection { | ||
| 3272 | 3260 | /// selections](selection.html#compose). |
| 3273 | 3261 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3274 | 3262 | #[serde(untagged)] |
| 3275 | -pub enum ConditionalValueDefSelectionOperand { | |
| 3263 | +pub enum SelectionOperand { | |
| 3276 | 3264 | PurpleString(String), |
| 3277 | 3265 | |
| 3278 | 3266 | Selection(Selection), |
| 3279 | 3267 | } |
| 3280 | 3268 | |
| 3281 | -/// The `filter` property must be one of the predicate definitions: | |
| 3282 | -/// (1) an [expression](types.html#expression) string, | |
| 3283 | -/// where `datum` can be used to refer to the current data object; | |
| 3284 | -/// (2) one of the field predicates: [equal predicate](filter.html#equal-predicate); | |
| 3285 | -/// [range predicate](filter.html#range-predicate), [one-of | |
| 3286 | -/// predicate](filter.html#one-of-predicate); | |
| 3287 | -/// (3) a [selection predicate](filter.html#selection-predicate); | |
| 3288 | -/// or (4) a logical operand that combines (1), (2), or (3). | |
| 3289 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 3290 | -#[serde(untagged)] | |
| 3291 | -pub enum LogicalOperandPredicateElement { | |
| 3292 | - Predicate(Predicate), | |
| 3293 | - | |
| 3294 | - PurpleString(String), | |
| 3295 | -} | |
| 3296 | - | |
| 3297 | 3269 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3298 | 3270 | #[serde(rename_all = "camelCase")] |
| 3299 | 3271 | pub struct Predicate { |
| 3300 | - pub not: Option<Box<ConditionalValueDefLogicalOperandPredicate>>, | |
| 3272 | + pub not: Box<LogicalOperandPredicate>, | |
| 3301 | 3273 | |
| 3302 | - pub and: Option<Vec<LogicalOperandPredicateElement>>, | |
| 3274 | + pub and: Vec<Box<LogicalOperandPredicate>>, | |
| 3303 | 3275 | |
| 3304 | - pub or: Option<Vec<LogicalOperandPredicateElement>>, | |
| 3276 | + pub or: Vec<Box<LogicalOperandPredicate>>, | |
| 3305 | 3277 | |
| 3306 | 3278 | /// The value that the field should be equal to. |
| 3307 | - pub equal: Option<EqualUnion>, | |
| 3279 | + pub equal: Equal, | |
| 3308 | 3280 | |
| 3309 | 3281 | /// Field to be filtered. |
| 3310 | 3282 | /// |
| 3311 | 3283 | /// Field to be filtered |
| 3312 | - pub field: Option<String>, | |
| 3284 | + pub field: String, | |
| 3313 | 3285 | |
| 3314 | 3286 | /// Time unit for the field to be filtered. |
| 3315 | 3287 | /// |
| @@ -3318,14 +3290,14 @@ pub struct Predicate { | ||
| 3318 | 3290 | |
| 3319 | 3291 | /// An array of inclusive minimum and maximum values |
| 3320 | 3292 | /// for a field value of a data item to be included in the filtered data. |
| 3321 | - pub range: Option<Vec<Option<RangeElement>>>, | |
| 3293 | + pub range: Vec<Option<RangeElement>>, | |
| 3322 | 3294 | |
| 3323 | 3295 | /// A set of values that the `field`'s value should be a member of, |
| 3324 | 3296 | /// for a data item included in the filtered data. |
| 3325 | - pub one_of: Option<Vec<OneOfElement>>, | |
| 3297 | + pub one_of: Vec<Equal>, | |
| 3326 | 3298 | |
| 3327 | 3299 | /// Filter using a selection name. |
| 3328 | - pub selection: Option<Box<ConditionalValueDefSelectionOperand>>, | |
| 3300 | + pub selection: Box<SelectionOperand>, | |
| 3329 | 3301 | } |
| 3330 | 3302 | |
| 3331 | 3303 | /// The `filter` property must be one of the predicate definitions: |
| @@ -3338,7 +3310,7 @@ pub struct Predicate { | ||
| 3338 | 3310 | /// or (4) a logical operand that combines (1), (2), or (3). |
| 3339 | 3311 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3340 | 3312 | #[serde(untagged)] |
| 3341 | -pub enum ConditionalValueDefLogicalOperandPredicate { | |
| 3313 | +pub enum LogicalOperandPredicate { | |
| 3342 | 3314 | Predicate(Predicate), |
| 3343 | 3315 | |
| 3344 | 3316 | PurpleString(String), |
| @@ -3347,7 +3319,7 @@ pub enum ConditionalValueDefLogicalOperandPredicate { | ||
| 3347 | 3319 | /// The value that the field should be equal to. |
| 3348 | 3320 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3349 | 3321 | #[serde(untagged)] |
| 3350 | -pub enum EqualUnion { | |
| 3322 | +pub enum Equal { | |
| 3351 | 3323 | Bool(bool), |
| 3352 | 3324 | |
| 3353 | 3325 | DateTime(DateTime), |
| @@ -3425,19 +3397,6 @@ pub enum Month { | ||
| 3425 | 3397 | PurpleString(String), |
| 3426 | 3398 | } |
| 3427 | 3399 | |
| 3428 | -/// The value that the field should be equal to. | |
| 3429 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 3430 | -#[serde(untagged)] | |
| 3431 | -pub enum OneOfElement { | |
| 3432 | - Bool(bool), | |
| 3433 | - | |
| 3434 | - DateTime(DateTime), | |
| 3435 | - | |
| 3436 | - Double(f64), | |
| 3437 | - | |
| 3438 | - PurpleString(String), | |
| 3439 | -} | |
| 3440 | - | |
| 3441 | 3400 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3442 | 3401 | #[serde(untagged)] |
| 3443 | 3402 | pub enum RangeElement { |
| @@ -3565,15 +3524,15 @@ pub enum ConditionalValueDefValue { | ||
| 3565 | 3524 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 3566 | 3525 | #[serde(rename_all = "camelCase")] |
| 3567 | 3526 | pub struct ConditionalPredicateMarkPropFieldDefClass { |
| 3568 | - pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>, | |
| 3527 | + pub test: Box<LogicalOperandPredicate>, | |
| 3569 | 3528 | |
| 3570 | 3529 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 3571 | 3530 | /// `0` to `1` for opacity). |
| 3572 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 3531 | + pub value: ConditionalValueDefValue, | |
| 3573 | 3532 | |
| 3574 | 3533 | /// A [selection name](selection.html), or a series of [composed |
| 3575 | 3534 | /// selections](selection.html#compose). |
| 3576 | - pub selection: Option<Box<ConditionalValueDefSelectionOperand>>, | |
| 3535 | + pub selection: Box<SelectionOperand>, | |
| 3577 | 3536 | |
| 3578 | 3537 | /// Aggregation function for the field |
| 3579 | 3538 | /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -3586,7 +3545,7 @@ pub struct ConditionalPredicateMarkPropFieldDefClass { | ||
| 3586 | 3545 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 3587 | 3546 | /// |
| 3588 | 3547 | /// __Default value:__ `false` |
| 3589 | - pub bin: Option<Bin>, | |
| 3548 | + pub bin: Option<ColorBin>, | |
| 3590 | 3549 | |
| 3591 | 3550 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 3592 | 3551 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -3632,7 +3591,7 @@ pub struct ConditionalPredicateMarkPropFieldDefClass { | ||
| 3632 | 3591 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 3633 | 3592 | /// [geographic projection](projection.html) is applied. |
| 3634 | 3593 | #[serde(rename = "type")] |
| 3635 | - pub conditional_def_type: Option<Type>, | |
| 3594 | + pub conditional_def_type: Type, | |
| 3636 | 3595 | } |
| 3637 | 3596 | |
| 3638 | 3597 | /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or |
| @@ -3989,7 +3948,7 @@ pub enum DomainUnion { | ||
| 3989 | 3948 | |
| 3990 | 3949 | Enum(Domain), |
| 3991 | 3950 | |
| 3992 | - UnionArray(Vec<OneOfElement>), | |
| 3951 | + UnionArray(Vec<Equal>), | |
| 3993 | 3952 | } |
| 3994 | 3953 | |
| 3995 | 3954 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -4261,7 +4220,7 @@ pub enum SortEnum { | ||
| 4261 | 4220 | /// A constant value in visual domain. |
| 4262 | 4221 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 4263 | 4222 | #[serde(untagged)] |
| 4264 | -pub enum ConditionalPredicateValueDefValue { | |
| 4223 | +pub enum ColorValue { | |
| 4265 | 4224 | Bool(bool), |
| 4266 | 4225 | |
| 4267 | 4226 | Double(f64), |
| @@ -4286,7 +4245,7 @@ pub struct FacetFieldDef { | ||
| 4286 | 4245 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4287 | 4246 | /// |
| 4288 | 4247 | /// __Default value:__ `false` |
| 4289 | - pub bin: Option<Bin>, | |
| 4248 | + pub bin: Option<ColorBin>, | |
| 4290 | 4249 | |
| 4291 | 4250 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 4292 | 4251 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -4381,7 +4340,7 @@ pub struct FieldDef { | ||
| 4381 | 4340 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4382 | 4341 | /// |
| 4383 | 4342 | /// __Default value:__ `false` |
| 4384 | - pub bin: Option<Bin>, | |
| 4343 | + pub bin: Option<ColorBin>, | |
| 4385 | 4344 | |
| 4386 | 4345 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 4387 | 4346 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -4437,7 +4396,7 @@ pub struct DefWithCondition { | ||
| 4437 | 4396 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4438 | 4397 | /// |
| 4439 | 4398 | /// __Default value:__ `false` |
| 4440 | - pub bin: Option<Bin>, | |
| 4399 | + pub bin: Option<ColorBin>, | |
| 4441 | 4400 | |
| 4442 | 4401 | /// One or more value definition(s) with a selection predicate. |
| 4443 | 4402 | /// |
| @@ -4471,10 +4430,10 @@ pub struct DefWithCondition { | ||
| 4471 | 4430 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4472 | 4431 | /// [geographic projection](projection.html) is applied. |
| 4473 | 4432 | #[serde(rename = "type")] |
| 4474 | - pub def_with_condition_type: Option<Type>, | |
| 4433 | + pub def_with_condition_type: Type, | |
| 4475 | 4434 | |
| 4476 | 4435 | /// A constant value in visual domain. |
| 4477 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 4436 | + pub value: Option<ColorValue>, | |
| 4478 | 4437 | } |
| 4479 | 4438 | |
| 4480 | 4439 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -4488,15 +4447,15 @@ pub enum HrefCondition { | ||
| 4488 | 4447 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 4489 | 4448 | #[serde(rename_all = "camelCase")] |
| 4490 | 4449 | pub struct ConditionalPredicateFieldDefClass { |
| 4491 | - pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>, | |
| 4450 | + pub test: Box<LogicalOperandPredicate>, | |
| 4492 | 4451 | |
| 4493 | 4452 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4494 | 4453 | /// `0` to `1` for opacity). |
| 4495 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 4454 | + pub value: ConditionalValueDefValue, | |
| 4496 | 4455 | |
| 4497 | 4456 | /// A [selection name](selection.html), or a series of [composed |
| 4498 | 4457 | /// selections](selection.html#compose). |
| 4499 | - pub selection: Option<Box<ConditionalValueDefSelectionOperand>>, | |
| 4458 | + pub selection: Box<SelectionOperand>, | |
| 4500 | 4459 | |
| 4501 | 4460 | /// Aggregation function for the field |
| 4502 | 4461 | /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -4509,7 +4468,7 @@ pub struct ConditionalPredicateFieldDefClass { | ||
| 4509 | 4468 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4510 | 4469 | /// |
| 4511 | 4470 | /// __Default value:__ `false` |
| 4512 | - pub bin: Option<Bin>, | |
| 4471 | + pub bin: Option<ColorBin>, | |
| 4513 | 4472 | |
| 4514 | 4473 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 4515 | 4474 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -4534,7 +4493,7 @@ pub struct ConditionalPredicateFieldDefClass { | ||
| 4534 | 4493 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4535 | 4494 | /// [geographic projection](projection.html) is applied. |
| 4536 | 4495 | #[serde(rename = "type")] |
| 4537 | - pub conditional_def_type: Option<Type>, | |
| 4496 | + pub conditional_def_type: Type, | |
| 4538 | 4497 | } |
| 4539 | 4498 | |
| 4540 | 4499 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -4559,7 +4518,7 @@ pub struct OrderFieldDef { | ||
| 4559 | 4518 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4560 | 4519 | /// |
| 4561 | 4520 | /// __Default value:__ `false` |
| 4562 | - pub bin: Option<Bin>, | |
| 4521 | + pub bin: Option<ColorBin>, | |
| 4563 | 4522 | |
| 4564 | 4523 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 4565 | 4524 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -4620,7 +4579,7 @@ pub struct TextDefWithCondition { | ||
| 4620 | 4579 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4621 | 4580 | /// |
| 4622 | 4581 | /// __Default value:__ `false` |
| 4623 | - pub bin: Option<Bin>, | |
| 4582 | + pub bin: Option<ColorBin>, | |
| 4624 | 4583 | |
| 4625 | 4584 | /// One or more value definition(s) with a selection predicate. |
| 4626 | 4585 | /// |
| @@ -4658,10 +4617,10 @@ pub struct TextDefWithCondition { | ||
| 4658 | 4617 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4659 | 4618 | /// [geographic projection](projection.html) is applied. |
| 4660 | 4619 | #[serde(rename = "type")] |
| 4661 | - pub text_def_with_condition_type: Option<Type>, | |
| 4620 | + pub text_def_with_condition_type: Type, | |
| 4662 | 4621 | |
| 4663 | 4622 | /// A constant value in visual domain. |
| 4664 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 4623 | + pub value: Option<ColorValue>, | |
| 4665 | 4624 | } |
| 4666 | 4625 | |
| 4667 | 4626 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -4675,15 +4634,15 @@ pub enum TextCondition { | ||
| 4675 | 4634 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 4676 | 4635 | #[serde(rename_all = "camelCase")] |
| 4677 | 4636 | pub struct ConditionalPredicateTextFieldDefClass { |
| 4678 | - pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>, | |
| 4637 | + pub test: Box<LogicalOperandPredicate>, | |
| 4679 | 4638 | |
| 4680 | 4639 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4681 | 4640 | /// `0` to `1` for opacity). |
| 4682 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 4641 | + pub value: ConditionalValueDefValue, | |
| 4683 | 4642 | |
| 4684 | 4643 | /// A [selection name](selection.html), or a series of [composed |
| 4685 | 4644 | /// selections](selection.html#compose). |
| 4686 | - pub selection: Option<Box<ConditionalValueDefSelectionOperand>>, | |
| 4645 | + pub selection: Box<SelectionOperand>, | |
| 4687 | 4646 | |
| 4688 | 4647 | /// Aggregation function for the field |
| 4689 | 4648 | /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`). |
| @@ -4696,7 +4655,7 @@ pub struct ConditionalPredicateTextFieldDefClass { | ||
| 4696 | 4655 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4697 | 4656 | /// |
| 4698 | 4657 | /// __Default value:__ `false` |
| 4699 | - pub bin: Option<Bin>, | |
| 4658 | + pub bin: Option<ColorBin>, | |
| 4700 | 4659 | |
| 4701 | 4660 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 4702 | 4661 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -4725,7 +4684,7 @@ pub struct ConditionalPredicateTextFieldDefClass { | ||
| 4725 | 4684 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4726 | 4685 | /// [geographic projection](projection.html) is applied. |
| 4727 | 4686 | #[serde(rename = "type")] |
| 4728 | - pub conditional_def_type: Option<Type>, | |
| 4687 | + pub conditional_def_type: Type, | |
| 4729 | 4688 | } |
| 4730 | 4689 | |
| 4731 | 4690 | /// X coordinates of the marks, or width of horizontal `"bar"` and `"area"`. |
| @@ -4753,7 +4712,7 @@ pub struct XClass { | ||
| 4753 | 4712 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4754 | 4713 | /// |
| 4755 | 4714 | /// __Default value:__ `false` |
| 4756 | - pub bin: Option<Bin>, | |
| 4715 | + pub bin: Option<ColorBin>, | |
| 4757 | 4716 | |
| 4758 | 4717 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 4759 | 4718 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -4815,11 +4774,11 @@ pub struct XClass { | ||
| 4815 | 4774 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4816 | 4775 | /// [geographic projection](projection.html) is applied. |
| 4817 | 4776 | #[serde(rename = "type")] |
| 4818 | - pub def_type: Option<Type>, | |
| 4777 | + pub def_type: Type, | |
| 4819 | 4778 | |
| 4820 | 4779 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4821 | 4780 | /// `0` to `1` for opacity). |
| 4822 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 4781 | + pub value: ConditionalValueDefValue, | |
| 4823 | 4782 | } |
| 4824 | 4783 | |
| 4825 | 4784 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -4997,7 +4956,7 @@ pub struct X2Class { | ||
| 4997 | 4956 | /// If `true`, default [binning parameters](bin.html) will be applied. |
| 4998 | 4957 | /// |
| 4999 | 4958 | /// __Default value:__ `false` |
| 5000 | - pub bin: Option<Bin>, | |
| 4959 | + pub bin: Option<ColorBin>, | |
| 5001 | 4960 | |
| 5002 | 4961 | /// __Required.__ A string defining the name of the field from which to pull a data value |
| 5003 | 4962 | /// or an object defining iterated values from the [`repeat`](repeat.html) operator. |
| @@ -5022,11 +4981,11 @@ pub struct X2Class { | ||
| 5022 | 4981 | /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5023 | 4982 | /// [geographic projection](projection.html) is applied. |
| 5024 | 4983 | #[serde(rename = "type")] |
| 5025 | - pub def_type: Option<Type>, | |
| 4984 | + pub def_type: Type, | |
| 5026 | 4985 | |
| 5027 | 4986 | /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5028 | 4987 | /// `0` to `1` for opacity). |
| 5029 | - pub value: Option<ConditionalPredicateValueDefValue>, | |
| 4988 | + pub value: ConditionalValueDefValue, | |
| 5030 | 4989 | } |
| 5031 | 4990 | |
| 5032 | 4991 | /// An object that describes mappings between `row` and `column` channels and their field |
| @@ -5072,7 +5031,7 @@ pub struct Spec { | ||
| 5072 | 5031 | /// |
| 5073 | 5032 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5074 | 5033 | /// layering facet specifications is not allowed. |
| 5075 | - pub layer: Option<Vec<LayerSpec>>, | |
| 5034 | + pub layer: Vec<LayerSpec>, | |
| 5076 | 5035 | |
| 5077 | 5036 | /// Name of the visualization for later reference. |
| 5078 | 5037 | pub name: Option<String>, |
| @@ -5117,13 +5076,13 @@ pub struct Spec { | ||
| 5117 | 5076 | pub width: Option<f64>, |
| 5118 | 5077 | |
| 5119 | 5078 | /// A key-value mapping between encoding channels and definition of fields. |
| 5120 | - pub encoding: Option<Encoding>, | |
| 5079 | + pub encoding: Encoding, | |
| 5121 | 5080 | |
| 5122 | 5081 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 5123 | 5082 | /// `"line"`, |
| 5124 | 5083 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 5125 | 5084 | /// object](mark.html#mark-def). |
| 5126 | - pub mark: Option<AnyMark>, | |
| 5085 | + pub mark: AnyMark, | |
| 5127 | 5086 | |
| 5128 | 5087 | /// An object defining properties of geographic projection. |
| 5129 | 5088 | /// |
| @@ -5136,20 +5095,20 @@ pub struct Spec { | ||
| 5136 | 5095 | |
| 5137 | 5096 | /// An object that describes mappings between `row` and `column` channels and their field |
| 5138 | 5097 | /// definitions. |
| 5139 | - pub facet: Option<FacetMapping>, | |
| 5098 | + pub facet: FacetMapping, | |
| 5140 | 5099 | |
| 5141 | 5100 | /// A specification of the view that gets faceted. |
| 5142 | - pub spec: Box<Option<Spec>>, | |
| 5101 | + pub spec: Box<Spec>, | |
| 5143 | 5102 | |
| 5144 | 5103 | /// An object that describes what fields should be repeated into views that are laid out as a |
| 5145 | 5104 | /// `row` or `column`. |
| 5146 | - pub repeat: Option<Repeat>, | |
| 5105 | + pub repeat: Repeat, | |
| 5147 | 5106 | |
| 5148 | 5107 | /// A list of views that should be concatenated and put into a column. |
| 5149 | - pub vconcat: Option<Vec<Spec>>, | |
| 5108 | + pub vconcat: Vec<Spec>, | |
| 5150 | 5109 | |
| 5151 | 5110 | /// A list of views that should be concatenated and put into a row. |
| 5152 | - pub hconcat: Option<Vec<Spec>>, | |
| 5111 | + pub hconcat: Vec<Spec>, | |
| 5153 | 5112 | } |
| 5154 | 5113 | |
| 5155 | 5114 | /// A key-value mapping between encoding channels and definition of fields. |
| @@ -5253,7 +5212,7 @@ pub struct LayerSpec { | ||
| 5253 | 5212 | /// |
| 5254 | 5213 | /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 5255 | 5214 | /// layering facet specifications is not allowed. |
| 5256 | - pub layer: Option<Vec<LayerSpec>>, | |
| 5215 | + pub layer: Vec<LayerSpec>, | |
| 5257 | 5216 | |
| 5258 | 5217 | /// Name of the visualization for later reference. |
| 5259 | 5218 | pub name: Option<String>, |
| @@ -5290,13 +5249,13 @@ pub struct LayerSpec { | ||
| 5290 | 5249 | pub width: Option<f64>, |
| 5291 | 5250 | |
| 5292 | 5251 | /// A key-value mapping between encoding channels and definition of fields. |
| 5293 | - pub encoding: Option<Encoding>, | |
| 5252 | + pub encoding: Encoding, | |
| 5294 | 5253 | |
| 5295 | 5254 | /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| 5296 | 5255 | /// `"line"`, |
| 5297 | 5256 | /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 5298 | 5257 | /// object](mark.html#mark-def). |
| 5299 | - pub mark: Option<AnyMark>, | |
| 5258 | + pub mark: AnyMark, | |
| 5300 | 5259 | |
| 5301 | 5260 | /// An object defining properties of geographic projection. |
| 5302 | 5261 | /// |
| @@ -5832,7 +5791,7 @@ pub struct Transform { | ||
| 5832 | 5791 | /// predicate](filter.html#one-of-predicate); |
| 5833 | 5792 | /// (3) a [selection predicate](filter.html#selection-predicate); |
| 5834 | 5793 | /// or (4) a logical operand that combines (1), (2), or (3). |
| 5835 | - pub filter: Option<Box<ConditionalValueDefLogicalOperandPredicate>>, | |
| 5794 | + pub filter: Box<LogicalOperandPredicate>, | |
| 5836 | 5795 | |
| 5837 | 5796 | /// The field for storing the computed formula value. |
| 5838 | 5797 | /// |
| @@ -5849,7 +5808,7 @@ pub struct Transform { | ||
| 5849 | 5808 | |
| 5850 | 5809 | /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 5851 | 5810 | /// current data object. |
| 5852 | - pub calculate: Option<String>, | |
| 5811 | + pub calculate: String, | |
| 5853 | 5812 | |
| 5854 | 5813 | /// The default value to use if lookup fails. |
| 5855 | 5814 | /// |
| @@ -5858,24 +5817,24 @@ pub struct Transform { | ||
| 5858 | 5817 | pub transform_default: Option<String>, |
| 5859 | 5818 | |
| 5860 | 5819 | /// Secondary data reference. |
| 5861 | - pub from: Option<LookupData>, | |
| 5820 | + pub from: LookupData, | |
| 5862 | 5821 | |
| 5863 | 5822 | /// Key in primary data source. |
| 5864 | - pub lookup: Option<String>, | |
| 5823 | + pub lookup: String, | |
| 5865 | 5824 | |
| 5866 | 5825 | /// An object indicating bin properties, or simply `true` for using default bin parameters. |
| 5867 | - pub bin: Option<Bin>, | |
| 5826 | + pub bin: TransformBin, | |
| 5868 | 5827 | |
| 5869 | 5828 | /// The data field to bin. |
| 5870 | 5829 | /// |
| 5871 | 5830 | /// The data field to apply time unit. |
| 5872 | - pub field: Option<String>, | |
| 5831 | + pub field: String, | |
| 5873 | 5832 | |
| 5874 | 5833 | /// The timeUnit. |
| 5875 | - pub time_unit: Option<TimeUnit>, | |
| 5834 | + pub time_unit: TimeUnit, | |
| 5876 | 5835 | |
| 5877 | 5836 | /// Array of objects that define fields to aggregate. |
| 5878 | - pub aggregate: Option<Vec<AggregatedFieldDef>>, | |
| 5837 | + pub aggregate: Vec<AggregatedFieldDef>, | |
| 5879 | 5838 | |
| 5880 | 5839 | /// The data fields to group by. If not specified, a single group containing all data objects |
| 5881 | 5840 | /// will be used. |
| @@ -5898,6 +5857,14 @@ pub struct AggregatedFieldDef { | ||
| 5898 | 5857 | pub op: AggregateOp, |
| 5899 | 5858 | } |
| 5900 | 5859 | |
| 5860 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 5861 | +#[serde(untagged)] | |
| 5862 | +pub enum TransformBin { | |
| 5863 | + BinParams(BinParams), | |
| 5864 | + | |
| 5865 | + Bool(bool), | |
| 5866 | +} | |
| 5867 | + | |
| 5901 | 5868 | /// Secondary data reference. |
| 5902 | 5869 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 5903 | 5870 | pub struct LookupData { |
Mschema-scala3-upickledefault / TopLevel.scala+64 −64
| @@ -111,7 +111,7 @@ case class TopLevel ( | ||
| 111 | 111 | /** |
| 112 | 112 | * A key-value mapping between encoding channels and definition of fields. |
| 113 | 113 | */ |
| 114 | - val encoding : Option[EncodingWithFacet] = None, | |
| 114 | + val encoding : EncodingWithFacet, | |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | 117 | * The height of a visualization. |
| @@ -140,7 +140,7 @@ case class TopLevel ( | ||
| 140 | 140 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 141 | 141 | * object](mark.html#mark-def). |
| 142 | 142 | */ |
| 143 | - val mark : Option[AnyMark] = None, | |
| 143 | + val mark : AnyMark, | |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | 146 | * Name of the visualization for later reference. |
| @@ -210,7 +210,7 @@ case class TopLevel ( | ||
| 210 | 210 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 211 | 211 | * layering facet specifications is not allowed. |
| 212 | 212 | */ |
| 213 | - val layer : Option[Seq[LayerSpec]] = None, | |
| 213 | + val layer : Seq[LayerSpec], | |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | 216 | * Scale, axis, and legend resolutions for layers. |
| @@ -229,28 +229,28 @@ case class TopLevel ( | ||
| 229 | 229 | * An object that describes mappings between `row` and `column` channels and their field |
| 230 | 230 | * definitions. |
| 231 | 231 | */ |
| 232 | - val facet : Option[FacetMapping] = None, | |
| 232 | + val facet : FacetMapping, | |
| 233 | 233 | |
| 234 | 234 | /** |
| 235 | 235 | * A specification of the view that gets faceted. |
| 236 | 236 | */ |
| 237 | - val spec : Option[Spec] = None, | |
| 237 | + val spec : Spec, | |
| 238 | 238 | |
| 239 | 239 | /** |
| 240 | 240 | * An object that describes what fields should be repeated into views that are laid out as a |
| 241 | 241 | * `row` or `column`. |
| 242 | 242 | */ |
| 243 | - val repeat : Option[Repeat] = None, | |
| 243 | + val repeat : Repeat, | |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | 246 | * A list of views that should be concatenated and put into a column. |
| 247 | 247 | */ |
| 248 | - val vconcat : Option[Seq[Spec]] = None, | |
| 248 | + val vconcat : Seq[Spec], | |
| 249 | 249 | |
| 250 | 250 | /** |
| 251 | 251 | * A list of views that should be concatenated and put into a row. |
| 252 | 252 | */ |
| 253 | - val hconcat : Option[Seq[Spec]] = None | |
| 253 | + val hconcat : Seq[Spec] | |
| 254 | 254 | ) derives OptionPickler.ReadWriter |
| 255 | 255 | |
| 256 | 256 | /** |
| @@ -2432,7 +2432,7 @@ given unionWriterRangeConfigValue: OptionPickler.Writer[RangeConfigValue] = Opti | ||
| 2432 | 2432 | case class VGScheme ( |
| 2433 | 2433 | val count : Option[Double] = None, |
| 2434 | 2434 | val extent : Option[Seq[Double]] = None, |
| 2435 | - val scheme : Option[String] = None, | |
| 2435 | + val scheme : String, | |
| 2436 | 2436 | val step : Option[Double] = None |
| 2437 | 2437 | ) derives OptionPickler.ReadWriter |
| 2438 | 2438 | |
| @@ -3029,7 +3029,7 @@ case class SingleSelectionConfig ( | ||
| 3029 | 3029 | case class VGBinding ( |
| 3030 | 3030 | val element : Option[String] = None, |
| 3031 | 3031 | val input : String, |
| 3032 | - val options : Option[Seq[String]] = None, | |
| 3032 | + val options : Seq[String], | |
| 3033 | 3033 | val max : Option[Double] = None, |
| 3034 | 3034 | val min : Option[Double] = None, |
| 3035 | 3035 | val step : Option[Double] = None |
| @@ -3940,7 +3940,7 @@ case class Data ( | ||
| 3940 | 3940 | * An URL from which to load the data set. Use the `format.type` property |
| 3941 | 3941 | * to ensure the loaded data is correctly parsed. |
| 3942 | 3942 | */ |
| 3943 | - val url : Option[String] = None, | |
| 3943 | + val url : String, | |
| 3944 | 3944 | |
| 3945 | 3945 | /** |
| 3946 | 3946 | * The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3948,12 +3948,12 @@ case class Data ( | ||
| 3948 | 3948 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3949 | 3949 | * parsed according to the specified format type. |
| 3950 | 3950 | */ |
| 3951 | - val values : Option[Values] = None, | |
| 3951 | + val values : Values, | |
| 3952 | 3952 | |
| 3953 | 3953 | /** |
| 3954 | 3954 | * Provide a placeholder name and bind data at runtime. |
| 3955 | 3955 | */ |
| 3956 | - val name : Option[String] = None | |
| 3956 | + val name : String | |
| 3957 | 3957 | ) derives OptionPickler.ReadWriter |
| 3958 | 3958 | |
| 3959 | 3959 | /** |
| @@ -4341,7 +4341,7 @@ case class MarkPropDefWithCondition ( | ||
| 4341 | 4341 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4342 | 4342 | * [geographic projection](projection.html) is applied. |
| 4343 | 4343 | */ |
| 4344 | - val `type` : Option[Type] = None, | |
| 4344 | + val `type` : Type, | |
| 4345 | 4345 | |
| 4346 | 4346 | /** |
| 4347 | 4347 | * A constant value in visual domain. |
| @@ -4526,7 +4526,7 @@ given unionWriterColorCondition: OptionPickler.Writer[ColorCondition] = OptionPi | ||
| 4526 | 4526 | } |
| 4527 | 4527 | |
| 4528 | 4528 | case class ConditionalValueDef ( |
| 4529 | - val test : Option[LogicalOperandPredicate] = None, | |
| 4529 | + val test : LogicalOperandPredicate, | |
| 4530 | 4530 | |
| 4531 | 4531 | /** |
| 4532 | 4532 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4538,13 +4538,13 @@ case class ConditionalValueDef ( | ||
| 4538 | 4538 | * A [selection name](selection.html), or a series of [composed |
| 4539 | 4539 | * selections](selection.html#compose). |
| 4540 | 4540 | */ |
| 4541 | - val selection : Option[SelectionOperand] = None | |
| 4541 | + val selection : SelectionOperand | |
| 4542 | 4542 | ) derives OptionPickler.ReadWriter |
| 4543 | 4543 | |
| 4544 | 4544 | case class Selection ( |
| 4545 | - val not : Option[SelectionOperand] = None, | |
| 4546 | - val and : Option[Seq[SelectionOperand]] = None, | |
| 4547 | - val or : Option[Seq[SelectionOperand]] = None | |
| 4545 | + val not : SelectionOperand, | |
| 4546 | + val and : Seq[SelectionOperand], | |
| 4547 | + val or : Seq[SelectionOperand] | |
| 4548 | 4548 | ) derives OptionPickler.ReadWriter |
| 4549 | 4549 | |
| 4550 | 4550 | /** |
| @@ -4566,21 +4566,21 @@ given unionWriterSelectionOperand: OptionPickler.Writer[SelectionOperand] = Opti | ||
| 4566 | 4566 | } |
| 4567 | 4567 | |
| 4568 | 4568 | case class Predicate ( |
| 4569 | - val not : Option[LogicalOperandPredicate] = None, | |
| 4570 | - val and : Option[Seq[LogicalOperandPredicate]] = None, | |
| 4571 | - val or : Option[Seq[LogicalOperandPredicate]] = None, | |
| 4569 | + val not : LogicalOperandPredicate, | |
| 4570 | + val and : Seq[LogicalOperandPredicate], | |
| 4571 | + val or : Seq[LogicalOperandPredicate], | |
| 4572 | 4572 | |
| 4573 | 4573 | /** |
| 4574 | 4574 | * The value that the field should be equal to. |
| 4575 | 4575 | */ |
| 4576 | - val equal : Option[Equal] = None, | |
| 4576 | + val equal : Equal, | |
| 4577 | 4577 | |
| 4578 | 4578 | /** |
| 4579 | 4579 | * Field to be filtered. |
| 4580 | 4580 | * |
| 4581 | 4581 | * Field to be filtered |
| 4582 | 4582 | */ |
| 4583 | - val field : Option[String] = None, | |
| 4583 | + val field : String, | |
| 4584 | 4584 | |
| 4585 | 4585 | /** |
| 4586 | 4586 | * Time unit for the field to be filtered. |
| @@ -4593,18 +4593,18 @@ case class Predicate ( | ||
| 4593 | 4593 | * An array of inclusive minimum and maximum values |
| 4594 | 4594 | * for a field value of a data item to be included in the filtered data. |
| 4595 | 4595 | */ |
| 4596 | - val range : Option[Seq[RangeElement]] = None, | |
| 4596 | + val range : Seq[RangeElement], | |
| 4597 | 4597 | |
| 4598 | 4598 | /** |
| 4599 | 4599 | * A set of values that the `field`'s value should be a member of, |
| 4600 | 4600 | * for a data item included in the filtered data. |
| 4601 | 4601 | */ |
| 4602 | - val oneOf : Option[Seq[Equal]] = None, | |
| 4602 | + val oneOf : Seq[Equal], | |
| 4603 | 4603 | |
| 4604 | 4604 | /** |
| 4605 | 4605 | * Filter using a selection name. |
| 4606 | 4606 | */ |
| 4607 | - val selection : Option[SelectionOperand] = None | |
| 4607 | + val selection : SelectionOperand | |
| 4608 | 4608 | ) derives OptionPickler.ReadWriter |
| 4609 | 4609 | |
| 4610 | 4610 | /** |
| @@ -4917,19 +4917,19 @@ given unionWriterConditionalValueDefValue: OptionPickler.Writer[ConditionalValue | ||
| 4917 | 4917 | } |
| 4918 | 4918 | |
| 4919 | 4919 | case class ConditionalPredicateMarkPropFieldDefClass ( |
| 4920 | - val test : Option[LogicalOperandPredicate] = None, | |
| 4920 | + val test : LogicalOperandPredicate, | |
| 4921 | 4921 | |
| 4922 | 4922 | /** |
| 4923 | 4923 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4924 | 4924 | * `0` to `1` for opacity). |
| 4925 | 4925 | */ |
| 4926 | - val value : Option[ConditionalValueDefValue] = None, | |
| 4926 | + val value : ConditionalValueDefValue, | |
| 4927 | 4927 | |
| 4928 | 4928 | /** |
| 4929 | 4929 | * A [selection name](selection.html), or a series of [composed |
| 4930 | 4930 | * selections](selection.html#compose). |
| 4931 | 4931 | */ |
| 4932 | - val selection : Option[SelectionOperand] = None, | |
| 4932 | + val selection : SelectionOperand, | |
| 4933 | 4933 | |
| 4934 | 4934 | /** |
| 4935 | 4935 | * Aggregation function for the field |
| @@ -5003,7 +5003,7 @@ case class ConditionalPredicateMarkPropFieldDefClass ( | ||
| 5003 | 5003 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5004 | 5004 | * [geographic projection](projection.html) is applied. |
| 5005 | 5005 | */ |
| 5006 | - val `type` : Option[Type] = None | |
| 5006 | + val `type` : Type | |
| 5007 | 5007 | ) derives OptionPickler.ReadWriter |
| 5008 | 5008 | |
| 5009 | 5009 | /** |
| @@ -6062,7 +6062,7 @@ case class DefWithCondition ( | ||
| 6062 | 6062 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6063 | 6063 | * [geographic projection](projection.html) is applied. |
| 6064 | 6064 | */ |
| 6065 | - val `type` : Option[Type] = None, | |
| 6065 | + val `type` : Type, | |
| 6066 | 6066 | |
| 6067 | 6067 | /** |
| 6068 | 6068 | * A constant value in visual domain. |
| @@ -6083,19 +6083,19 @@ given unionWriterHrefCondition: OptionPickler.Writer[HrefCondition] = OptionPick | ||
| 6083 | 6083 | } |
| 6084 | 6084 | |
| 6085 | 6085 | case class ConditionalPredicateFieldDefClass ( |
| 6086 | - val test : Option[LogicalOperandPredicate] = None, | |
| 6086 | + val test : LogicalOperandPredicate, | |
| 6087 | 6087 | |
| 6088 | 6088 | /** |
| 6089 | 6089 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6090 | 6090 | * `0` to `1` for opacity). |
| 6091 | 6091 | */ |
| 6092 | - val value : Option[ConditionalValueDefValue] = None, | |
| 6092 | + val value : ConditionalValueDefValue, | |
| 6093 | 6093 | |
| 6094 | 6094 | /** |
| 6095 | 6095 | * A [selection name](selection.html), or a series of [composed |
| 6096 | 6096 | * selections](selection.html#compose). |
| 6097 | 6097 | */ |
| 6098 | - val selection : Option[SelectionOperand] = None, | |
| 6098 | + val selection : SelectionOperand, | |
| 6099 | 6099 | |
| 6100 | 6100 | /** |
| 6101 | 6101 | * Aggregation function for the field |
| @@ -6142,7 +6142,7 @@ case class ConditionalPredicateFieldDefClass ( | ||
| 6142 | 6142 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6143 | 6143 | * [geographic projection](projection.html) is applied. |
| 6144 | 6144 | */ |
| 6145 | - val `type` : Option[Type] = None | |
| 6145 | + val `type` : Type | |
| 6146 | 6146 | ) derives OptionPickler.ReadWriter |
| 6147 | 6147 | |
| 6148 | 6148 | type Order = Seq[OrderFieldDef] | OrderFieldDef |
| @@ -6292,7 +6292,7 @@ case class TextDefWithCondition ( | ||
| 6292 | 6292 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6293 | 6293 | * [geographic projection](projection.html) is applied. |
| 6294 | 6294 | */ |
| 6295 | - val `type` : Option[Type] = None, | |
| 6295 | + val `type` : Type, | |
| 6296 | 6296 | |
| 6297 | 6297 | /** |
| 6298 | 6298 | * A constant value in visual domain. |
| @@ -6313,19 +6313,19 @@ given unionWriterTextCondition: OptionPickler.Writer[TextCondition] = OptionPick | ||
| 6313 | 6313 | } |
| 6314 | 6314 | |
| 6315 | 6315 | case class ConditionalPredicateTextFieldDefClass ( |
| 6316 | - val test : Option[LogicalOperandPredicate] = None, | |
| 6316 | + val test : LogicalOperandPredicate, | |
| 6317 | 6317 | |
| 6318 | 6318 | /** |
| 6319 | 6319 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6320 | 6320 | * `0` to `1` for opacity). |
| 6321 | 6321 | */ |
| 6322 | - val value : Option[ConditionalValueDefValue] = None, | |
| 6322 | + val value : ConditionalValueDefValue, | |
| 6323 | 6323 | |
| 6324 | 6324 | /** |
| 6325 | 6325 | * A [selection name](selection.html), or a series of [composed |
| 6326 | 6326 | * selections](selection.html#compose). |
| 6327 | 6327 | */ |
| 6328 | - val selection : Option[SelectionOperand] = None, | |
| 6328 | + val selection : SelectionOperand, | |
| 6329 | 6329 | |
| 6330 | 6330 | /** |
| 6331 | 6331 | * Aggregation function for the field |
| @@ -6378,7 +6378,7 @@ case class ConditionalPredicateTextFieldDefClass ( | ||
| 6378 | 6378 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6379 | 6379 | * [geographic projection](projection.html) is applied. |
| 6380 | 6380 | */ |
| 6381 | - val `type` : Option[Type] = None | |
| 6381 | + val `type` : Type | |
| 6382 | 6382 | ) derives OptionPickler.ReadWriter |
| 6383 | 6383 | |
| 6384 | 6384 | /** |
| @@ -6485,13 +6485,13 @@ case class XClass ( | ||
| 6485 | 6485 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6486 | 6486 | * [geographic projection](projection.html) is applied. |
| 6487 | 6487 | */ |
| 6488 | - val `type` : Option[Type] = None, | |
| 6488 | + val `type` : Type, | |
| 6489 | 6489 | |
| 6490 | 6490 | /** |
| 6491 | 6491 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6492 | 6492 | * `0` to `1` for opacity). |
| 6493 | 6493 | */ |
| 6494 | - val value : Option[ConditionalValueDefValue] = None | |
| 6494 | + val value : ConditionalValueDefValue | |
| 6495 | 6495 | ) derives OptionPickler.ReadWriter |
| 6496 | 6496 | |
| 6497 | 6497 | case class Axis ( |
| @@ -6749,13 +6749,13 @@ case class X2Class ( | ||
| 6749 | 6749 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6750 | 6750 | * [geographic projection](projection.html) is applied. |
| 6751 | 6751 | */ |
| 6752 | - val `type` : Option[Type] = None, | |
| 6752 | + val `type` : Type, | |
| 6753 | 6753 | |
| 6754 | 6754 | /** |
| 6755 | 6755 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6756 | 6756 | * `0` to `1` for opacity). |
| 6757 | 6757 | */ |
| 6758 | - val value : Option[ConditionalValueDefValue] = None | |
| 6758 | + val value : ConditionalValueDefValue | |
| 6759 | 6759 | ) derives OptionPickler.ReadWriter |
| 6760 | 6760 | |
| 6761 | 6761 | /** |
| @@ -6815,7 +6815,7 @@ case class Spec ( | ||
| 6815 | 6815 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6816 | 6816 | * layering facet specifications is not allowed. |
| 6817 | 6817 | */ |
| 6818 | - val layer : Option[Seq[LayerSpec]] = None, | |
| 6818 | + val layer : Seq[LayerSpec], | |
| 6819 | 6819 | |
| 6820 | 6820 | /** |
| 6821 | 6821 | * Name of the visualization for later reference. |
| @@ -6872,7 +6872,7 @@ case class Spec ( | ||
| 6872 | 6872 | /** |
| 6873 | 6873 | * A key-value mapping between encoding channels and definition of fields. |
| 6874 | 6874 | */ |
| 6875 | - val encoding : Option[Encoding] = None, | |
| 6875 | + val encoding : Encoding, | |
| 6876 | 6876 | |
| 6877 | 6877 | /** |
| 6878 | 6878 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6880,7 +6880,7 @@ case class Spec ( | ||
| 6880 | 6880 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6881 | 6881 | * object](mark.html#mark-def). |
| 6882 | 6882 | */ |
| 6883 | - val mark : Option[AnyMark] = None, | |
| 6883 | + val mark : AnyMark, | |
| 6884 | 6884 | |
| 6885 | 6885 | /** |
| 6886 | 6886 | * An object defining properties of geographic projection. |
| @@ -6899,28 +6899,28 @@ case class Spec ( | ||
| 6899 | 6899 | * An object that describes mappings between `row` and `column` channels and their field |
| 6900 | 6900 | * definitions. |
| 6901 | 6901 | */ |
| 6902 | - val facet : Option[FacetMapping] = None, | |
| 6902 | + val facet : FacetMapping, | |
| 6903 | 6903 | |
| 6904 | 6904 | /** |
| 6905 | 6905 | * A specification of the view that gets faceted. |
| 6906 | 6906 | */ |
| 6907 | - val spec : Option[Spec] = None, | |
| 6907 | + val spec : Spec, | |
| 6908 | 6908 | |
| 6909 | 6909 | /** |
| 6910 | 6910 | * An object that describes what fields should be repeated into views that are laid out as a |
| 6911 | 6911 | * `row` or `column`. |
| 6912 | 6912 | */ |
| 6913 | - val repeat : Option[Repeat] = None, | |
| 6913 | + val repeat : Repeat, | |
| 6914 | 6914 | |
| 6915 | 6915 | /** |
| 6916 | 6916 | * A list of views that should be concatenated and put into a column. |
| 6917 | 6917 | */ |
| 6918 | - val vconcat : Option[Seq[Spec]] = None, | |
| 6918 | + val vconcat : Seq[Spec], | |
| 6919 | 6919 | |
| 6920 | 6920 | /** |
| 6921 | 6921 | * A list of views that should be concatenated and put into a row. |
| 6922 | 6922 | */ |
| 6923 | - val hconcat : Option[Seq[Spec]] = None | |
| 6923 | + val hconcat : Seq[Spec] | |
| 6924 | 6924 | ) derives OptionPickler.ReadWriter |
| 6925 | 6925 | |
| 6926 | 6926 | /** |
| @@ -7060,7 +7060,7 @@ case class LayerSpec ( | ||
| 7060 | 7060 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 7061 | 7061 | * layering facet specifications is not allowed. |
| 7062 | 7062 | */ |
| 7063 | - val layer : Option[Seq[LayerSpec]] = None, | |
| 7063 | + val layer : Seq[LayerSpec], | |
| 7064 | 7064 | |
| 7065 | 7065 | /** |
| 7066 | 7066 | * Name of the visualization for later reference. |
| @@ -7109,7 +7109,7 @@ case class LayerSpec ( | ||
| 7109 | 7109 | /** |
| 7110 | 7110 | * A key-value mapping between encoding channels and definition of fields. |
| 7111 | 7111 | */ |
| 7112 | - val encoding : Option[Encoding] = None, | |
| 7112 | + val encoding : Encoding, | |
| 7113 | 7113 | |
| 7114 | 7114 | /** |
| 7115 | 7115 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -7117,7 +7117,7 @@ case class LayerSpec ( | ||
| 7117 | 7117 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 7118 | 7118 | * object](mark.html#mark-def). |
| 7119 | 7119 | */ |
| 7120 | - val mark : Option[AnyMark] = None, | |
| 7120 | + val mark : AnyMark, | |
| 7121 | 7121 | |
| 7122 | 7122 | /** |
| 7123 | 7123 | * An object defining properties of geographic projection. |
| @@ -7798,7 +7798,7 @@ case class Transform ( | ||
| 7798 | 7798 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 7799 | 7799 | * or (4) a logical operand that combines (1), (2), or (3). |
| 7800 | 7800 | */ |
| 7801 | - val filter : Option[LogicalOperandPredicate] = None, | |
| 7801 | + val filter : LogicalOperandPredicate, | |
| 7802 | 7802 | |
| 7803 | 7803 | /** |
| 7804 | 7804 | * The field for storing the computed formula value. |
| @@ -7818,7 +7818,7 @@ case class Transform ( | ||
| 7818 | 7818 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 7819 | 7819 | * current data object. |
| 7820 | 7820 | */ |
| 7821 | - val calculate : Option[String] = None, | |
| 7821 | + val calculate : String, | |
| 7822 | 7822 | |
| 7823 | 7823 | /** |
| 7824 | 7824 | * The default value to use if lookup fails. |
| @@ -7830,34 +7830,34 @@ case class Transform ( | ||
| 7830 | 7830 | /** |
| 7831 | 7831 | * Secondary data reference. |
| 7832 | 7832 | */ |
| 7833 | - val from : Option[LookupData] = None, | |
| 7833 | + val from : LookupData, | |
| 7834 | 7834 | |
| 7835 | 7835 | /** |
| 7836 | 7836 | * Key in primary data source. |
| 7837 | 7837 | */ |
| 7838 | - val lookup : Option[String] = None, | |
| 7838 | + val lookup : String, | |
| 7839 | 7839 | |
| 7840 | 7840 | /** |
| 7841 | 7841 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 7842 | 7842 | */ |
| 7843 | - val bin : Option[Bin] = None, | |
| 7843 | + val bin : Bin, | |
| 7844 | 7844 | |
| 7845 | 7845 | /** |
| 7846 | 7846 | * The data field to bin. |
| 7847 | 7847 | * |
| 7848 | 7848 | * The data field to apply time unit. |
| 7849 | 7849 | */ |
| 7850 | - val field : Option[String] = None, | |
| 7850 | + val field : String, | |
| 7851 | 7851 | |
| 7852 | 7852 | /** |
| 7853 | 7853 | * The timeUnit. |
| 7854 | 7854 | */ |
| 7855 | - val timeUnit : Option[TimeUnit] = None, | |
| 7855 | + val timeUnit : TimeUnit, | |
| 7856 | 7856 | |
| 7857 | 7857 | /** |
| 7858 | 7858 | * Array of objects that define fields to aggregate. |
| 7859 | 7859 | */ |
| 7860 | - val aggregate : Option[Seq[AggregatedFieldDef]] = None, | |
| 7860 | + val aggregate : Seq[AggregatedFieldDef], | |
| 7861 | 7861 | |
| 7862 | 7862 | /** |
| 7863 | 7863 | * The data fields to group by. If not specified, a single group containing all data objects |
Mschema-scala3default / TopLevel.scala+64 −64
| @@ -53,7 +53,7 @@ case class TopLevel ( | ||
| 53 | 53 | /** |
| 54 | 54 | * A key-value mapping between encoding channels and definition of fields. |
| 55 | 55 | */ |
| 56 | - val encoding : Option[EncodingWithFacet] = None, | |
| 56 | + val encoding : EncodingWithFacet, | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * The height of a visualization. |
| @@ -82,7 +82,7 @@ case class TopLevel ( | ||
| 82 | 82 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 83 | 83 | * object](mark.html#mark-def). |
| 84 | 84 | */ |
| 85 | - val mark : Option[AnyMark] = None, | |
| 85 | + val mark : AnyMark, | |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Name of the visualization for later reference. |
| @@ -152,7 +152,7 @@ case class TopLevel ( | ||
| 152 | 152 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 153 | 153 | * layering facet specifications is not allowed. |
| 154 | 154 | */ |
| 155 | - val layer : Option[Seq[LayerSpec]] = None, | |
| 155 | + val layer : Seq[LayerSpec], | |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | 158 | * Scale, axis, and legend resolutions for layers. |
| @@ -171,28 +171,28 @@ case class TopLevel ( | ||
| 171 | 171 | * An object that describes mappings between `row` and `column` channels and their field |
| 172 | 172 | * definitions. |
| 173 | 173 | */ |
| 174 | - val facet : Option[FacetMapping] = None, | |
| 174 | + val facet : FacetMapping, | |
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | 177 | * A specification of the view that gets faceted. |
| 178 | 178 | */ |
| 179 | - val spec : Option[Spec] = None, | |
| 179 | + val spec : Spec, | |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | 182 | * An object that describes what fields should be repeated into views that are laid out as a |
| 183 | 183 | * `row` or `column`. |
| 184 | 184 | */ |
| 185 | - val repeat : Option[Repeat] = None, | |
| 185 | + val repeat : Repeat, | |
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | 188 | * A list of views that should be concatenated and put into a column. |
| 189 | 189 | */ |
| 190 | - val vconcat : Option[Seq[Spec]] = None, | |
| 190 | + val vconcat : Seq[Spec], | |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | 193 | * A list of views that should be concatenated and put into a row. |
| 194 | 194 | */ |
| 195 | - val hconcat : Option[Seq[Spec]] = None | |
| 195 | + val hconcat : Seq[Spec] | |
| 196 | 196 | ) derives Encoder.AsObject, Decoder |
| 197 | 197 | |
| 198 | 198 | /** |
| @@ -2353,7 +2353,7 @@ given Encoder[RangeConfigValue] = Encoder.instance { | ||
| 2353 | 2353 | case class VGScheme ( |
| 2354 | 2354 | val count : Option[Double] = None, |
| 2355 | 2355 | val extent : Option[Seq[Double]] = None, |
| 2356 | - val scheme : Option[String] = None, | |
| 2356 | + val scheme : String, | |
| 2357 | 2357 | val step : Option[Double] = None |
| 2358 | 2358 | ) derives Encoder.AsObject, Decoder |
| 2359 | 2359 | |
| @@ -2943,7 +2943,7 @@ case class SingleSelectionConfig ( | ||
| 2943 | 2943 | case class VGBinding ( |
| 2944 | 2944 | val element : Option[String] = None, |
| 2945 | 2945 | val input : String, |
| 2946 | - val options : Option[Seq[String]] = None, | |
| 2946 | + val options : Seq[String], | |
| 2947 | 2947 | val max : Option[Double] = None, |
| 2948 | 2948 | val min : Option[Double] = None, |
| 2949 | 2949 | val step : Option[Double] = None |
| @@ -3848,7 +3848,7 @@ case class Data ( | ||
| 3848 | 3848 | * An URL from which to load the data set. Use the `format.type` property |
| 3849 | 3849 | * to ensure the loaded data is correctly parsed. |
| 3850 | 3850 | */ |
| 3851 | - val url : Option[String] = None, | |
| 3851 | + val url : String, | |
| 3852 | 3852 | |
| 3853 | 3853 | /** |
| 3854 | 3854 | * The full data set, included inline. This can be an array of objects or primitive values |
| @@ -3856,12 +3856,12 @@ case class Data ( | ||
| 3856 | 3856 | * Arrays of primitive values are ingested as objects with a `data` property. Strings are |
| 3857 | 3857 | * parsed according to the specified format type. |
| 3858 | 3858 | */ |
| 3859 | - val values : Option[Values] = None, | |
| 3859 | + val values : Values, | |
| 3860 | 3860 | |
| 3861 | 3861 | /** |
| 3862 | 3862 | * Provide a placeholder name and bind data at runtime. |
| 3863 | 3863 | */ |
| 3864 | - val name : Option[String] = None | |
| 3864 | + val name : String | |
| 3865 | 3865 | ) derives Encoder.AsObject, Decoder |
| 3866 | 3866 | |
| 3867 | 3867 | /** |
| @@ -4248,7 +4248,7 @@ case class MarkPropDefWithCondition ( | ||
| 4248 | 4248 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4249 | 4249 | * [geographic projection](projection.html) is applied. |
| 4250 | 4250 | */ |
| 4251 | - val `type` : Option[Type] = None, | |
| 4251 | + val `type` : Type, | |
| 4252 | 4252 | |
| 4253 | 4253 | /** |
| 4254 | 4254 | * A constant value in visual domain. |
| @@ -4433,7 +4433,7 @@ given Encoder[ColorCondition] = Encoder.instance { | ||
| 4433 | 4433 | } |
| 4434 | 4434 | |
| 4435 | 4435 | case class ConditionalValueDef ( |
| 4436 | - val test : Option[LogicalOperandPredicate] = None, | |
| 4436 | + val test : LogicalOperandPredicate, | |
| 4437 | 4437 | |
| 4438 | 4438 | /** |
| 4439 | 4439 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| @@ -4445,13 +4445,13 @@ case class ConditionalValueDef ( | ||
| 4445 | 4445 | * A [selection name](selection.html), or a series of [composed |
| 4446 | 4446 | * selections](selection.html#compose). |
| 4447 | 4447 | */ |
| 4448 | - val selection : Option[SelectionOperand] = None | |
| 4448 | + val selection : SelectionOperand | |
| 4449 | 4449 | ) derives Encoder.AsObject, Decoder |
| 4450 | 4450 | |
| 4451 | 4451 | case class Selection ( |
| 4452 | - val not : Option[SelectionOperand] = None, | |
| 4453 | - val and : Option[Seq[SelectionOperand]] = None, | |
| 4454 | - val or : Option[Seq[SelectionOperand]] = None | |
| 4452 | + val not : SelectionOperand, | |
| 4453 | + val and : Seq[SelectionOperand], | |
| 4454 | + val or : Seq[SelectionOperand] | |
| 4455 | 4455 | ) derives Encoder.AsObject, Decoder |
| 4456 | 4456 | |
| 4457 | 4457 | /** |
| @@ -4474,21 +4474,21 @@ given Encoder[SelectionOperand] = Encoder.instance { | ||
| 4474 | 4474 | } |
| 4475 | 4475 | |
| 4476 | 4476 | case class Predicate ( |
| 4477 | - val not : Option[LogicalOperandPredicate] = None, | |
| 4478 | - val and : Option[Seq[LogicalOperandPredicate]] = None, | |
| 4479 | - val or : Option[Seq[LogicalOperandPredicate]] = None, | |
| 4477 | + val not : LogicalOperandPredicate, | |
| 4478 | + val and : Seq[LogicalOperandPredicate], | |
| 4479 | + val or : Seq[LogicalOperandPredicate], | |
| 4480 | 4480 | |
| 4481 | 4481 | /** |
| 4482 | 4482 | * The value that the field should be equal to. |
| 4483 | 4483 | */ |
| 4484 | - val equal : Option[Equal] = None, | |
| 4484 | + val equal : Equal, | |
| 4485 | 4485 | |
| 4486 | 4486 | /** |
| 4487 | 4487 | * Field to be filtered. |
| 4488 | 4488 | * |
| 4489 | 4489 | * Field to be filtered |
| 4490 | 4490 | */ |
| 4491 | - val field : Option[String] = None, | |
| 4491 | + val field : String, | |
| 4492 | 4492 | |
| 4493 | 4493 | /** |
| 4494 | 4494 | * Time unit for the field to be filtered. |
| @@ -4501,18 +4501,18 @@ case class Predicate ( | ||
| 4501 | 4501 | * An array of inclusive minimum and maximum values |
| 4502 | 4502 | * for a field value of a data item to be included in the filtered data. |
| 4503 | 4503 | */ |
| 4504 | - val range : Option[Seq[RangeElement]] = None, | |
| 4504 | + val range : Seq[RangeElement], | |
| 4505 | 4505 | |
| 4506 | 4506 | /** |
| 4507 | 4507 | * A set of values that the `field`'s value should be a member of, |
| 4508 | 4508 | * for a data item included in the filtered data. |
| 4509 | 4509 | */ |
| 4510 | - val oneOf : Option[Seq[Equal]] = None, | |
| 4510 | + val oneOf : Seq[Equal], | |
| 4511 | 4511 | |
| 4512 | 4512 | /** |
| 4513 | 4513 | * Filter using a selection name. |
| 4514 | 4514 | */ |
| 4515 | - val selection : Option[SelectionOperand] = None | |
| 4515 | + val selection : SelectionOperand | |
| 4516 | 4516 | ) derives Encoder.AsObject, Decoder |
| 4517 | 4517 | |
| 4518 | 4518 | /** |
| @@ -4827,19 +4827,19 @@ given Encoder[ConditionalValueDefValue] = Encoder.instance { | ||
| 4827 | 4827 | } |
| 4828 | 4828 | |
| 4829 | 4829 | case class ConditionalPredicateMarkPropFieldDefClass ( |
| 4830 | - val test : Option[LogicalOperandPredicate] = None, | |
| 4830 | + val test : LogicalOperandPredicate, | |
| 4831 | 4831 | |
| 4832 | 4832 | /** |
| 4833 | 4833 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 4834 | 4834 | * `0` to `1` for opacity). |
| 4835 | 4835 | */ |
| 4836 | - val value : Option[ConditionalValueDefValue] = None, | |
| 4836 | + val value : ConditionalValueDefValue, | |
| 4837 | 4837 | |
| 4838 | 4838 | /** |
| 4839 | 4839 | * A [selection name](selection.html), or a series of [composed |
| 4840 | 4840 | * selections](selection.html#compose). |
| 4841 | 4841 | */ |
| 4842 | - val selection : Option[SelectionOperand] = None, | |
| 4842 | + val selection : SelectionOperand, | |
| 4843 | 4843 | |
| 4844 | 4844 | /** |
| 4845 | 4845 | * Aggregation function for the field |
| @@ -4913,7 +4913,7 @@ case class ConditionalPredicateMarkPropFieldDefClass ( | ||
| 4913 | 4913 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 4914 | 4914 | * [geographic projection](projection.html) is applied. |
| 4915 | 4915 | */ |
| 4916 | - val `type` : Option[Type] = None | |
| 4916 | + val `type` : Type | |
| 4917 | 4917 | ) derives Encoder.AsObject, Decoder |
| 4918 | 4918 | |
| 4919 | 4919 | /** |
| @@ -5965,7 +5965,7 @@ case class DefWithCondition ( | ||
| 5965 | 5965 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 5966 | 5966 | * [geographic projection](projection.html) is applied. |
| 5967 | 5967 | */ |
| 5968 | - val `type` : Option[Type] = None, | |
| 5968 | + val `type` : Type, | |
| 5969 | 5969 | |
| 5970 | 5970 | /** |
| 5971 | 5971 | * A constant value in visual domain. |
| @@ -5987,19 +5987,19 @@ given Encoder[HrefCondition] = Encoder.instance { | ||
| 5987 | 5987 | } |
| 5988 | 5988 | |
| 5989 | 5989 | case class ConditionalPredicateFieldDefClass ( |
| 5990 | - val test : Option[LogicalOperandPredicate] = None, | |
| 5990 | + val test : LogicalOperandPredicate, | |
| 5991 | 5991 | |
| 5992 | 5992 | /** |
| 5993 | 5993 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 5994 | 5994 | * `0` to `1` for opacity). |
| 5995 | 5995 | */ |
| 5996 | - val value : Option[ConditionalValueDefValue] = None, | |
| 5996 | + val value : ConditionalValueDefValue, | |
| 5997 | 5997 | |
| 5998 | 5998 | /** |
| 5999 | 5999 | * A [selection name](selection.html), or a series of [composed |
| 6000 | 6000 | * selections](selection.html#compose). |
| 6001 | 6001 | */ |
| 6002 | - val selection : Option[SelectionOperand] = None, | |
| 6002 | + val selection : SelectionOperand, | |
| 6003 | 6003 | |
| 6004 | 6004 | /** |
| 6005 | 6005 | * Aggregation function for the field |
| @@ -6046,7 +6046,7 @@ case class ConditionalPredicateFieldDefClass ( | ||
| 6046 | 6046 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6047 | 6047 | * [geographic projection](projection.html) is applied. |
| 6048 | 6048 | */ |
| 6049 | - val `type` : Option[Type] = None | |
| 6049 | + val `type` : Type | |
| 6050 | 6050 | ) derives Encoder.AsObject, Decoder |
| 6051 | 6051 | |
| 6052 | 6052 | type Order = Seq[OrderFieldDef] | OrderFieldDef |
| @@ -6197,7 +6197,7 @@ case class TextDefWithCondition ( | ||
| 6197 | 6197 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6198 | 6198 | * [geographic projection](projection.html) is applied. |
| 6199 | 6199 | */ |
| 6200 | - val `type` : Option[Type] = None, | |
| 6200 | + val `type` : Type, | |
| 6201 | 6201 | |
| 6202 | 6202 | /** |
| 6203 | 6203 | * A constant value in visual domain. |
| @@ -6219,19 +6219,19 @@ given Encoder[TextCondition] = Encoder.instance { | ||
| 6219 | 6219 | } |
| 6220 | 6220 | |
| 6221 | 6221 | case class ConditionalPredicateTextFieldDefClass ( |
| 6222 | - val test : Option[LogicalOperandPredicate] = None, | |
| 6222 | + val test : LogicalOperandPredicate, | |
| 6223 | 6223 | |
| 6224 | 6224 | /** |
| 6225 | 6225 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6226 | 6226 | * `0` to `1` for opacity). |
| 6227 | 6227 | */ |
| 6228 | - val value : Option[ConditionalValueDefValue] = None, | |
| 6228 | + val value : ConditionalValueDefValue, | |
| 6229 | 6229 | |
| 6230 | 6230 | /** |
| 6231 | 6231 | * A [selection name](selection.html), or a series of [composed |
| 6232 | 6232 | * selections](selection.html#compose). |
| 6233 | 6233 | */ |
| 6234 | - val selection : Option[SelectionOperand] = None, | |
| 6234 | + val selection : SelectionOperand, | |
| 6235 | 6235 | |
| 6236 | 6236 | /** |
| 6237 | 6237 | * Aggregation function for the field |
| @@ -6284,7 +6284,7 @@ case class ConditionalPredicateTextFieldDefClass ( | ||
| 6284 | 6284 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6285 | 6285 | * [geographic projection](projection.html) is applied. |
| 6286 | 6286 | */ |
| 6287 | - val `type` : Option[Type] = None | |
| 6287 | + val `type` : Type | |
| 6288 | 6288 | ) derives Encoder.AsObject, Decoder |
| 6289 | 6289 | |
| 6290 | 6290 | /** |
| @@ -6391,13 +6391,13 @@ case class XClass ( | ||
| 6391 | 6391 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6392 | 6392 | * [geographic projection](projection.html) is applied. |
| 6393 | 6393 | */ |
| 6394 | - val `type` : Option[Type] = None, | |
| 6394 | + val `type` : Type, | |
| 6395 | 6395 | |
| 6396 | 6396 | /** |
| 6397 | 6397 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6398 | 6398 | * `0` to `1` for opacity). |
| 6399 | 6399 | */ |
| 6400 | - val value : Option[ConditionalValueDefValue] = None | |
| 6400 | + val value : ConditionalValueDefValue | |
| 6401 | 6401 | ) derives Encoder.AsObject, Decoder |
| 6402 | 6402 | |
| 6403 | 6403 | case class Axis ( |
| @@ -6656,13 +6656,13 @@ case class X2Class ( | ||
| 6656 | 6656 | * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a |
| 6657 | 6657 | * [geographic projection](projection.html) is applied. |
| 6658 | 6658 | */ |
| 6659 | - val `type` : Option[Type] = None, | |
| 6659 | + val `type` : Type, | |
| 6660 | 6660 | |
| 6661 | 6661 | /** |
| 6662 | 6662 | * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between |
| 6663 | 6663 | * `0` to `1` for opacity). |
| 6664 | 6664 | */ |
| 6665 | - val value : Option[ConditionalValueDefValue] = None | |
| 6665 | + val value : ConditionalValueDefValue | |
| 6666 | 6666 | ) derives Encoder.AsObject, Decoder |
| 6667 | 6667 | |
| 6668 | 6668 | /** |
| @@ -6722,7 +6722,7 @@ case class Spec ( | ||
| 6722 | 6722 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6723 | 6723 | * layering facet specifications is not allowed. |
| 6724 | 6724 | */ |
| 6725 | - val layer : Option[Seq[LayerSpec]] = None, | |
| 6725 | + val layer : Seq[LayerSpec], | |
| 6726 | 6726 | |
| 6727 | 6727 | /** |
| 6728 | 6728 | * Name of the visualization for later reference. |
| @@ -6779,7 +6779,7 @@ case class Spec ( | ||
| 6779 | 6779 | /** |
| 6780 | 6780 | * A key-value mapping between encoding channels and definition of fields. |
| 6781 | 6781 | */ |
| 6782 | - val encoding : Option[Encoding] = None, | |
| 6782 | + val encoding : Encoding, | |
| 6783 | 6783 | |
| 6784 | 6784 | /** |
| 6785 | 6785 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -6787,7 +6787,7 @@ case class Spec ( | ||
| 6787 | 6787 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 6788 | 6788 | * object](mark.html#mark-def). |
| 6789 | 6789 | */ |
| 6790 | - val mark : Option[AnyMark] = None, | |
| 6790 | + val mark : AnyMark, | |
| 6791 | 6791 | |
| 6792 | 6792 | /** |
| 6793 | 6793 | * An object defining properties of geographic projection. |
| @@ -6806,28 +6806,28 @@ case class Spec ( | ||
| 6806 | 6806 | * An object that describes mappings between `row` and `column` channels and their field |
| 6807 | 6807 | * definitions. |
| 6808 | 6808 | */ |
| 6809 | - val facet : Option[FacetMapping] = None, | |
| 6809 | + val facet : FacetMapping, | |
| 6810 | 6810 | |
| 6811 | 6811 | /** |
| 6812 | 6812 | * A specification of the view that gets faceted. |
| 6813 | 6813 | */ |
| 6814 | - val spec : Option[Spec] = None, | |
| 6814 | + val spec : Spec, | |
| 6815 | 6815 | |
| 6816 | 6816 | /** |
| 6817 | 6817 | * An object that describes what fields should be repeated into views that are laid out as a |
| 6818 | 6818 | * `row` or `column`. |
| 6819 | 6819 | */ |
| 6820 | - val repeat : Option[Repeat] = None, | |
| 6820 | + val repeat : Repeat, | |
| 6821 | 6821 | |
| 6822 | 6822 | /** |
| 6823 | 6823 | * A list of views that should be concatenated and put into a column. |
| 6824 | 6824 | */ |
| 6825 | - val vconcat : Option[Seq[Spec]] = None, | |
| 6825 | + val vconcat : Seq[Spec], | |
| 6826 | 6826 | |
| 6827 | 6827 | /** |
| 6828 | 6828 | * A list of views that should be concatenated and put into a row. |
| 6829 | 6829 | */ |
| 6830 | - val hconcat : Option[Seq[Spec]] = None | |
| 6830 | + val hconcat : Seq[Spec] | |
| 6831 | 6831 | ) derives Encoder.AsObject, Decoder |
| 6832 | 6832 | |
| 6833 | 6833 | /** |
| @@ -6967,7 +6967,7 @@ case class LayerSpec ( | ||
| 6967 | 6967 | * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as |
| 6968 | 6968 | * layering facet specifications is not allowed. |
| 6969 | 6969 | */ |
| 6970 | - val layer : Option[Seq[LayerSpec]] = None, | |
| 6970 | + val layer : Seq[LayerSpec], | |
| 6971 | 6971 | |
| 6972 | 6972 | /** |
| 6973 | 6973 | * Name of the visualization for later reference. |
| @@ -7016,7 +7016,7 @@ case class LayerSpec ( | ||
| 7016 | 7016 | /** |
| 7017 | 7017 | * A key-value mapping between encoding channels and definition of fields. |
| 7018 | 7018 | */ |
| 7019 | - val encoding : Option[Encoding] = None, | |
| 7019 | + val encoding : Encoding, | |
| 7020 | 7020 | |
| 7021 | 7021 | /** |
| 7022 | 7022 | * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, |
| @@ -7024,7 +7024,7 @@ case class LayerSpec ( | ||
| 7024 | 7024 | * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition |
| 7025 | 7025 | * object](mark.html#mark-def). |
| 7026 | 7026 | */ |
| 7027 | - val mark : Option[AnyMark] = None, | |
| 7027 | + val mark : AnyMark, | |
| 7028 | 7028 | |
| 7029 | 7029 | /** |
| 7030 | 7030 | * An object defining properties of geographic projection. |
| @@ -7703,7 +7703,7 @@ case class Transform ( | ||
| 7703 | 7703 | * (3) a [selection predicate](filter.html#selection-predicate); |
| 7704 | 7704 | * or (4) a logical operand that combines (1), (2), or (3). |
| 7705 | 7705 | */ |
| 7706 | - val filter : Option[LogicalOperandPredicate] = None, | |
| 7706 | + val filter : LogicalOperandPredicate, | |
| 7707 | 7707 | |
| 7708 | 7708 | /** |
| 7709 | 7709 | * The field for storing the computed formula value. |
| @@ -7723,7 +7723,7 @@ case class Transform ( | ||
| 7723 | 7723 | * A [expression](types.html#expression) string. Use the variable `datum` to refer to the |
| 7724 | 7724 | * current data object. |
| 7725 | 7725 | */ |
| 7726 | - val calculate : Option[String] = None, | |
| 7726 | + val calculate : String, | |
| 7727 | 7727 | |
| 7728 | 7728 | /** |
| 7729 | 7729 | * The default value to use if lookup fails. |
| @@ -7735,34 +7735,34 @@ case class Transform ( | ||
| 7735 | 7735 | /** |
| 7736 | 7736 | * Secondary data reference. |
| 7737 | 7737 | */ |
| 7738 | - val from : Option[LookupData] = None, | |
| 7738 | + val from : LookupData, | |
| 7739 | 7739 | |
| 7740 | 7740 | /** |
| 7741 | 7741 | * Key in primary data source. |
| 7742 | 7742 | */ |
| 7743 | - val lookup : Option[String] = None, | |
| 7743 | + val lookup : String, | |
| 7744 | 7744 | |
| 7745 | 7745 | /** |
| 7746 | 7746 | * An object indicating bin properties, or simply `true` for using default bin parameters. |
| 7747 | 7747 | */ |
| 7748 | - val bin : Option[Bin] = None, | |
| 7748 | + val bin : Bin, | |
| 7749 | 7749 | |
| 7750 | 7750 | /** |
| 7751 | 7751 | * The data field to bin. |
| 7752 | 7752 | * |
| 7753 | 7753 | * The data field to apply time unit. |
| 7754 | 7754 | */ |
| 7755 | - val field : Option[String] = None, | |
| 7755 | + val field : String, | |
| 7756 | 7756 | |
| 7757 | 7757 | /** |
| 7758 | 7758 | * The timeUnit. |
| 7759 | 7759 | */ |
| 7760 | - val timeUnit : Option[TimeUnit] = None, | |
| 7760 | + val timeUnit : TimeUnit, | |
| 7761 | 7761 | |
| 7762 | 7762 | /** |
| 7763 | 7763 | * Array of objects that define fields to aggregate. |
| 7764 | 7764 | */ |
| 7765 | - val aggregate : Option[Seq[AggregatedFieldDef]] = None, | |
| 7765 | + val aggregate : Seq[AggregatedFieldDef], | |
| 7766 | 7766 | |
| 7767 | 7767 | /** |
| 7768 | 7768 | * The data fields to group by. If not specified, a single group containing all data objects |
Mschema-schemadefault / TopLevel.schema+98 −17
| @@ -114,7 +114,16 @@ | ||
| 114 | 114 | "description": "A list of views that should be concatenated and put into a row." |
| 115 | 115 | } |
| 116 | 116 | }, |
| 117 | - "required": [], | |
| 117 | + "required": [ | |
| 118 | + "encoding", | |
| 119 | + "facet", | |
| 120 | + "hconcat", | |
| 121 | + "layer", | |
| 122 | + "mark", | |
| 123 | + "repeat", | |
| 124 | + "spec", | |
| 125 | + "vconcat" | |
| 126 | + ], | |
| 118 | 127 | "title": "TopLevel" |
| 119 | 128 | }, |
| 120 | 129 | "AutoSizeParams": { |
| @@ -1306,7 +1315,10 @@ | ||
| 1306 | 1315 | "type": "number" |
| 1307 | 1316 | } |
| 1308 | 1317 | }, |
| 1309 | - "required": [], | |
| 1318 | + "required": [ | |
| 1319 | + "scheme", | |
| 1320 | + "step" | |
| 1321 | + ], | |
| 1310 | 1322 | "title": "RangeConfigValueVGScheme" |
| 1311 | 1323 | }, |
| 1312 | 1324 | "ScaleConfig": { |
| @@ -2187,7 +2199,11 @@ | ||
| 2187 | 2199 | "description": "Provide a placeholder name and bind data at runtime." |
| 2188 | 2200 | } |
| 2189 | 2201 | }, |
| 2190 | - "required": [], | |
| 2202 | + "required": [ | |
| 2203 | + "name", | |
| 2204 | + "url", | |
| 2205 | + "values" | |
| 2206 | + ], | |
| 2191 | 2207 | "title": "Data", |
| 2192 | 2208 | "description": "An object describing the data source\nSecondary data source to lookup in." |
| 2193 | 2209 | }, |
| @@ -2341,7 +2357,9 @@ | ||
| 2341 | 2357 | "description": "A constant value in visual domain." |
| 2342 | 2358 | } |
| 2343 | 2359 | }, |
| 2344 | - "required": [], | |
| 2360 | + "required": [ | |
| 2361 | + "type" | |
| 2362 | + ], | |
| 2345 | 2363 | "title": "MarkPropDefWithCondition", |
| 2346 | 2364 | "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}" |
| 2347 | 2365 | }, |
| @@ -2417,6 +2435,8 @@ | ||
| 2417 | 2435 | } |
| 2418 | 2436 | }, |
| 2419 | 2437 | "required": [ |
| 2438 | + "selection", | |
| 2439 | + "test", | |
| 2420 | 2440 | "value" |
| 2421 | 2441 | ], |
| 2422 | 2442 | "title": "ConditionalValueDef" |
| @@ -2476,7 +2496,12 @@ | ||
| 2476 | 2496 | "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." |
| 2477 | 2497 | } |
| 2478 | 2498 | }, |
| 2479 | - "required": [], | |
| 2499 | + "required": [ | |
| 2500 | + "selection", | |
| 2501 | + "test", | |
| 2502 | + "type", | |
| 2503 | + "value" | |
| 2504 | + ], | |
| 2480 | 2505 | "title": "ConditionalPredicateMarkPropFieldDefClass" |
| 2481 | 2506 | }, |
| 2482 | 2507 | "Selection": { |
| @@ -2499,7 +2524,11 @@ | ||
| 2499 | 2524 | } |
| 2500 | 2525 | } |
| 2501 | 2526 | }, |
| 2502 | - "required": [], | |
| 2527 | + "required": [ | |
| 2528 | + "and", | |
| 2529 | + "not", | |
| 2530 | + "or" | |
| 2531 | + ], | |
| 2503 | 2532 | "title": "Selection" |
| 2504 | 2533 | }, |
| 2505 | 2534 | "Predicate": { |
| @@ -2554,7 +2583,16 @@ | ||
| 2554 | 2583 | "description": "Filter using a selection name." |
| 2555 | 2584 | } |
| 2556 | 2585 | }, |
| 2557 | - "required": [], | |
| 2586 | + "required": [ | |
| 2587 | + "and", | |
| 2588 | + "equal", | |
| 2589 | + "field", | |
| 2590 | + "not", | |
| 2591 | + "oneOf", | |
| 2592 | + "or", | |
| 2593 | + "range", | |
| 2594 | + "selection" | |
| 2595 | + ], | |
| 2558 | 2596 | "title": "Predicate" |
| 2559 | 2597 | }, |
| 2560 | 2598 | "DateTime": { |
| @@ -3019,7 +3057,9 @@ | ||
| 3019 | 3057 | "description": "A constant value in visual domain." |
| 3020 | 3058 | } |
| 3021 | 3059 | }, |
| 3022 | - "required": [], | |
| 3060 | + "required": [ | |
| 3061 | + "type" | |
| 3062 | + ], | |
| 3023 | 3063 | "title": "DefWithCondition", |
| 3024 | 3064 | "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}" |
| 3025 | 3065 | }, |
| @@ -3059,7 +3099,12 @@ | ||
| 3059 | 3099 | "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." |
| 3060 | 3100 | } |
| 3061 | 3101 | }, |
| 3062 | - "required": [], | |
| 3102 | + "required": [ | |
| 3103 | + "selection", | |
| 3104 | + "test", | |
| 3105 | + "type", | |
| 3106 | + "value" | |
| 3107 | + ], | |
| 3063 | 3108 | "title": "ConditionalPredicateFieldDefClass" |
| 3064 | 3109 | }, |
| 3065 | 3110 | "OrderFieldDef": { |
| @@ -3140,7 +3185,9 @@ | ||
| 3140 | 3185 | "description": "A constant value in visual domain." |
| 3141 | 3186 | } |
| 3142 | 3187 | }, |
| 3143 | - "required": [], | |
| 3188 | + "required": [ | |
| 3189 | + "type" | |
| 3190 | + ], | |
| 3144 | 3191 | "title": "TextDefWithCondition", |
| 3145 | 3192 | "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}" |
| 3146 | 3193 | }, |
| @@ -3184,7 +3231,12 @@ | ||
| 3184 | 3231 | "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." |
| 3185 | 3232 | } |
| 3186 | 3233 | }, |
| 3187 | - "required": [], | |
| 3234 | + "required": [ | |
| 3235 | + "selection", | |
| 3236 | + "test", | |
| 3237 | + "type", | |
| 3238 | + "value" | |
| 3239 | + ], | |
| 3188 | 3240 | "title": "ConditionalPredicateTextFieldDefClass" |
| 3189 | 3241 | }, |
| 3190 | 3242 | "XClass": { |
| @@ -3246,7 +3298,10 @@ | ||
| 3246 | 3298 | "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)." |
| 3247 | 3299 | } |
| 3248 | 3300 | }, |
| 3249 | - "required": [], | |
| 3301 | + "required": [ | |
| 3302 | + "type", | |
| 3303 | + "value" | |
| 3304 | + ], | |
| 3250 | 3305 | "title": "XClass", |
| 3251 | 3306 | "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." |
| 3252 | 3307 | }, |
| @@ -3389,7 +3444,10 @@ | ||
| 3389 | 3444 | "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)." |
| 3390 | 3445 | } |
| 3391 | 3446 | }, |
| 3392 | - "required": [], | |
| 3447 | + "required": [ | |
| 3448 | + "type", | |
| 3449 | + "value" | |
| 3450 | + ], | |
| 3393 | 3451 | "title": "X2Class", |
| 3394 | 3452 | "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 | 3453 | }, |
| @@ -3502,7 +3560,16 @@ | ||
| 3502 | 3560 | "description": "A list of views that should be concatenated and put into a row." |
| 3503 | 3561 | } |
| 3504 | 3562 | }, |
| 3505 | - "required": [], | |
| 3563 | + "required": [ | |
| 3564 | + "encoding", | |
| 3565 | + "facet", | |
| 3566 | + "hconcat", | |
| 3567 | + "layer", | |
| 3568 | + "mark", | |
| 3569 | + "repeat", | |
| 3570 | + "spec", | |
| 3571 | + "vconcat" | |
| 3572 | + ], | |
| 3506 | 3573 | "title": "Spec", |
| 3507 | 3574 | "description": "Unit spec that can have a composite mark." |
| 3508 | 3575 | }, |
| @@ -3633,7 +3700,11 @@ | ||
| 3633 | 3700 | "description": "A key-value mapping between selection names and definitions." |
| 3634 | 3701 | } |
| 3635 | 3702 | }, |
| 3636 | - "required": [], | |
| 3703 | + "required": [ | |
| 3704 | + "encoding", | |
| 3705 | + "layer", | |
| 3706 | + "mark" | |
| 3707 | + ], | |
| 3637 | 3708 | "title": "LayerSpec", |
| 3638 | 3709 | "description": "Unit spec that can have a composite mark." |
| 3639 | 3710 | }, |
| @@ -4052,7 +4123,8 @@ | ||
| 4052 | 4123 | } |
| 4053 | 4124 | }, |
| 4054 | 4125 | "required": [ |
| 4055 | - "input" | |
| 4126 | + "input", | |
| 4127 | + "options" | |
| 4056 | 4128 | ], |
| 4057 | 4129 | "title": "VGBinding" |
| 4058 | 4130 | }, |
| @@ -4141,7 +4213,16 @@ | ||
| 4141 | 4213 | "description": "The data fields to group by. If not specified, a single group containing all data objects\nwill be used." |
| 4142 | 4214 | } |
| 4143 | 4215 | }, |
| 4144 | - "required": [], | |
| 4216 | + "required": [ | |
| 4217 | + "aggregate", | |
| 4218 | + "bin", | |
| 4219 | + "calculate", | |
| 4220 | + "field", | |
| 4221 | + "filter", | |
| 4222 | + "from", | |
| 4223 | + "lookup", | |
| 4224 | + "timeUnit" | |
| 4225 | + ], | |
| 4145 | 4226 | "title": "Transform" |
| 4146 | 4227 | }, |
| 4147 | 4228 | "AggregatedFieldDef": { |
Mschema-typescript-zoddefault / TopLevel.ts+86 −86
| @@ -588,40 +588,40 @@ export const SelectionDefTypeSchema = z.enum([ | ||
| 588 | 588 | export type SelectionDefType = z.infer<typeof SelectionDefTypeSchema>; |
| 589 | 589 | |
| 590 | 590 | export type Selection = { |
| 591 | - "not"?: Selection | string; | |
| 592 | - "and"?: Array<Selection | string>; | |
| 593 | - "or"?: Array<Selection | string>; | |
| 591 | + "not": Selection | string; | |
| 592 | + "and": Array<Selection | string>; | |
| 593 | + "or": Array<Selection | string>; | |
| 594 | 594 | }; |
| 595 | 595 | export const SelectionSchema: z.ZodType<Selection> = z.lazy(() => |
| 596 | 596 | z.object({ |
| 597 | - "not": z.union([SelectionSchema, z.string()]).optional(), | |
| 598 | - "and": z.array(z.union([SelectionSchema, z.string()])).optional(), | |
| 599 | - "or": z.array(z.union([SelectionSchema, z.string()])).optional(), | |
| 597 | + "not": z.union([SelectionSchema, z.string()]), | |
| 598 | + "and": z.array(z.union([SelectionSchema, z.string()])), | |
| 599 | + "or": z.array(z.union([SelectionSchema, z.string()])), | |
| 600 | 600 | }) |
| 601 | 601 | ); |
| 602 | 602 | |
| 603 | 603 | export type Predicate = { |
| 604 | - "not"?: Predicate | string; | |
| 605 | - "and"?: Array<Predicate | string>; | |
| 606 | - "or"?: Array<Predicate | string>; | |
| 607 | - "equal"?: boolean | DateTime | number | string; | |
| 608 | - "field"?: string; | |
| 604 | + "not": Predicate | string; | |
| 605 | + "and": Array<Predicate | string>; | |
| 606 | + "or": Array<Predicate | string>; | |
| 607 | + "equal": boolean | DateTime | number | string; | |
| 608 | + "field": string; | |
| 609 | 609 | "timeUnit"?: TimeUnit; |
| 610 | - "range"?: Array<DateTime | number | null>; | |
| 611 | - "oneOf"?: Array<boolean | DateTime | number | string>; | |
| 612 | - "selection"?: Selection | string; | |
| 610 | + "range": Array<DateTime | number | null>; | |
| 611 | + "oneOf": Array<boolean | DateTime | number | string>; | |
| 612 | + "selection": Selection | string; | |
| 613 | 613 | }; |
| 614 | 614 | export const PredicateSchema: z.ZodType<Predicate> = z.lazy(() => |
| 615 | 615 | z.object({ |
| 616 | - "not": z.union([PredicateSchema, z.string()]).optional(), | |
| 617 | - "and": z.array(z.union([PredicateSchema, z.string()])).optional(), | |
| 618 | - "or": z.array(z.union([PredicateSchema, z.string()])).optional(), | |
| 619 | - "equal": z.union([z.boolean(), DateTimeSchema, z.number(), z.string()]).optional(), | |
| 620 | - "field": z.string().optional(), | |
| 616 | + "not": z.union([PredicateSchema, z.string()]), | |
| 617 | + "and": z.array(z.union([PredicateSchema, z.string()])), | |
| 618 | + "or": z.array(z.union([PredicateSchema, z.string()])), | |
| 619 | + "equal": z.union([z.boolean(), DateTimeSchema, z.number(), z.string()]), | |
| 620 | + "field": z.string(), | |
| 621 | 621 | "timeUnit": TimeUnitSchema.optional(), |
| 622 | - "range": z.array(z.union([z.null(), DateTimeSchema, z.number()])).min(2).max(2).optional(), | |
| 623 | - "oneOf": z.array(z.union([z.boolean(), DateTimeSchema, z.number(), z.string()])).optional(), | |
| 624 | - "selection": z.union([SelectionSchema, z.string()]).optional(), | |
| 622 | + "range": z.array(z.union([z.null(), DateTimeSchema, z.number()])).min(2).max(2), | |
| 623 | + "oneOf": z.array(z.union([z.boolean(), DateTimeSchema, z.number(), z.string()])), | |
| 624 | + "selection": z.union([SelectionSchema, z.string()]), | |
| 625 | 625 | }) |
| 626 | 626 | ); |
| 627 | 627 | |
| @@ -629,42 +629,42 @@ export type Spec = { | ||
| 629 | 629 | "data"?: Data; |
| 630 | 630 | "description"?: string; |
| 631 | 631 | "height"?: number; |
| 632 | - "layer"?: Array<LayerSpec>; | |
| 632 | + "layer": Array<LayerSpec>; | |
| 633 | 633 | "name"?: string; |
| 634 | 634 | "resolve"?: Resolve; |
| 635 | 635 | "title"?: TitleParams | string; |
| 636 | 636 | "transform"?: Array<Transform>; |
| 637 | 637 | "width"?: number; |
| 638 | - "encoding"?: Encoding; | |
| 639 | - "mark"?: MarkDef | Mark; | |
| 638 | + "encoding": Encoding; | |
| 639 | + "mark": MarkDef | Mark; | |
| 640 | 640 | "projection"?: Projection; |
| 641 | 641 | "selection"?: Record<string, SelectionDef>; |
| 642 | - "facet"?: FacetMapping; | |
| 643 | - "spec"?: Spec; | |
| 644 | - "repeat"?: Repeat; | |
| 645 | - "vconcat"?: Array<Spec>; | |
| 646 | - "hconcat"?: Array<Spec>; | |
| 642 | + "facet": FacetMapping; | |
| 643 | + "spec": Spec; | |
| 644 | + "repeat": Repeat; | |
| 645 | + "vconcat": Array<Spec>; | |
| 646 | + "hconcat": Array<Spec>; | |
| 647 | 647 | }; |
| 648 | 648 | export const SpecSchema: z.ZodType<Spec> = z.lazy(() => |
| 649 | 649 | z.object({ |
| 650 | 650 | "data": DataSchema.optional(), |
| 651 | 651 | "description": z.string().optional(), |
| 652 | 652 | "height": z.number().optional(), |
| 653 | - "layer": z.array(LayerSpecSchema).optional(), | |
| 653 | + "layer": z.array(LayerSpecSchema), | |
| 654 | 654 | "name": z.string().optional(), |
| 655 | 655 | "resolve": ResolveSchema.optional(), |
| 656 | 656 | "title": z.union([TitleParamsSchema, z.string()]).optional(), |
| 657 | 657 | "transform": z.array(TransformSchema).optional(), |
| 658 | 658 | "width": z.number().optional(), |
| 659 | - "encoding": EncodingSchema.optional(), | |
| 660 | - "mark": z.union([MarkDefSchema, MarkSchema]).optional(), | |
| 659 | + "encoding": EncodingSchema, | |
| 660 | + "mark": z.union([MarkDefSchema, MarkSchema]), | |
| 661 | 661 | "projection": ProjectionSchema.optional(), |
| 662 | 662 | "selection": z.record(z.string(), SelectionDefSchema).optional(), |
| 663 | - "facet": FacetMappingSchema.optional(), | |
| 664 | - "spec": SpecSchema.optional(), | |
| 665 | - "repeat": RepeatSchema.optional(), | |
| 666 | - "vconcat": z.array(SpecSchema).optional(), | |
| 667 | - "hconcat": z.array(SpecSchema).optional(), | |
| 663 | + "facet": FacetMappingSchema, | |
| 664 | + "spec": SpecSchema, | |
| 665 | + "repeat": RepeatSchema, | |
| 666 | + "vconcat": z.array(SpecSchema), | |
| 667 | + "hconcat": z.array(SpecSchema), | |
| 668 | 668 | }) |
| 669 | 669 | ); |
| 670 | 670 | |
| @@ -672,14 +672,14 @@ export type LayerSpec = { | ||
| 672 | 672 | "data"?: Data; |
| 673 | 673 | "description"?: string; |
| 674 | 674 | "height"?: number; |
| 675 | - "layer"?: Array<LayerSpec>; | |
| 675 | + "layer": Array<LayerSpec>; | |
| 676 | 676 | "name"?: string; |
| 677 | 677 | "resolve"?: Resolve; |
| 678 | 678 | "title"?: TitleParams | string; |
| 679 | 679 | "transform"?: Array<Transform>; |
| 680 | 680 | "width"?: number; |
| 681 | - "encoding"?: Encoding; | |
| 682 | - "mark"?: MarkDef | Mark; | |
| 681 | + "encoding": Encoding; | |
| 682 | + "mark": MarkDef | Mark; | |
| 683 | 683 | "projection"?: Projection; |
| 684 | 684 | "selection"?: Record<string, SelectionDef>; |
| 685 | 685 | }; |
| @@ -688,14 +688,14 @@ export const LayerSpecSchema: z.ZodType<LayerSpec> = z.lazy(() => | ||
| 688 | 688 | "data": DataSchema.optional(), |
| 689 | 689 | "description": z.string().optional(), |
| 690 | 690 | "height": z.number().optional(), |
| 691 | - "layer": z.array(LayerSpecSchema).optional(), | |
| 691 | + "layer": z.array(LayerSpecSchema), | |
| 692 | 692 | "name": z.string().optional(), |
| 693 | 693 | "resolve": ResolveSchema.optional(), |
| 694 | 694 | "title": z.union([TitleParamsSchema, z.string()]).optional(), |
| 695 | 695 | "transform": z.array(TransformSchema).optional(), |
| 696 | 696 | "width": z.number().optional(), |
| 697 | - "encoding": EncodingSchema.optional(), | |
| 698 | - "mark": z.union([MarkDefSchema, MarkSchema]).optional(), | |
| 697 | + "encoding": EncodingSchema, | |
| 698 | + "mark": z.union([MarkDefSchema, MarkSchema]), | |
| 699 | 699 | "projection": ProjectionSchema.optional(), |
| 700 | 700 | "selection": z.record(z.string(), SelectionDefSchema).optional(), |
| 701 | 701 | }) |
| @@ -934,7 +934,7 @@ export type ProjectionConfig = z.infer<typeof ProjectionConfigSchema>; | ||
| 934 | 934 | export const VgSchemeSchema = z.object({ |
| 935 | 935 | "count": z.number().optional(), |
| 936 | 936 | "extent": z.array(z.number()).optional(), |
| 937 | - "scheme": z.string().optional(), | |
| 937 | + "scheme": z.string(), | |
| 938 | 938 | "step": z.number().optional(), |
| 939 | 939 | }); |
| 940 | 940 | export type VgScheme = z.infer<typeof VgSchemeSchema>; |
| @@ -987,7 +987,7 @@ export type MultiSelectionConfig = z.infer<typeof MultiSelectionConfigSchema>; | ||
| 987 | 987 | export const VgBindingSchema = z.object({ |
| 988 | 988 | "element": z.string().optional(), |
| 989 | 989 | "input": z.string(), |
| 990 | - "options": z.array(z.string()).optional(), | |
| 990 | + "options": z.array(z.string()), | |
| 991 | 991 | "max": z.number().optional(), |
| 992 | 992 | "min": z.number().optional(), |
| 993 | 993 | "step": z.number().optional(), |
| @@ -1147,9 +1147,9 @@ export const BinParamsSchema = z.object({ | ||
| 1147 | 1147 | export type BinParams = z.infer<typeof BinParamsSchema>; |
| 1148 | 1148 | |
| 1149 | 1149 | export const ConditionalValueDefSchema = z.object({ |
| 1150 | - "test": z.union([PredicateSchema, z.string()]).optional(), | |
| 1150 | + "test": z.union([PredicateSchema, z.string()]), | |
| 1151 | 1151 | "value": z.union([z.boolean(), z.number(), z.string()]), |
| 1152 | - "selection": z.union([SelectionSchema, z.string()]).optional(), | |
| 1152 | + "selection": z.union([SelectionSchema, z.string()]), | |
| 1153 | 1153 | }); |
| 1154 | 1154 | export type ConditionalValueDef = z.infer<typeof ConditionalValueDefSchema>; |
| 1155 | 1155 | |
| @@ -1235,14 +1235,14 @@ export const FieldDefSchema = z.object({ | ||
| 1235 | 1235 | export type FieldDef = z.infer<typeof FieldDefSchema>; |
| 1236 | 1236 | |
| 1237 | 1237 | export const ConditionalPredicateFieldDefClassSchema = z.object({ |
| 1238 | - "test": z.union([PredicateSchema, z.string()]).optional(), | |
| 1239 | - "value": z.union([z.boolean(), z.number(), z.string()]).optional(), | |
| 1240 | - "selection": z.union([SelectionSchema, z.string()]).optional(), | |
| 1238 | + "test": z.union([PredicateSchema, z.string()]), | |
| 1239 | + "value": z.union([z.boolean(), z.number(), z.string()]), | |
| 1240 | + "selection": z.union([SelectionSchema, z.string()]), | |
| 1241 | 1241 | "aggregate": AggregateOpSchema.optional(), |
| 1242 | 1242 | "bin": z.union([z.boolean(), BinParamsSchema]).optional(), |
| 1243 | 1243 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1244 | 1244 | "timeUnit": TimeUnitSchema.optional(), |
| 1245 | - "type": TypeSchema.optional(), | |
| 1245 | + "type": TypeSchema, | |
| 1246 | 1246 | }); |
| 1247 | 1247 | export type ConditionalPredicateFieldDefClass = z.infer<typeof ConditionalPredicateFieldDefClassSchema>; |
| 1248 | 1248 | |
| @@ -1257,15 +1257,15 @@ export const OrderFieldDefSchema = z.object({ | ||
| 1257 | 1257 | export type OrderFieldDef = z.infer<typeof OrderFieldDefSchema>; |
| 1258 | 1258 | |
| 1259 | 1259 | export const ConditionalPredicateTextFieldDefClassSchema = z.object({ |
| 1260 | - "test": z.union([PredicateSchema, z.string()]).optional(), | |
| 1261 | - "value": z.union([z.boolean(), z.number(), z.string()]).optional(), | |
| 1262 | - "selection": z.union([SelectionSchema, z.string()]).optional(), | |
| 1260 | + "test": z.union([PredicateSchema, z.string()]), | |
| 1261 | + "value": z.union([z.boolean(), z.number(), z.string()]), | |
| 1262 | + "selection": z.union([SelectionSchema, z.string()]), | |
| 1263 | 1263 | "aggregate": AggregateOpSchema.optional(), |
| 1264 | 1264 | "bin": z.union([z.boolean(), BinParamsSchema]).optional(), |
| 1265 | 1265 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1266 | 1266 | "format": z.string().optional(), |
| 1267 | 1267 | "timeUnit": TimeUnitSchema.optional(), |
| 1268 | - "type": TypeSchema.optional(), | |
| 1268 | + "type": TypeSchema, | |
| 1269 | 1269 | }); |
| 1270 | 1270 | export type ConditionalPredicateTextFieldDefClass = z.infer<typeof ConditionalPredicateTextFieldDefClassSchema>; |
| 1271 | 1271 | |
| @@ -1300,8 +1300,8 @@ export const X2ClassSchema = z.object({ | ||
| 1300 | 1300 | "bin": z.union([z.boolean(), BinParamsSchema]).optional(), |
| 1301 | 1301 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1302 | 1302 | "timeUnit": TimeUnitSchema.optional(), |
| 1303 | - "type": TypeSchema.optional(), | |
| 1304 | - "value": z.union([z.boolean(), z.number(), z.string()]).optional(), | |
| 1303 | + "type": TypeSchema, | |
| 1304 | + "value": z.union([z.boolean(), z.number(), z.string()]), | |
| 1305 | 1305 | }); |
| 1306 | 1306 | export type X2Class = z.infer<typeof X2ClassSchema>; |
| 1307 | 1307 | |
| @@ -1449,9 +1449,9 @@ export type SingleSelectionConfig = z.infer<typeof SingleSelectionConfigSchema>; | ||
| 1449 | 1449 | |
| 1450 | 1450 | export const DataSchema = z.object({ |
| 1451 | 1451 | "format": DataFormatSchema.optional(), |
| 1452 | - "url": z.string().optional(), | |
| 1453 | - "values": z.union([z.array(z.union([z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()])), z.record(z.string(), z.any()), z.string()]).optional(), | |
| 1454 | - "name": z.string().optional(), | |
| 1452 | + "url": z.string(), | |
| 1453 | + "values": z.union([z.array(z.union([z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()])), z.record(z.string(), z.any()), z.string()]), | |
| 1454 | + "name": z.string(), | |
| 1455 | 1455 | }); |
| 1456 | 1456 | export type Data = z.infer<typeof DataSchema>; |
| 1457 | 1457 | |
| @@ -1491,7 +1491,7 @@ export const DefWithConditionSchema = z.object({ | ||
| 1491 | 1491 | "condition": z.union([z.array(ConditionalValueDefSchema), ConditionalPredicateFieldDefClassSchema]).optional(), |
| 1492 | 1492 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1493 | 1493 | "timeUnit": TimeUnitSchema.optional(), |
| 1494 | - "type": TypeSchema.optional(), | |
| 1494 | + "type": TypeSchema, | |
| 1495 | 1495 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1496 | 1496 | }); |
| 1497 | 1497 | export type DefWithCondition = z.infer<typeof DefWithConditionSchema>; |
| @@ -1503,7 +1503,7 @@ export const TextDefWithConditionSchema = z.object({ | ||
| 1503 | 1503 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1504 | 1504 | "format": z.string().optional(), |
| 1505 | 1505 | "timeUnit": TimeUnitSchema.optional(), |
| 1506 | - "type": TypeSchema.optional(), | |
| 1506 | + "type": TypeSchema, | |
| 1507 | 1507 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1508 | 1508 | }); |
| 1509 | 1509 | export type TextDefWithCondition = z.infer<typeof TextDefWithConditionSchema>; |
| @@ -1517,8 +1517,8 @@ export const XClassSchema = z.object({ | ||
| 1517 | 1517 | "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(), |
| 1518 | 1518 | "stack": z.union([z.null(), StackOffsetSchema]).optional(), |
| 1519 | 1519 | "timeUnit": TimeUnitSchema.optional(), |
| 1520 | - "type": TypeSchema.optional(), | |
| 1521 | - "value": z.union([z.boolean(), z.number(), z.string()]).optional(), | |
| 1520 | + "type": TypeSchema, | |
| 1521 | + "value": z.union([z.boolean(), z.number(), z.string()]), | |
| 1522 | 1522 | }); |
| 1523 | 1523 | export type XClass = z.infer<typeof XClassSchema>; |
| 1524 | 1524 | |
| @@ -1550,9 +1550,9 @@ export const SelectionConfigSchema = z.object({ | ||
| 1550 | 1550 | export type SelectionConfig = z.infer<typeof SelectionConfigSchema>; |
| 1551 | 1551 | |
| 1552 | 1552 | export const ConditionalPredicateMarkPropFieldDefClassSchema = z.object({ |
| 1553 | - "test": z.union([PredicateSchema, z.string()]).optional(), | |
| 1554 | - "value": z.union([z.boolean(), z.number(), z.string()]).optional(), | |
| 1555 | - "selection": z.union([SelectionSchema, z.string()]).optional(), | |
| 1553 | + "test": z.union([PredicateSchema, z.string()]), | |
| 1554 | + "value": z.union([z.boolean(), z.number(), z.string()]), | |
| 1555 | + "selection": z.union([SelectionSchema, z.string()]), | |
| 1556 | 1556 | "aggregate": AggregateOpSchema.optional(), |
| 1557 | 1557 | "bin": z.union([z.boolean(), BinParamsSchema]).optional(), |
| 1558 | 1558 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| @@ -1560,21 +1560,21 @@ export const ConditionalPredicateMarkPropFieldDefClassSchema = z.object({ | ||
| 1560 | 1560 | "scale": ScaleSchema.optional(), |
| 1561 | 1561 | "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(), |
| 1562 | 1562 | "timeUnit": TimeUnitSchema.optional(), |
| 1563 | - "type": TypeSchema.optional(), | |
| 1563 | + "type": TypeSchema, | |
| 1564 | 1564 | }); |
| 1565 | 1565 | export type ConditionalPredicateMarkPropFieldDefClass = z.infer<typeof ConditionalPredicateMarkPropFieldDefClassSchema>; |
| 1566 | 1566 | |
| 1567 | 1567 | export const TransformSchema = z.object({ |
| 1568 | - "filter": z.union([PredicateSchema, z.string()]).optional(), | |
| 1568 | + "filter": z.union([PredicateSchema, z.string()]), | |
| 1569 | 1569 | "as": z.union([z.array(z.string()), z.string()]).optional(), |
| 1570 | - "calculate": z.string().optional(), | |
| 1570 | + "calculate": z.string(), | |
| 1571 | 1571 | "default": z.string().optional(), |
| 1572 | - "from": LookupDataSchema.optional(), | |
| 1573 | - "lookup": z.string().optional(), | |
| 1574 | - "bin": z.union([z.boolean(), BinParamsSchema]).optional(), | |
| 1575 | - "field": z.string().optional(), | |
| 1576 | - "timeUnit": TimeUnitSchema.optional(), | |
| 1577 | - "aggregate": z.array(AggregatedFieldDefSchema).optional(), | |
| 1572 | + "from": LookupDataSchema, | |
| 1573 | + "lookup": z.string(), | |
| 1574 | + "bin": z.union([z.boolean(), BinParamsSchema]), | |
| 1575 | + "field": z.string(), | |
| 1576 | + "timeUnit": TimeUnitSchema, | |
| 1577 | + "aggregate": z.array(AggregatedFieldDefSchema), | |
| 1578 | 1578 | "groupby": z.array(z.string()).optional(), |
| 1579 | 1579 | }); |
| 1580 | 1580 | export type Transform = z.infer<typeof TransformSchema>; |
| @@ -1629,7 +1629,7 @@ export const MarkPropDefWithConditionSchema = z.object({ | ||
| 1629 | 1629 | "scale": ScaleSchema.optional(), |
| 1630 | 1630 | "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(), |
| 1631 | 1631 | "timeUnit": TimeUnitSchema.optional(), |
| 1632 | - "type": TypeSchema.optional(), | |
| 1632 | + "type": TypeSchema, | |
| 1633 | 1633 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1634 | 1634 | }); |
| 1635 | 1635 | export type MarkPropDefWithCondition = z.infer<typeof MarkPropDefWithConditionSchema>; |
| @@ -1677,9 +1677,9 @@ export const TopLevelSchema = z.object({ | ||
| 1677 | 1677 | "config": ConfigSchema.optional(), |
| 1678 | 1678 | "data": DataSchema.optional(), |
| 1679 | 1679 | "description": z.string().optional(), |
| 1680 | - "encoding": EncodingWithFacetSchema.optional(), | |
| 1680 | + "encoding": EncodingWithFacetSchema, | |
| 1681 | 1681 | "height": z.number().optional(), |
| 1682 | - "mark": z.union([MarkDefSchema, MarkSchema]).optional(), | |
| 1682 | + "mark": z.union([MarkDefSchema, MarkSchema]), | |
| 1683 | 1683 | "name": z.string().optional(), |
| 1684 | 1684 | "padding": z.union([PaddingClassSchema, z.number()]).optional(), |
| 1685 | 1685 | "projection": ProjectionSchema.optional(), |
| @@ -1687,12 +1687,12 @@ export const TopLevelSchema = z.object({ | ||
| 1687 | 1687 | "title": z.union([TitleParamsSchema, z.string()]).optional(), |
| 1688 | 1688 | "transform": z.array(TransformSchema).optional(), |
| 1689 | 1689 | "width": z.number().optional(), |
| 1690 | - "layer": z.array(LayerSpecSchema).optional(), | |
| 1690 | + "layer": z.array(LayerSpecSchema), | |
| 1691 | 1691 | "resolve": ResolveSchema.optional(), |
| 1692 | - "facet": FacetMappingSchema.optional(), | |
| 1693 | - "spec": SpecSchema.optional(), | |
| 1694 | - "repeat": RepeatSchema.optional(), | |
| 1695 | - "vconcat": z.array(SpecSchema).optional(), | |
| 1696 | - "hconcat": z.array(SpecSchema).optional(), | |
| 1692 | + "facet": FacetMappingSchema, | |
| 1693 | + "spec": SpecSchema, | |
| 1694 | + "repeat": RepeatSchema, | |
| 1695 | + "vconcat": z.array(SpecSchema), | |
| 1696 | + "hconcat": z.array(SpecSchema), | |
| 1697 | 1697 | }); |
| 1698 | 1698 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
No generated files match these filters.