Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
37test cases
38files differ
36modified
2new
0deleted
2,322changed lines
+1,334 −988insertions / deletions
Base d3014aaec4f7ed11fb83168f39211b755deeeb1d · PR merge 9e46c70ef996f89c65c6b0255f5297281dff32be · Head 9f2b55d4f56524556ba75f8bc00b6763885b22b9 · raw patch
Test case

test/inputs/graphql/github1.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github2.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github3.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github4.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github5.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github6.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github7.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github8.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/graphql/github9.graphql

1 generated file · +2 −2
Mgraphql-golangdefault / quicktype.go+2 −2
@@ -19,8 +19,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Data *Data `json:"data"`
23- Errors []Error `json:"errors,omitempty"`
22+ Data *Data `json:"data"`
23+ Errors *[]Error `json:"errors,omitempty"`
2424 }
2525
2626 type Data struct {
Test case

test/inputs/json/misc/0a91a.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -45,7 +45,7 @@ type Actor struct {
4545 type Payload struct {
4646 Action *string `json:"action,omitempty"`
4747 Before *string `json:"before,omitempty"`
48- Commits []Commit `json:"commits,omitempty"`
48+ Commits *[]Commit `json:"commits,omitempty"`
4949 Description *string `json:"description"`
5050 DistinctSize *int64 `json:"distinct_size,omitempty"`
5151 Head *string `json:"head,omitempty"`
Test case

test/inputs/json/misc/26c9c.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -75,7 +75,7 @@ type Column struct {
7575 CachedContents *CachedContents `json:"cachedContents,omitempty"`
7676 DataTypeName string `json:"dataTypeName"`
7777 FieldName string `json:"fieldName"`
78- Flags []string `json:"flags,omitempty"`
78+ Flags *[]string `json:"flags,omitempty"`
7979 Format Format `json:"format"`
8080 ID int64 `json:"id"`
8181 Name string `json:"name"`
Test case

test/inputs/json/misc/421d4.json

1 generated file · +2 −2
Mgolangdefault / quicktype.go+2 −2
@@ -77,7 +77,7 @@ type Column struct {
7777 CachedContents *CachedContents `json:"cachedContents,omitempty"`
7878 DataTypeName string `json:"dataTypeName"`
7979 FieldName string `json:"fieldName"`
80- Flags []string `json:"flags,omitempty"`
80+ Flags *[]string `json:"flags,omitempty"`
8181 Format Query `json:"format"`
8282 ID int64 `json:"id"`
8383 Name string `json:"name"`
@@ -94,7 +94,7 @@ type CachedContents struct {
9494 Null int64 `json:"null"`
9595 Smallest *string `json:"smallest,omitempty"`
9696 Sum *string `json:"sum,omitempty"`
97- Top []Top `json:"top,omitempty"`
97+ Top *[]Top `json:"top,omitempty"`
9898 }
9999
100100 type Top struct {
Test case

test/inputs/json/misc/5f7fe.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -75,7 +75,7 @@ type Column struct {
7575 CachedContents *CachedContents `json:"cachedContents,omitempty"`
7676 DataTypeName TypeName `json:"dataTypeName"`
7777 FieldName string `json:"fieldName"`
78- Flags []string `json:"flags,omitempty"`
78+ Flags *[]string `json:"flags,omitempty"`
7979 Format Format `json:"format"`
8080 ID int64 `json:"id"`
8181 Name string `json:"name"`
Test case

test/inputs/json/misc/617e8.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -76,7 +76,7 @@ type Column struct {
7676 DataTypeName TypeName `json:"dataTypeName"`
7777 Description *string `json:"description,omitempty"`
7878 FieldName string `json:"fieldName"`
79- Flags []string `json:"flags,omitempty"`
79+ Flags *[]string `json:"flags,omitempty"`
8080 Format Format `json:"format"`
8181 ID int64 `json:"id"`
8282 Name string `json:"name"`
Test case

test/inputs/json/misc/65dec.json

1 generated file · +6 −6
Mgolangdefault / quicktype.go+6 −6
@@ -35,8 +35,8 @@ type TopLevel struct {
3535 type Card struct {
3636 Artist string `json:"artist"`
3737 Cmc int64 `json:"cmc"`
38- ColorIdentity []ColorIdentity `json:"colorIdentity,omitempty"`
39- Colors []Watermark `json:"colors,omitempty"`
38+ ColorIdentity *[]ColorIdentity `json:"colorIdentity,omitempty"`
39+ Colors *[]Watermark `json:"colors,omitempty"`
4040 Flavor *string `json:"flavor,omitempty"`
4141 ID string `json:"id"`
4242 ImageName string `json:"imageName"`
@@ -52,14 +52,14 @@ type Card struct {
5252 Printings []string `json:"printings"`
5353 Rarity Rarity `json:"rarity"`
5454 Reserved *bool `json:"reserved,omitempty"`
55- Rulings []Ruling `json:"rulings,omitempty"`
56- Subtypes []string `json:"subtypes,omitempty"`
57- Supertypes []string `json:"supertypes,omitempty"`
55+ Rulings *[]Ruling `json:"rulings,omitempty"`
56+ Subtypes *[]string `json:"subtypes,omitempty"`
57+ Supertypes *[]string `json:"supertypes,omitempty"`
5858 Text *string `json:"text,omitempty"`
5959 Toughness *string `json:"toughness,omitempty"`
6060 Type string `json:"type"`
6161 Types []Type `json:"types"`
62- Variations []int64 `json:"variations,omitempty"`
62+ Variations *[]int64 `json:"variations,omitempty"`
6363 Watermark *Watermark `json:"watermark,omitempty"`
6464 }
Test case

test/inputs/json/misc/a3d8c.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -74,7 +74,7 @@ type Column struct {
7474 CachedContents *CachedContents `json:"cachedContents,omitempty"`
7575 DataTypeName TypeName `json:"dataTypeName"`
7676 FieldName string `json:"fieldName"`
77- Flags []string `json:"flags,omitempty"`
77+ Flags *[]string `json:"flags,omitempty"`
7878 Format Query `json:"format"`
7979 ID int64 `json:"id"`
8080 Name string `json:"name"`
Test case

test/inputs/json/misc/dc44f.json

1 generated file · +6 −6
Mgolangdefault / quicktype.go+6 −6
@@ -35,8 +35,8 @@ type TopLevel struct {
3535 type Card struct {
3636 Artist string `json:"artist"`
3737 Cmc int64 `json:"cmc"`
38- ColorIdentity []ColorIdentity `json:"colorIdentity,omitempty"`
39- Colors []Color `json:"colors,omitempty"`
38+ ColorIdentity *[]ColorIdentity `json:"colorIdentity,omitempty"`
39+ Colors *[]Color `json:"colors,omitempty"`
4040 Flavor *string `json:"flavor,omitempty"`
4141 ID string `json:"id"`
4242 ImageName string `json:"imageName"`
@@ -52,14 +52,14 @@ type Card struct {
5252 Printings []string `json:"printings"`
5353 Rarity Rarity `json:"rarity"`
5454 Reserved *bool `json:"reserved,omitempty"`
55- Rulings []Ruling `json:"rulings,omitempty"`
56- Subtypes []string `json:"subtypes,omitempty"`
57- Supertypes []Supertype `json:"supertypes,omitempty"`
55+ Rulings *[]Ruling `json:"rulings,omitempty"`
56+ Subtypes *[]string `json:"subtypes,omitempty"`
57+ Supertypes *[]Supertype `json:"supertypes,omitempty"`
5858 Text *string `json:"text,omitempty"`
5959 Toughness *string `json:"toughness,omitempty"`
6060 Type string `json:"type"`
6161 Types []Type `json:"types"`
62- Variations []int64 `json:"variations,omitempty"`
62+ Variations *[]int64 `json:"variations,omitempty"`
6363 }
6464
6565 type LegalityElement struct {
Test case

test/inputs/json/misc/dd1ce.json

1 generated file · +6 −6
Mgolangdefault / quicktype.go+6 −6
@@ -35,8 +35,8 @@ type TopLevel struct {
3535 type Card struct {
3636 Artist string `json:"artist"`
3737 Cmc int64 `json:"cmc"`
38- ColorIdentity []ColorIdentity `json:"colorIdentity,omitempty"`
39- Colors []Color `json:"colors,omitempty"`
38+ ColorIdentity *[]ColorIdentity `json:"colorIdentity,omitempty"`
39+ Colors *[]Color `json:"colors,omitempty"`
4040 Flavor *string `json:"flavor,omitempty"`
4141 ID string `json:"id"`
4242 ImageName string `json:"imageName"`
@@ -52,14 +52,14 @@ type Card struct {
5252 Printings []string `json:"printings"`
5353 Rarity Rarity `json:"rarity"`
5454 Reserved *bool `json:"reserved,omitempty"`
55- Rulings []Ruling `json:"rulings,omitempty"`
56- Subtypes []string `json:"subtypes,omitempty"`
57- Supertypes []Supertype `json:"supertypes,omitempty"`
55+ Rulings *[]Ruling `json:"rulings,omitempty"`
56+ Subtypes *[]string `json:"subtypes,omitempty"`
57+ Supertypes *[]Supertype `json:"supertypes,omitempty"`
5858 Text *string `json:"text,omitempty"`
5959 Toughness *string `json:"toughness,omitempty"`
6060 Type string `json:"type"`
6161 Types []Type `json:"types"`
62- Variations []int64 `json:"variations,omitempty"`
62+ Variations *[]int64 `json:"variations,omitempty"`
6363 }
6464
6565 type LegalityElement struct {
Test case

test/inputs/json/misc/e8b04.json

1 generated file · +12 −12
Mgolangdefault / quicktype.go+12 −12
@@ -27,7 +27,7 @@ type TopLevelElement struct {
2727 Description *string `json:"description,omitempty"`
2828 DisplayType *DisplayType `json:"displayType,omitempty"`
2929 DownloadCount int64 `json:"downloadCount"`
30- Flags []TopLevelFlag `json:"flags,omitempty"`
30+ Flags *[]TopLevelFlag `json:"flags,omitempty"`
3131 Grants []Grant `json:"grants"`
3232 HideFromCatalog bool `json:"hideFromCatalog"`
3333 HideFromDataJSON bool `json:"hideFromDataJson"`
@@ -56,7 +56,7 @@ type TopLevelElement struct {
5656 RowsUpdatedBy *RowsUpdatedBy `json:"rowsUpdatedBy,omitempty"`
5757 TableAuthor TableAuthor `json:"tableAuthor"`
5858 TableID int64 `json:"tableId"`
59- Tags []string `json:"tags,omitempty"`
59+ Tags *[]string `json:"tags,omitempty"`
6060 TotalTimesRated int64 `json:"totalTimesRated"`
6161 ViewCount int64 `json:"viewCount"`
6262 ViewLastModified int64 `json:"viewLastModified"`
@@ -70,7 +70,7 @@ type Grant struct {
7070 }
7171
7272 type TopLevelMetadata struct {
73- AvailableDisplayTypes []DisplayType `json:"availableDisplayTypes,omitempty"`
73+ AvailableDisplayTypes *[]DisplayType `json:"availableDisplayTypes,omitempty"`
7474 CustomFields *CustomFields `json:"custom_fields,omitempty"`
7575 JSONQuery *JSONQuery `json:"jsonQuery,omitempty"`
7676 RDFClass *string `json:"rdfClass,omitempty"`
@@ -91,10 +91,10 @@ type Test struct {
9191 }
9292
9393 type JSONQuery struct {
94- Group []Group `json:"group,omitempty"`
95- Order []Order `json:"order,omitempty"`
96- Select []Select `json:"select,omitempty"`
97- Where *Where `json:"where,omitempty"`
94+ Group *[]Group `json:"group,omitempty"`
95+ Order *[]Order `json:"order,omitempty"`
96+ Select *[]Select `json:"select,omitempty"`
97+ Where *Where `json:"where,omitempty"`
9898 }
9999
100100 type Group struct {
@@ -112,7 +112,7 @@ type Select struct {
112112 }
113113
114114 type Where struct {
115- Children []Child `json:"children,omitempty"`
115+ Children *[]Child `json:"children,omitempty"`
116116 ColumnFieldName *ChildColumnFieldName `json:"columnFieldName,omitempty"`
117117 Metadata *ChildMetadata `json:"metadata,omitempty"`
118118 Operator WhereOperator `json:"operator"`
@@ -127,7 +127,7 @@ type Child struct {
127127 }
128128
129129 type ChildMetadata struct {
130- CustomValues []string `json:"customValues,omitempty"`
130+ CustomValues *[]string `json:"customValues,omitempty"`
131131 Freeform *bool `json:"freeform,omitempty"`
132132 IncludeAuto *int64 `json:"includeAuto,omitempty"`
133133 Operator *MetadataOperator `json:"operator,omitempty"`
@@ -194,13 +194,13 @@ type FluffyVisible struct {
194194
195195 type Owner struct {
196196 DisplayName string `json:"displayName"`
197- Flags []string `json:"flags,omitempty"`
197+ Flags *[]string `json:"flags,omitempty"`
198198 ID string `json:"id"`
199199 LastNotificationSeenAt *int64 `json:"lastNotificationSeenAt,omitempty"`
200200 ProfileImageURLLarge *string `json:"profileImageUrlLarge,omitempty"`
201201 ProfileImageURLMedium *string `json:"profileImageUrlMedium,omitempty"`
202202 ProfileImageURLSmall *string `json:"profileImageUrlSmall,omitempty"`
203- Rights []string `json:"rights,omitempty"`
203+ Rights *[]string `json:"rights,omitempty"`
204204 RoleName *RoleName `json:"roleName,omitempty"`
205205 ScreenName string `json:"screenName"`
206206 }
@@ -212,7 +212,7 @@ type Ratings struct {
212212 type TableAuthor struct {
213213 DisplayName string `json:"displayName"`
214214 ID string `json:"id"`
215- Rights []string `json:"rights,omitempty"`
215+ Rights *[]string `json:"rights,omitempty"`
216216 RoleName *RoleName `json:"roleName,omitempty"`
217217 ScreenName string `json:"screenName"`
218218 }
Test case

test/inputs/json/misc/f74d5.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -74,7 +74,7 @@ type Column struct {
7474 CachedContents *CachedContents `json:"cachedContents,omitempty"`
7575 DataTypeName TypeName `json:"dataTypeName"`
7676 FieldName string `json:"fieldName"`
77- Flags []string `json:"flags,omitempty"`
77+ Flags *[]string `json:"flags,omitempty"`
7878 Format Query `json:"format"`
7979 ID int64 `json:"id"`
8080 Name string `json:"name"`
Test case

test/inputs/json/misc/fcca3.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -75,7 +75,7 @@ type Column struct {
7575 DataTypeName TypeName `json:"dataTypeName"`
7676 Description *string `json:"description,omitempty"`
7777 FieldName string `json:"fieldName"`
78- Flags []string `json:"flags,omitempty"`
78+ Flags *[]string `json:"flags,omitempty"`
7979 Format Format `json:"format"`
8080 ID int64 `json:"id"`
8181 Name string `json:"name"`
Test case

test/inputs/json/priority/bug427.json

1 generated file · +138 −138
Mgolangdefault / quicktype.go+138 −138
@@ -41,56 +41,56 @@ type TopLevelChild struct {
4141 }
4242
4343 type PurpleChild struct {
44- Children []FluffyChild `json:"children,omitempty"`
45- Comment *StickyComment `json:"comment,omitempty"`
46- DefaultValue *string `json:"defaultValue,omitempty"`
47- ExtendedBy []ExtendedBy `json:"extendedBy,omitempty"`
48- ExtendedTypes []ExtendedBy `json:"extendedTypes,omitempty"`
49- Flags IndecentFlags `json:"flags"`
50- Groups []Group `json:"groups,omitempty"`
51- ID int64 `json:"id"`
52- ImplementedBy []ExtendedBy `json:"implementedBy,omitempty"`
53- ImplementedTypes []ExtendedBy `json:"implementedTypes,omitempty"`
54- Kind int64 `json:"kind"`
55- KindString FluffyKindString `json:"kindString"`
56- Name string `json:"name"`
57- Signatures []StickySignature `json:"signatures,omitempty"`
58- Sources []Source `json:"sources"`
59- Type *MagentaType `json:"type,omitempty"`
60- TypeParameter []TypeParameterElement `json:"typeParameter,omitempty"`
44+ Children *[]FluffyChild `json:"children,omitempty"`
45+ Comment *StickyComment `json:"comment,omitempty"`
46+ DefaultValue *string `json:"defaultValue,omitempty"`
47+ ExtendedBy *[]ExtendedBy `json:"extendedBy,omitempty"`
48+ ExtendedTypes *[]ExtendedBy `json:"extendedTypes,omitempty"`
49+ Flags IndecentFlags `json:"flags"`
50+ Groups *[]Group `json:"groups,omitempty"`
51+ ID int64 `json:"id"`
52+ ImplementedBy *[]ExtendedBy `json:"implementedBy,omitempty"`
53+ ImplementedTypes *[]ExtendedBy `json:"implementedTypes,omitempty"`
54+ Kind int64 `json:"kind"`
55+ KindString FluffyKindString `json:"kindString"`
56+ Name string `json:"name"`
57+ Signatures *[]StickySignature `json:"signatures,omitempty"`
58+ Sources []Source `json:"sources"`
59+ Type *MagentaType `json:"type,omitempty"`
60+ TypeParameter *[]TypeParameterElement `json:"typeParameter,omitempty"`
6161 }
6262
6363 type FluffyChild struct {
64- Children []TentacledChild `json:"children,omitempty"`
65- Comment *StickyComment `json:"comment,omitempty"`
66- DefaultValue *string `json:"defaultValue,omitempty"`
67- Flags StickyFlags `json:"flags"`
68- GetSignature *GetSignature `json:"getSignature,omitempty"`
69- Groups []Group `json:"groups,omitempty"`
70- ID int64 `json:"id"`
71- ImplementationOf *ExtendedBy `json:"implementationOf,omitempty"`
72- InheritedFrom *ExtendedBy `json:"inheritedFrom,omitempty"`
73- Kind int64 `json:"kind"`
74- KindString PurpleKindString `json:"kindString"`
75- Name string `json:"name"`
76- Overwrites *ExtendedBy `json:"overwrites,omitempty"`
77- SetSignature *GetSignature `json:"setSignature,omitempty"`
78- Signatures []FluffySignature `json:"signatures,omitempty"`
79- Sources []Source `json:"sources"`
80- Type *IndigoType `json:"type,omitempty"`
64+ Children *[]TentacledChild `json:"children,omitempty"`
65+ Comment *StickyComment `json:"comment,omitempty"`
66+ DefaultValue *string `json:"defaultValue,omitempty"`
67+ Flags StickyFlags `json:"flags"`
68+ GetSignature *GetSignature `json:"getSignature,omitempty"`
69+ Groups *[]Group `json:"groups,omitempty"`
70+ ID int64 `json:"id"`
71+ ImplementationOf *ExtendedBy `json:"implementationOf,omitempty"`
72+ InheritedFrom *ExtendedBy `json:"inheritedFrom,omitempty"`
73+ Kind int64 `json:"kind"`
74+ KindString PurpleKindString `json:"kindString"`
75+ Name string `json:"name"`
76+ Overwrites *ExtendedBy `json:"overwrites,omitempty"`
77+ SetSignature *GetSignature `json:"setSignature,omitempty"`
78+ Signatures *[]FluffySignature `json:"signatures,omitempty"`
79+ Sources []Source `json:"sources"`
80+ Type *IndigoType `json:"type,omitempty"`
8181 }
8282
8383 type TentacledChild struct {
84- Comment *PurpleComment `json:"comment,omitempty"`
85- DefaultValue *string `json:"defaultValue,omitempty"`
86- Flags PurpleFlags `json:"flags"`
87- ID int64 `json:"id"`
88- Kind int64 `json:"kind"`
89- KindString PurpleKindString `json:"kindString"`
90- Name string `json:"name"`
91- Signatures []PurpleSignature `json:"signatures,omitempty"`
92- Sources []Source `json:"sources"`
93- Type *TypeElement `json:"type,omitempty"`
84+ Comment *PurpleComment `json:"comment,omitempty"`
85+ DefaultValue *string `json:"defaultValue,omitempty"`
86+ Flags PurpleFlags `json:"flags"`
87+ ID int64 `json:"id"`
88+ Kind int64 `json:"kind"`
89+ KindString PurpleKindString `json:"kindString"`
90+ Name string `json:"name"`
91+ Signatures *[]PurpleSignature `json:"signatures,omitempty"`
92+ Sources []Source `json:"sources"`
93+ Type *TypeElement `json:"type,omitempty"`
9494 }
9595
9696 type PurpleComment struct {
@@ -128,7 +128,7 @@ type IndexSignatureElement struct {
128128 Kind int64 `json:"kind"`
129129 KindString string `json:"kindString"`
130130 Name string `json:"name"`
131- Parameters []GetSignature `json:"parameters,omitempty"`
131+ Parameters *[]GetSignature `json:"parameters,omitempty"`
132132 Type PurpleType `json:"type"`
133133 }
134134
@@ -150,20 +150,20 @@ type GetSignatureChild struct {
150150 }
151151
152152 type GetSignature struct {
153- Children []GetSignatureChild `json:"children,omitempty"`
154- Comment *GetSignatureComment `json:"comment,omitempty"`
155- DefaultValue *string `json:"defaultValue,omitempty"`
156- Flags GetSignatureFlags `json:"flags"`
157- Groups []Group `json:"groups,omitempty"`
158- ID int64 `json:"id"`
159- Kind int64 `json:"kind"`
160- KindString string `json:"kindString"`
161- Name string `json:"name"`
162- Parameters []GetSignatureParameter `json:"parameters,omitempty"`
163- Signatures []IndexSignatureElement `json:"signatures,omitempty"`
164- Sources []Source `json:"sources,omitempty"`
165- Type *GetSignatureType `json:"type,omitempty"`
166- TypeParameter []GetSignature `json:"typeParameter,omitempty"`
153+ Children *[]GetSignatureChild `json:"children,omitempty"`
154+ Comment *GetSignatureComment `json:"comment,omitempty"`
155+ DefaultValue *string `json:"defaultValue,omitempty"`
156+ Flags GetSignatureFlags `json:"flags"`
157+ Groups *[]Group `json:"groups,omitempty"`
158+ ID int64 `json:"id"`
159+ Kind int64 `json:"kind"`
160+ KindString string `json:"kindString"`
161+ Name string `json:"name"`
162+ Parameters *[]GetSignatureParameter `json:"parameters,omitempty"`
163+ Signatures *[]IndexSignatureElement `json:"signatures,omitempty"`
164+ Sources *[]Source `json:"sources,omitempty"`
165+ Type *GetSignatureType `json:"type,omitempty"`
166+ TypeParameter *[]GetSignature `json:"typeParameter,omitempty"`
167167 }
168168
169169 type ElementType struct {
@@ -218,10 +218,10 @@ type TentacledFlags struct {
218218 }
219219
220220 type FluffyType struct {
221- ElementType *ElementType `json:"elementType,omitempty"`
222- Name *Name `json:"name,omitempty"`
223- Type TypeEnum `json:"type"`
224- TypeArguments []ElementType `json:"typeArguments,omitempty"`
221+ ElementType *ElementType `json:"elementType,omitempty"`
222+ Name *Name `json:"name,omitempty"`
223+ Type TypeEnum `json:"type"`
224+ TypeArguments *[]ElementType `json:"typeArguments,omitempty"`
225225 }
226226
227227 type TentacledType struct {
@@ -241,17 +241,17 @@ type PurpleDeclaration struct {
241241 }
242242
243243 type TypeElement struct {
244- Declaration *GetSignature `json:"declaration,omitempty"`
245- ElementType *ElementType `json:"elementType,omitempty"`
246- Name *Name `json:"name,omitempty"`
247- Type TypeEnum `json:"type"`
248- TypeArguments []ElementType `json:"typeArguments,omitempty"`
244+ Declaration *GetSignature `json:"declaration,omitempty"`
245+ ElementType *ElementType `json:"elementType,omitempty"`
246+ Name *Name `json:"name,omitempty"`
247+ Type TypeEnum `json:"type"`
248+ TypeArguments *[]ElementType `json:"typeArguments,omitempty"`
249249 }
250250
251251 type StickyComment struct {
252252 Returns *string `json:"returns,omitempty"`
253253 ShortText *string `json:"shortText,omitempty"`
254- Tags []Tag `json:"tags,omitempty"`
254+ Tags *[]Tag `json:"tags,omitempty"`
255255 Text *string `json:"text,omitempty"`
256256 }
257257
@@ -271,11 +271,11 @@ type StickyFlags struct {
271271 }
272272
273273 type ExtendedBy struct {
274- Constraint *ExtendedBy `json:"constraint,omitempty"`
275- ID *int64 `json:"id,omitempty"`
276- Name string `json:"name"`
277- Type TypeEnum `json:"type"`
278- TypeArguments []ExtendedBy `json:"typeArguments,omitempty"`
274+ Constraint *ExtendedBy `json:"constraint,omitempty"`
275+ ID *int64 `json:"id,omitempty"`
276+ Name string `json:"name"`
277+ Type TypeEnum `json:"type"`
278+ TypeArguments *[]ExtendedBy `json:"typeArguments,omitempty"`
279279 }
280280
281281 type FluffySignature struct {
@@ -288,9 +288,9 @@ type FluffySignature struct {
288288 KindString SignatureKindString `json:"kindString"`
289289 Name string `json:"name"`
290290 Overwrites *ExtendedBy `json:"overwrites,omitempty"`
291- Parameters []PurpleParameter `json:"parameters,omitempty"`
291+ Parameters *[]PurpleParameter `json:"parameters,omitempty"`
292292 Type ExtendedBy `json:"type"`
293- TypeParameter []GetSignature `json:"typeParameter,omitempty"`
293+ TypeParameter *[]GetSignature `json:"typeParameter,omitempty"`
294294 }
295295
296296 type IndigoFlags struct {
@@ -309,39 +309,39 @@ type PurpleParameter struct {
309309 }
310310
311311 type StickyType struct {
312- Constraint *ExtendedBy `json:"constraint,omitempty"`
313- Declaration *GetSignature `json:"declaration,omitempty"`
314- ElementType *ElementType `json:"elementType,omitempty"`
315- Elements []ExtendedBy `json:"elements,omitempty"`
316- ID *int64 `json:"id,omitempty"`
317- Name *string `json:"name,omitempty"`
318- Type TypeEnum `json:"type"`
319- TypeArguments []ElementType `json:"typeArguments,omitempty"`
312+ Constraint *ExtendedBy `json:"constraint,omitempty"`
313+ Declaration *GetSignature `json:"declaration,omitempty"`
314+ ElementType *ElementType `json:"elementType,omitempty"`
315+ Elements *[]ExtendedBy `json:"elements,omitempty"`
316+ ID *int64 `json:"id,omitempty"`
317+ Name *string `json:"name,omitempty"`
318+ Type TypeEnum `json:"type"`
319+ TypeArguments *[]ElementType `json:"typeArguments,omitempty"`
320320 }
321321
322322 type IndigoType struct {
323- Constraint *ExtendedBy `json:"constraint,omitempty"`
324- Declaration *FluffyDeclaration `json:"declaration,omitempty"`
325- ElementType *ExtendedBy `json:"elementType,omitempty"`
326- Elements []ElementType `json:"elements,omitempty"`
327- ID *int64 `json:"id,omitempty"`
328- Name *string `json:"name,omitempty"`
329- Type TypeEnum `json:"type"`
330- TypeArguments []PurpleTypeArgument `json:"typeArguments,omitempty"`
331- Types []TypeElement `json:"types,omitempty"`
323+ Constraint *ExtendedBy `json:"constraint,omitempty"`
324+ Declaration *FluffyDeclaration `json:"declaration,omitempty"`
325+ ElementType *ExtendedBy `json:"elementType,omitempty"`
326+ Elements *[]ElementType `json:"elements,omitempty"`
327+ ID *int64 `json:"id,omitempty"`
328+ Name *string `json:"name,omitempty"`
329+ Type TypeEnum `json:"type"`
330+ TypeArguments *[]PurpleTypeArgument `json:"typeArguments,omitempty"`
331+ Types *[]TypeElement `json:"types,omitempty"`
332332 }
333333
334334 type FluffyDeclaration struct {
335- Children []StickyChild `json:"children,omitempty"`
336- Flags GetSignatureFlags `json:"flags"`
337- Groups []Group `json:"groups,omitempty"`
338- ID int64 `json:"id"`
339- IndexSignature *IndexSignature `json:"indexSignature,omitempty"`
340- Kind int64 `json:"kind"`
341- KindString string `json:"kindString"`
342- Name string `json:"name"`
343- Signatures []TentacledSignature `json:"signatures,omitempty"`
344- Sources []Source `json:"sources"`
335+ Children *[]StickyChild `json:"children,omitempty"`
336+ Flags GetSignatureFlags `json:"flags"`
337+ Groups *[]Group `json:"groups,omitempty"`
338+ ID int64 `json:"id"`
339+ IndexSignature *IndexSignature `json:"indexSignature,omitempty"`
340+ Kind int64 `json:"kind"`
341+ KindString string `json:"kindString"`
342+ Name string `json:"name"`
343+ Signatures *[]TentacledSignature `json:"signatures,omitempty"`
344+ Sources []Source `json:"sources"`
345345 }
346346
347347 type StickyChild struct {
@@ -356,10 +356,10 @@ type StickyChild struct {
356356 }
357357
358358 type IndecentType struct {
359- Declaration *GetSignature `json:"declaration,omitempty"`
360- Elements []ElementType `json:"elements,omitempty"`
361- Name *Name `json:"name,omitempty"`
362- Type TypeEnum `json:"type"`
359+ Declaration *GetSignature `json:"declaration,omitempty"`
360+ Elements *[]ElementType `json:"elements,omitempty"`
361+ Name *Name `json:"name,omitempty"`
362+ Type TypeEnum `json:"type"`
363363 }
364364
365365 type IndexSignature struct {
@@ -384,7 +384,7 @@ type TentacledSignature struct {
384384 Kind int64 `json:"kind"`
385385 KindString SignatureKindString `json:"kindString"`
386386 Name string `json:"name"`
387- Parameters []FluffyParameter `json:"parameters,omitempty"`
387+ Parameters *[]FluffyParameter `json:"parameters,omitempty"`
388388 Type ExtendedBy `json:"type"`
389389 }
390390
@@ -400,7 +400,7 @@ type FluffyParameter struct {
400400 Kind int64 `json:"kind"`
401401 KindString string `json:"kindString"`
402402 Name string `json:"name"`
403- Sources []Source `json:"sources,omitempty"`
403+ Sources *[]Source `json:"sources,omitempty"`
404404 Type ElementType `json:"type"`
405405 }
406406
@@ -421,15 +421,15 @@ type IndecentFlags struct {
421421 }
422422
423423 type StickySignature struct {
424- Comment StickyComment `json:"comment"`
425- Flags IndigoFlags `json:"flags"`
426- ID int64 `json:"id"`
427- Kind int64 `json:"kind"`
428- KindString SignatureKindString `json:"kindString"`
429- Name string `json:"name"`
430- Parameters []TentacledParameter `json:"parameters,omitempty"`
431- Type CunningType `json:"type"`
432- TypeParameter []GetSignature `json:"typeParameter,omitempty"`
424+ Comment StickyComment `json:"comment"`
425+ Flags IndigoFlags `json:"flags"`
426+ ID int64 `json:"id"`
427+ Kind int64 `json:"kind"`
428+ KindString SignatureKindString `json:"kindString"`
429+ Name string `json:"name"`
430+ Parameters *[]TentacledParameter `json:"parameters,omitempty"`
431+ Type CunningType `json:"type"`
432+ TypeParameter *[]GetSignature `json:"typeParameter,omitempty"`
433433 }
434434
435435 type TentacledParameter struct {
@@ -450,19 +450,19 @@ type AmbitiousType struct {
450450 ID *int64 `json:"id,omitempty"`
451451 Name *string `json:"name,omitempty"`
452452 Type TypeEnum `json:"type"`
453- TypeArguments []ElementType `json:"typeArguments,omitempty"`
453+ TypeArguments *[]ElementType `json:"typeArguments,omitempty"`
454454 }
455455
456456 type TentacledDeclaration struct {
457- Children []IndigoChild `json:"children,omitempty"`
457+ Children *[]IndigoChild `json:"children,omitempty"`
458458 Flags GetSignatureFlags `json:"flags"`
459- Groups []Group `json:"groups,omitempty"`
459+ Groups *[]Group `json:"groups,omitempty"`
460460 ID int64 `json:"id"`
461461 IndexSignature *IndexSignatureElement `json:"indexSignature,omitempty"`
462462 Kind int64 `json:"kind"`
463463 KindString string `json:"kindString"`
464464 Name string `json:"name"`
465- Signatures []GetSignature `json:"signatures,omitempty"`
465+ Signatures *[]GetSignature `json:"signatures,omitempty"`
466466 Sources []Source `json:"sources"`
467467 }
468468
@@ -483,25 +483,25 @@ type CunningType struct {
483483 ID *int64 `json:"id,omitempty"`
484484 Name *Name `json:"name,omitempty"`
485485 Type TypeEnum `json:"type"`
486- TypeArguments []ElementType `json:"typeArguments,omitempty"`
486+ TypeArguments *[]ElementType `json:"typeArguments,omitempty"`
487487 }
488488
489489 type MagentaType struct {
490- Declaration *StickyDeclaration `json:"declaration,omitempty"`
491- ElementType *ElementType `json:"elementType,omitempty"`
492- Elements []ExtendedBy `json:"elements,omitempty"`
493- ID *int64 `json:"id,omitempty"`
494- Name *string `json:"name,omitempty"`
495- Type TypeEnum `json:"type"`
496- TypeArguments []FluffyTypeArgument `json:"typeArguments,omitempty"`
497- Types []ExtendedBy `json:"types,omitempty"`
498- Value *string `json:"value,omitempty"`
490+ Declaration *StickyDeclaration `json:"declaration,omitempty"`
491+ ElementType *ElementType `json:"elementType,omitempty"`
492+ Elements *[]ExtendedBy `json:"elements,omitempty"`
493+ ID *int64 `json:"id,omitempty"`
494+ Name *string `json:"name,omitempty"`
495+ Type TypeEnum `json:"type"`
496+ TypeArguments *[]FluffyTypeArgument `json:"typeArguments,omitempty"`
497+ Types *[]ExtendedBy `json:"types,omitempty"`
498+ Value *string `json:"value,omitempty"`
499499 }
500500
501501 type StickyDeclaration struct {
502- Children []IndecentChild `json:"children,omitempty"`
502+ Children *[]IndecentChild `json:"children,omitempty"`
503503 Flags GetSignatureFlags `json:"flags"`
504- Groups []Group `json:"groups,omitempty"`
504+ Groups *[]Group `json:"groups,omitempty"`
505505 ID int64 `json:"id"`
506506 Kind int64 `json:"kind"`
507507 KindString string `json:"kindString"`
@@ -527,14 +527,14 @@ type FriskyType struct {
527527 }
528528
529529 type IndigoDeclaration struct {
530- Children []GetSignature `json:"children,omitempty"`
530+ Children *[]GetSignature `json:"children,omitempty"`
531531 Flags GetSignatureFlags `json:"flags"`
532- Groups []Group `json:"groups,omitempty"`
532+ Groups *[]Group `json:"groups,omitempty"`
533533 ID int64 `json:"id"`
534534 Kind int64 `json:"kind"`
535535 KindString string `json:"kindString"`
536536 Name string `json:"name"`
537- Signatures []GetSignature `json:"signatures,omitempty"`
537+ Signatures *[]GetSignature `json:"signatures,omitempty"`
538538 Sources []Source `json:"sources"`
539539 }
540540
@@ -563,7 +563,7 @@ type MischievousType struct {
563563
564564 type IndecentComment struct {
565565 ShortText string `json:"shortText"`
566- Tags []Tag `json:"tags,omitempty"`
566+ Tags *[]Tag `json:"tags,omitempty"`
567567 }
568568
569569 type PurpleKindString string
Test case

test/inputs/json/priority/nbl-stats.json

1 generated file · +1 −1
Mgolangdefault / quicktype.go+1 −1
@@ -110,7 +110,7 @@ type Scorer struct {
110110 ScoreboardName *ScoreboardNameEnum `json:"scoreboardName,omitempty"`
111111 ShirtNumber string `json:"shirtNumber"`
112112 Summary *string `json:"summary,omitempty"`
113- Times []Time `json:"times,omitempty"`
113+ Times *[]Time `json:"times,omitempty"`
114114 Tno int64 `json:"tno"`
115115 Tot *int64 `json:"tot,omitempty"`
116116 }
Test case

test/inputs/json/priority/recursive.json

1 generated file · +4 −4
Mgolangdefault / quicktype.go+4 −4
@@ -135,8 +135,8 @@ type Format struct {
135135 }
136136
137137 type FormatsClass struct {
138- Formats []Format `json:"formats,omitempty"`
139- Height int64 `json:"height"`
140- URL string `json:"url"`
141- Width int64 `json:"width"`
138+ Formats *[]Format `json:"formats,omitempty"`
139+ Height int64 `json:"height"`
140+ URL string `json:"url"`
141+ Width int64 `json:"width"`
142142 }
Test case

test/inputs/json/samples/github-events.json

1 generated file · +316 −0
Agolangdefault / quicktype.go+316 −0
@@ -0,0 +1,316 @@
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 "time"
10+
11+import "encoding/json"
12+
13+type TopLevel []TopLevelElement
14+
15+func UnmarshalTopLevel(data []byte) (TopLevel, error) {
16+ var r TopLevel
17+ err := json.Unmarshal(data, &r)
18+ return r, err
19+}
20+
21+func (r *TopLevel) Marshal() ([]byte, error) {
22+ return json.Marshal(r)
23+}
24+
25+type TopLevelElement struct {
26+ Actor Actor `json:"actor"`
27+ CreatedAt time.Time `json:"created_at"`
28+ ID string `json:"id"`
29+ Org *Actor `json:"org,omitempty"`
30+ Payload Payload `json:"payload"`
31+ Public bool `json:"public"`
32+ Repo TopLevelRepo `json:"repo"`
33+ Type string `json:"type"`
34+}
35+
36+type Actor struct {
37+ AvatarURL string `json:"avatar_url"`
38+ DisplayLogin *string `json:"display_login,omitempty"`
39+ GravatarID string `json:"gravatar_id"`
40+ ID int64 `json:"id"`
41+ Login string `json:"login"`
42+ URL string `json:"url"`
43+}
44+
45+type Payload struct {
46+ Action *string `json:"action,omitempty"`
47+ Before *string `json:"before,omitempty"`
48+ Comment *Comment `json:"comment,omitempty"`
49+ Commits *[]Commit `json:"commits,omitempty"`
50+ Description *string `json:"description,omitempty"`
51+ DistinctSize *int64 `json:"distinct_size,omitempty"`
52+ Head *string `json:"head,omitempty"`
53+ Issue *Issue `json:"issue,omitempty"`
54+ MasterBranch *string `json:"master_branch,omitempty"`
55+ Number *int64 `json:"number,omitempty"`
56+ PullRequest *PayloadPullRequest `json:"pull_request,omitempty"`
57+ PushID *int64 `json:"push_id,omitempty"`
58+ PusherType *string `json:"pusher_type,omitempty"`
59+ Ref *string `json:"ref,omitempty"`
60+ RefType *string `json:"ref_type,omitempty"`
61+ Size *int64 `json:"size,omitempty"`
62+}
63+
64+type Comment struct {
65+ Body string `json:"body"`
66+ CreatedAt time.Time `json:"created_at"`
67+ HTMLURL string `json:"html_url"`
68+ ID int64 `json:"id"`
69+ IssueURL string `json:"issue_url"`
70+ URL string `json:"url"`
71+ UpdatedAt time.Time `json:"updated_at"`
72+ User UserClass `json:"user"`
73+}
74+
75+type UserClass struct {
76+ AvatarURL string `json:"avatar_url"`
77+ EventsURL string `json:"events_url"`
78+ FollowersURL string `json:"followers_url"`
79+ FollowingURL string `json:"following_url"`
80+ GistsURL string `json:"gists_url"`
81+ GravatarID string `json:"gravatar_id"`
82+ HTMLURL string `json:"html_url"`
83+ ID int64 `json:"id"`
84+ Login string `json:"login"`
85+ OrganizationsURL string `json:"organizations_url"`
86+ ReceivedEventsURL string `json:"received_events_url"`
87+ ReposURL string `json:"repos_url"`
88+ SiteAdmin bool `json:"site_admin"`
89+ StarredURL string `json:"starred_url"`
90+ SubscriptionsURL string `json:"subscriptions_url"`
91+ Type Type `json:"type"`
92+ URL string `json:"url"`
93+}
94+
95+type Commit struct {
96+ Author Author `json:"author"`
97+ Distinct bool `json:"distinct"`
98+ Message string `json:"message"`
99+ SHA string `json:"sha"`
100+ URL string `json:"url"`
101+}
102+
103+type Author struct {
104+ Email string `json:"email"`
105+ Name string `json:"name"`
106+}
107+
108+type Issue struct {
109+ Assignee interface{} `json:"assignee"`
110+ Assignees []interface{} `json:"assignees"`
111+ Body string `json:"body"`
112+ ClosedAt *time.Time `json:"closed_at"`
113+ Comments int64 `json:"comments"`
114+ CommentsURL string `json:"comments_url"`
115+ CreatedAt time.Time `json:"created_at"`
116+ EventsURL string `json:"events_url"`
117+ HTMLURL string `json:"html_url"`
118+ ID int64 `json:"id"`
119+ Labels []Label `json:"labels"`
120+ LabelsURL string `json:"labels_url"`
121+ Locked bool `json:"locked"`
122+ Milestone *Milestone `json:"milestone"`
123+ Number int64 `json:"number"`
124+ PullRequest *IssuePullRequest `json:"pull_request,omitempty"`
125+ RepositoryURL string `json:"repository_url"`
126+ State string `json:"state"`
127+ Title string `json:"title"`
128+ URL string `json:"url"`
129+ UpdatedAt time.Time `json:"updated_at"`
130+ User UserClass `json:"user"`
131+}
132+
133+type Label struct {
134+ Color string `json:"color"`
135+ Default bool `json:"default"`
136+ ID int64 `json:"id"`
137+ Name string `json:"name"`
138+ URL string `json:"url"`
139+}
140+
141+type Milestone struct {
142+ ClosedAt interface{} `json:"closed_at"`
143+ ClosedIssues int64 `json:"closed_issues"`
144+ CreatedAt time.Time `json:"created_at"`
145+ Creator UserClass `json:"creator"`
146+ Description string `json:"description"`
147+ DueOn *time.Time `json:"due_on"`
148+ HTMLURL string `json:"html_url"`
149+ ID int64 `json:"id"`
150+ LabelsURL string `json:"labels_url"`
151+ Number int64 `json:"number"`
152+ OpenIssues int64 `json:"open_issues"`
153+ State string `json:"state"`
154+ Title string `json:"title"`
155+ URL string `json:"url"`
156+ UpdatedAt time.Time `json:"updated_at"`
157+}
158+
159+type IssuePullRequest struct {
160+ DiffURL string `json:"diff_url"`
161+ HTMLURL string `json:"html_url"`
162+ PatchURL string `json:"patch_url"`
163+ URL string `json:"url"`
164+}
165+
166+type PayloadPullRequest struct {
167+ Additions int64 `json:"additions"`
168+ Assignee interface{} `json:"assignee"`
169+ Assignees []interface{} `json:"assignees"`
170+ Base Base `json:"base"`
171+ Body string `json:"body"`
172+ ChangedFiles int64 `json:"changed_files"`
173+ ClosedAt time.Time `json:"closed_at"`
174+ Comments int64 `json:"comments"`
175+ CommentsURL string `json:"comments_url"`
176+ Commits int64 `json:"commits"`
177+ CommitsURL string `json:"commits_url"`
178+ CreatedAt time.Time `json:"created_at"`
179+ Deletions int64 `json:"deletions"`
180+ DiffURL string `json:"diff_url"`
181+ HTMLURL string `json:"html_url"`
182+ Head Base `json:"head"`
183+ ID int64 `json:"id"`
184+ IssueURL string `json:"issue_url"`
185+ Links Links `json:"_links"`
186+ Locked bool `json:"locked"`
187+ MaintainerCanModify bool `json:"maintainer_can_modify"`
188+ MergeCommitSHA string `json:"merge_commit_sha"`
189+ Mergeable interface{} `json:"mergeable"`
190+ MergeableState string `json:"mergeable_state"`
191+ Merged bool `json:"merged"`
192+ MergedAt time.Time `json:"merged_at"`
193+ MergedBy UserClass `json:"merged_by"`
194+ Milestone interface{} `json:"milestone"`
195+ Number int64 `json:"number"`
196+ PatchURL string `json:"patch_url"`
197+ Rebaseable interface{} `json:"rebaseable"`
198+ RequestedReviewers []interface{} `json:"requested_reviewers"`
199+ ReviewCommentURL string `json:"review_comment_url"`
200+ ReviewComments int64 `json:"review_comments"`
201+ ReviewCommentsURL string `json:"review_comments_url"`
202+ State string `json:"state"`
203+ StatusesURL string `json:"statuses_url"`
204+ Title string `json:"title"`
205+ URL string `json:"url"`
206+ UpdatedAt time.Time `json:"updated_at"`
207+ User UserClass `json:"user"`
208+}
209+
210+type Base struct {
211+ Label string `json:"label"`
212+ Ref string `json:"ref"`
213+ Repo BaseRepo `json:"repo"`
214+ SHA string `json:"sha"`
215+ User UserClass `json:"user"`
216+}
217+
218+type BaseRepo struct {
219+ ArchiveURL string `json:"archive_url"`
220+ AssigneesURL string `json:"assignees_url"`
221+ BlobsURL string `json:"blobs_url"`
222+ BranchesURL string `json:"branches_url"`
223+ CloneURL string `json:"clone_url"`
224+ CollaboratorsURL string `json:"collaborators_url"`
225+ CommentsURL string `json:"comments_url"`
226+ CommitsURL string `json:"commits_url"`
227+ CompareURL string `json:"compare_url"`
228+ ContentsURL string `json:"contents_url"`
229+ ContributorsURL string `json:"contributors_url"`
230+ CreatedAt time.Time `json:"created_at"`
231+ DefaultBranch string `json:"default_branch"`
232+ DeploymentsURL string `json:"deployments_url"`
233+ Description string `json:"description"`
234+ DownloadsURL string `json:"downloads_url"`
235+ EventsURL string `json:"events_url"`
236+ Fork bool `json:"fork"`
237+ Forks int64 `json:"forks"`
238+ ForksCount int64 `json:"forks_count"`
239+ ForksURL string `json:"forks_url"`
240+ FullName string `json:"full_name"`
241+ GitCommitsURL string `json:"git_commits_url"`
242+ GitRefsURL string `json:"git_refs_url"`
243+ GitTagsURL string `json:"git_tags_url"`
244+ GitURL string `json:"git_url"`
245+ HTMLURL string `json:"html_url"`
246+ HasDownloads bool `json:"has_downloads"`
247+ HasIssues bool `json:"has_issues"`
248+ HasPages bool `json:"has_pages"`
249+ HasProjects bool `json:"has_projects"`
250+ HasWiki bool `json:"has_wiki"`
251+ Homepage string `json:"homepage"`
252+ HooksURL string `json:"hooks_url"`
253+ ID int64 `json:"id"`
254+ IssueCommentURL string `json:"issue_comment_url"`
255+ IssueEventsURL string `json:"issue_events_url"`
256+ IssuesURL string `json:"issues_url"`
257+ KeysURL string `json:"keys_url"`
258+ LabelsURL string `json:"labels_url"`
259+ Language string `json:"language"`
260+ LanguagesURL string `json:"languages_url"`
261+ MergesURL string `json:"merges_url"`
262+ MilestonesURL string `json:"milestones_url"`
263+ MirrorURL interface{} `json:"mirror_url"`
264+ Name string `json:"name"`
265+ NotificationsURL string `json:"notifications_url"`
266+ OpenIssues int64 `json:"open_issues"`
267+ OpenIssuesCount int64 `json:"open_issues_count"`
268+ Owner UserClass `json:"owner"`
269+ Private bool `json:"private"`
270+ PullsURL string `json:"pulls_url"`
271+ PushedAt time.Time `json:"pushed_at"`
272+ ReleasesURL string `json:"releases_url"`
273+ SSHURL string `json:"ssh_url"`
274+ Size int64 `json:"size"`
275+ StargazersCount int64 `json:"stargazers_count"`
276+ StargazersURL string `json:"stargazers_url"`
277+ StatusesURL string `json:"statuses_url"`
278+ SubscribersURL string `json:"subscribers_url"`
279+ SubscriptionURL string `json:"subscription_url"`
280+ SvnURL string `json:"svn_url"`
281+ TagsURL string `json:"tags_url"`
282+ TeamsURL string `json:"teams_url"`
283+ TreesURL string `json:"trees_url"`
284+ URL string `json:"url"`
285+ UpdatedAt time.Time `json:"updated_at"`
286+ Watchers int64 `json:"watchers"`
287+ WatchersCount int64 `json:"watchers_count"`
288+}
289+
290+type Links struct {
291+ Comments Comments `json:"comments"`
292+ Commits Comments `json:"commits"`
293+ HTML Comments `json:"html"`
294+ Issue Comments `json:"issue"`
295+ ReviewComment Comments `json:"review_comment"`
296+ ReviewComments Comments `json:"review_comments"`
297+ Self Comments `json:"self"`
298+ Statuses Comments `json:"statuses"`
299+}
300+
301+type Comments struct {
302+ Href string `json:"href"`
303+}
304+
305+type TopLevelRepo struct {
306+ ID int64 `json:"id"`
307+ Name string `json:"name"`
308+ URL string `json:"url"`
309+}
310+
311+type Type string
312+
313+const (
314+ User Type = "User"
315+ Organization Type = "Organization"
316+)
Test case

test/inputs/json/samples/pokedex.json

1 generated file · +17 −17
Mgolangdefault / quicktype.go+17 −17
@@ -23,23 +23,23 @@ type TopLevel struct {
2323 }
2424
2525 type Pokemon struct {
26- AvgSpawns float64 `json:"avg_spawns"`
27- Candy string `json:"candy"`
28- CandyCount *int64 `json:"candy_count,omitempty"`
29- Egg Egg `json:"egg"`
30- Height string `json:"height"`
31- ID int64 `json:"id"`
32- Img string `json:"img"`
33- Multipliers []float64 `json:"multipliers"`
34- Name string `json:"name"`
35- NextEvolution []Evolution `json:"next_evolution,omitempty"`
36- Num string `json:"num"`
37- PrevEvolution []Evolution `json:"prev_evolution,omitempty"`
38- SpawnChance float64 `json:"spawn_chance"`
39- SpawnTime string `json:"spawn_time"`
40- Type []Type `json:"type"`
41- Weaknesses []Type `json:"weaknesses"`
42- Weight string `json:"weight"`
26+ AvgSpawns float64 `json:"avg_spawns"`
27+ Candy string `json:"candy"`
28+ CandyCount *int64 `json:"candy_count,omitempty"`
29+ Egg Egg `json:"egg"`
30+ Height string `json:"height"`
31+ ID int64 `json:"id"`
32+ Img string `json:"img"`
33+ Multipliers []float64 `json:"multipliers"`
34+ Name string `json:"name"`
35+ NextEvolution *[]Evolution `json:"next_evolution,omitempty"`
36+ Num string `json:"num"`
37+ PrevEvolution *[]Evolution `json:"prev_evolution,omitempty"`
38+ SpawnChance float64 `json:"spawn_chance"`
39+ SpawnTime string `json:"spawn_time"`
40+ Type []Type `json:"type"`
41+ Weaknesses []Type `json:"weaknesses"`
42+ Weight string `json:"weight"`
4343 }
4444
4545 type Evolution struct {
Test case

test/inputs/schema/bool-string.schema

1 generated file · +2 −2
Mschema-golangdefault / quicktype.go+2 −2
@@ -22,8 +22,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- ArrNullable []*string `json:"arrNullable,omitempty"`
26- ArrOne []string `json:"arrOne,omitempty"`
25+ ArrNullable *[]*string `json:"arrNullable,omitempty"`
26+ ArrOne *[]string `json:"arrOne,omitempty"`
2727 Nullable *string `json:"nullable"`
2828 One string `json:"one"`
2929 Optional *string `json:"optional,omitempty"`
Test case

test/inputs/schema/class-map-union.schema

1 generated file · +1 −1
Mschema-golangdefault / quicktype.go+1 −1
@@ -22,7 +22,7 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- Union map[string]*UnionValue `json:"union,omitempty"`
25+ Union *map[string]*UnionValue `json:"union,omitempty"`
2626 }
2727
2828 type UnionClass struct {
Test case

test/inputs/schema/class-with-additional.schema

1 generated file · +1 −1
Mschema-golangdefault / quicktype.go+1 −1
@@ -22,7 +22,7 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- Map map[string]*Map `json:"map,omitempty"`
25+ Map *map[string]*Map `json:"map,omitempty"`
2626 }
2727
2828 type Map struct {
Test case

test/inputs/schema/enum.schema

2 generated files · +10 −10
Mschema-golangdefault / quicktype.go+5 −5
@@ -22,11 +22,11 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- Arr []Arr `json:"arr,omitempty"`
26- For *string `json:"for,omitempty"`
27- Gve Gve `json:"gve"`
28- Lvc *Lvc `json:"lvc,omitempty"`
29- OtherArr []OtherArr `json:"otherArr,omitempty"`
25+ Arr *[]Arr `json:"arr,omitempty"`
26+ For *string `json:"for,omitempty"`
27+ Gve Gve `json:"gve"`
28+ Lvc *Lvc `json:"lvc,omitempty"`
29+ OtherArr *[]OtherArr `json:"otherArr,omitempty"`
3030 }
3131
3232 type OtherArr string
Mschema-golangenum-type-name-suffix-true--6270b65ee01d / quicktype.go+5 −5
@@ -22,11 +22,11 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- Arr []Arr `json:"arr,omitempty"`
26- For *string `json:"for,omitempty"`
27- Gve Gve `json:"gve"`
28- Lvc *Lvc `json:"lvc,omitempty"`
29- OtherArr []OtherArr `json:"otherArr,omitempty"`
25+ Arr *[]Arr `json:"arr,omitempty"`
26+ For *string `json:"for,omitempty"`
27+ Gve Gve `json:"gve"`
28+ Lvc *Lvc `json:"lvc,omitempty"`
29+ OtherArr *[]OtherArr `json:"otherArr,omitempty"`
3030 }
3131
3232 type OtherArr string
Test case

test/inputs/schema/integer-string.schema

1 generated file · +2 −2
Mschema-golangdefault / quicktype.go+2 −2
@@ -22,8 +22,8 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- ArrNullable []*string `json:"arrNullable,omitempty"`
26- ArrOne []string `json:"arrOne,omitempty"`
25+ ArrNullable *[]*string `json:"arrNullable,omitempty"`
26+ ArrOne *[]string `json:"arrOne,omitempty"`
2727 Nullable *string `json:"nullable"`
2828 One string `json:"one"`
2929 Optional *string `json:"optional,omitempty"`
Test case

test/inputs/schema/optional-const-ref.schema

1 generated file · +7 −7
Mschema-golangdefault / quicktype.go+7 −7
@@ -19,13 +19,13 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Coordinates []Coordinate `json:"coordinates,omitempty"`
23- Count *int64 `json:"count,omitempty"`
24- Label *string `json:"label,omitempty"`
25- RequiredCoordinates []Coordinate `json:"requiredCoordinates"`
26- RequiredCount int64 `json:"requiredCount"`
27- RequiredLabel string `json:"requiredLabel"`
28- Weight *float64 `json:"weight,omitempty"`
22+ Coordinates *[]Coordinate `json:"coordinates,omitempty"`
23+ Count *int64 `json:"count,omitempty"`
24+ Label *string `json:"label,omitempty"`
25+ RequiredCoordinates []Coordinate `json:"requiredCoordinates"`
26+ RequiredCount int64 `json:"requiredCount"`
27+ RequiredLabel string `json:"requiredLabel"`
28+ Weight *float64 `json:"weight,omitempty"`
2929 }
3030
3131 type Coordinate struct {
Test case

test/inputs/schema/postman-collection.schema

1 generated file · +30 −0
Aschema-golangdefault / quicktype.go+30 −0
@@ -0,0 +1,30 @@
1+// Code generated from JSON Schema using quicktype. DO NOT EDIT.
2+// To parse and unparse this JSON data, add this code to your project and do:
3+//
4+// topLevel, err := UnmarshalTopLevel(bytes)
5+// bytes, err = topLevel.Marshal()
6+
7+package main
8+
9+import "encoding/json"
10+
11+func UnmarshalTopLevel(data []byte) (TopLevel, error) {
12+ var r TopLevel
13+ err := json.Unmarshal(data, &r)
14+ return r, err
15+}
16+
17+func (r *TopLevel) Marshal() ([]byte, error) {
18+ return json.Marshal(r)
19+}
20+
21+// Postman collection
22+type TopLevel struct {
23+ Item *[]TopLevel `json:"item,omitempty"`
24+ Name *string `json:"name,omitempty"`
25+ Response *[]Response `json:"response,omitempty"`
26+}
27+
28+type Response struct {
29+ Body *string `json:"body,omitempty"`
30+}
Test case

test/inputs/schema/renaming-bug.schema

1 generated file · +12 −12
Mschema-golangdefault / quicktype.go+12 −12
@@ -19,21 +19,21 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- Version *string `json:"version,omitempty"`
23- Fruits []Fruit `json:"fruits,omitempty"`
24- Vehicles []Vehicle `json:"vehicles,omitempty"`
22+ Version *string `json:"version,omitempty"`
23+ Fruits *[]Fruit `json:"fruits,omitempty"`
24+ Vehicles *[]Vehicle `json:"vehicles,omitempty"`
2525 }
2626
2727 type Fruit struct {
28- Apple *bool `json:"apple,omitempty"`
29- Berries []Berry `json:"berries,omitempty"`
30- Orange *bool `json:"orange,omitempty"`
28+ Apple *bool `json:"apple,omitempty"`
29+ Berries *[]Berry `json:"berries,omitempty"`
30+ Orange *bool `json:"orange,omitempty"`
3131 }
3232
3333 type Berry struct {
34- Color *Color `json:"color,omitempty"`
35- Name *string `json:"name,omitempty"`
36- Shapes []Shape `json:"shapes,omitempty"`
34+ Color *Color `json:"color,omitempty"`
35+ Name *string `json:"name,omitempty"`
36+ Shapes *[]Shape `json:"shapes,omitempty"`
3737 }
3838
3939 type Color struct {
@@ -46,8 +46,8 @@ type Shape struct {
4646 }
4747
4848 type Geometry struct {
49- RectShape *RectShape `json:"rectShape,omitempty"`
50- CircularShape []CircularShape `json:"circularShape,omitempty"`
49+ RectShape *RectShape `json:"rectShape,omitempty"`
50+ CircularShape *[]CircularShape `json:"circularShape,omitempty"`
5151 }
5252
5353 type CircularShape struct {
@@ -55,7 +55,7 @@ type CircularShape struct {
5555 }
5656
5757 type RectShape struct {
58- Parts []Part `json:"parts,omitempty"`
58+ Parts *[]Part `json:"parts,omitempty"`
5959 }
6060
6161 type Part struct {
Test case

test/inputs/schema/unevaluated-properties.schema

1 generated file · +3 −3
Mschema-golangdefault / quicktype.go+3 −3
@@ -26,9 +26,9 @@ type TopLevel struct {
2626 }
2727
2828 type Config struct {
29- Closed *Closed `json:"closed"`
30- Name *string `json:"name,omitempty"`
31- Settings map[string][]Item `json:"settings,omitempty"`
29+ Closed *Closed `json:"closed"`
30+ Name *string `json:"name,omitempty"`
31+ Settings *map[string][]Item `json:"settings,omitempty"`
3232 }
3333
3434 type ClosedClass struct {
Test case

test/inputs/schema/uuid.schema

1 generated file · +6 −6
Mschema-golangdefault / quicktype.go+6 −6
@@ -19,10 +19,10 @@ func (r *TopLevel) Marshal() ([]byte, error) {
1919 }
2020
2121 type TopLevel struct {
22- ArrNullable []*string `json:"arrNullable,omitempty"`
23- ArrOne []string `json:"arrOne,omitempty"`
24- Nullable *string `json:"nullable"`
25- One string `json:"one"`
26- Optional *string `json:"optional,omitempty"`
27- UnionWithEnum string `json:"unionWithEnum"`
22+ ArrNullable *[]*string `json:"arrNullable,omitempty"`
23+ ArrOne *[]string `json:"arrOne,omitempty"`
24+ Nullable *string `json:"nullable"`
25+ One string `json:"one"`
26+ Optional *string `json:"optional,omitempty"`
27+ UnionWithEnum string `json:"unionWithEnum"`
2828 }
Test case

test/inputs/schema/vega-lite.schema

1 generated file · +727 −727
Mschema-golangdefault / quicktype.go+727 −727
@@ -22,123 +22,123 @@ func (r *TopLevel) Marshal() ([]byte, error) {
2222 }
2323
2424 type TopLevel struct {
25- // URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
26- // have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
27- // Setting the `$schema` property allows automatic validation and autocomplete in editors
28- // that support JSON schema.
29- Schema *string `json:"$schema,omitempty"`
30- // Sets how the visualization size should be determined. If a string, should be one of
31- // `"pad"`, `"fit"` or `"none"`.
32- // Object values can additionally specify parameters for content sizing and automatic
33- // resizing.
34- // `"fit"` is only supported for single and layered views that don't use `rangeStep`.
35- //
36- // __Default value__: `pad`
37- Autosize *Autosize `json:"autosize"`
38- // CSS color property to use as the background of visualization.
39- //
40- // __Default value:__ none (transparent)
41- Background *string `json:"background,omitempty"`
42- // Vega-Lite configuration object. This property can only be defined at the top-level of a
43- // specification.
44- Config *Config `json:"config,omitempty"`
45- // An object describing the data source
46- Data *Data `json:"data,omitempty"`
47- // Description of this mark for commenting purpose.
48- Description *string `json:"description,omitempty"`
49- // A key-value mapping between encoding channels and definition of fields.
50- Encoding *EncodingWithFacet `json:"encoding,omitempty"`
51- // The height of a visualization.
52- //
53- // __Default value:__
54- // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
55- // [continuous scale](scale.html#continuous), the height will be the value of
56- // [`config.view.height`](spec.html#config).
57- // - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
58- // value or unspecified, the height is [determined by the range step, paddings, and the
59- // cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
60- // `rangeStep` is `null`, the height will be the value of
61- // [`config.view.height`](spec.html#config).
62- // - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
63- //
64- // __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
65- // represents the height of a single view.
66- //
67- // __See also:__ The documentation for [width and height](size.html) contains more examples.
68- Height *float64 `json:"height,omitempty"`
69- // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
70- // `"line"`,
71- // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
72- // object](mark.html#mark-def).
73- Mark *AnyMark `json:"mark"`
74- // Name of the visualization for later reference.
75- Name *string `json:"name,omitempty"`
76- // The default visualization padding, in pixels, from the edge of the visualization canvas
77- // to the data rectangle. If a number, specifies padding for all sides.
78- // If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
79- // "bottom": 5}` to specify padding for each side of the visualization.
80- //
81- // __Default value__: `5`
82- Padding *Padding `json:"padding"`
83- // An object defining properties of geographic projection.
84- //
85- // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
86- // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
87- Projection *Projection `json:"projection,omitempty"`
88- // A key-value mapping between selection names and definitions.
89- Selection map[string]SelectionDef `json:"selection,omitempty"`
90- // Title for the plot.
91- Title *Title `json:"title"`
92- // An array of data transformations such as filter and new field calculation.
93- Transform []Transform `json:"transform,omitempty"`
94- // The width of a visualization.
95- //
96- // __Default value:__ This will be determined by the following rules:
97- //
98- // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
99- // [continuous scale](scale.html#continuous), the width will be the value of
100- // [`config.view.width`](spec.html#config).
101- // - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
102- // value or unspecified, the width is [determined by the range step, paddings, and the
103- // cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
104- // `rangeStep` is `null`, the width will be the value of
105- // [`config.view.width`](spec.html#config).
106- // - If no field is mapped to `x` channel, the `width` will be the value of
107- // [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
108- // the value of `rangeStep` for other marks.
109- //
110- // __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
111- // represents the width of a single view.
112- //
113- // __See also:__ The documentation for [width and height](size.html) contains more examples.
114- Width *float64 `json:"width,omitempty"`
115- // Layer or single view specifications to be layered.
116- //
117- // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
118- // layering facet specifications is not allowed.
119- Layer []LayerSpec `json:"layer,omitempty"`
120- // Scale, axis, and legend resolutions for layers.
121- //
122- // Scale, axis, and legend resolutions for facets.
123- //
124- // Scale and legend resolutions for repeated charts.
125- //
126- // Scale, axis, and legend resolutions for vertically concatenated charts.
127- //
128- // Scale, axis, and legend resolutions for horizontally concatenated charts.
129- Resolve *Resolve `json:"resolve,omitempty"`
130- // An object that describes mappings between `row` and `column` channels and their field
131- // definitions.
132- Facet *FacetMapping `json:"facet,omitempty"`
133- // A specification of the view that gets faceted.
134- Spec *Spec `json:"spec,omitempty"`
135- // An object that describes what fields should be repeated into views that are laid out as a
136- // `row` or `column`.
137- Repeat *Repeat `json:"repeat,omitempty"`
138- // A list of views that should be concatenated and put into a column.
139- Vconcat []Spec `json:"vconcat,omitempty"`
140- // A list of views that should be concatenated and put into a row.
141- Hconcat []Spec `json:"hconcat,omitempty"`
25+ // URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
26+ // have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
27+ // Setting the `$schema` property allows automatic validation and autocomplete in editors
28+ // that support JSON schema.
29+ Schema *string `json:"$schema,omitempty"`
30+ // Sets how the visualization size should be determined. If a string, should be one of
31+ // `"pad"`, `"fit"` or `"none"`.
32+ // Object values can additionally specify parameters for content sizing and automatic
33+ // resizing.
34+ // `"fit"` is only supported for single and layered views that don't use `rangeStep`.
35+ //
36+ // __Default value__: `pad`
37+ Autosize *Autosize `json:"autosize"`
38+ // CSS color property to use as the background of visualization.
39+ //
40+ // __Default value:__ none (transparent)
41+ Background *string `json:"background,omitempty"`
42+ // Vega-Lite configuration object. This property can only be defined at the top-level of a
43+ // specification.
44+ Config *Config `json:"config,omitempty"`
45+ // An object describing the data source
46+ Data *Data `json:"data,omitempty"`
47+ // Description of this mark for commenting purpose.
48+ Description *string `json:"description,omitempty"`
49+ // A key-value mapping between encoding channels and definition of fields.
50+ Encoding *EncodingWithFacet `json:"encoding,omitempty"`
51+ // The height of a visualization.
52+ //
53+ // __Default value:__
54+ // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
55+ // [continuous scale](scale.html#continuous), the height will be the value of
56+ // [`config.view.height`](spec.html#config).
57+ // - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
58+ // value or unspecified, the height is [determined by the range step, paddings, and the
59+ // cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
60+ // `rangeStep` is `null`, the height will be the value of
61+ // [`config.view.height`](spec.html#config).
62+ // - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
63+ //
64+ // __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
65+ // represents the height of a single view.
66+ //
67+ // __See also:__ The documentation for [width and height](size.html) contains more examples.
68+ Height *float64 `json:"height,omitempty"`
69+ // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
70+ // `"line"`,
71+ // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
72+ // object](mark.html#mark-def).
73+ Mark *AnyMark `json:"mark"`
74+ // Name of the visualization for later reference.
75+ Name *string `json:"name,omitempty"`
76+ // The default visualization padding, in pixels, from the edge of the visualization canvas
77+ // to the data rectangle. If a number, specifies padding for all sides.
78+ // If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
79+ // "bottom": 5}` to specify padding for each side of the visualization.
80+ //
81+ // __Default value__: `5`
82+ Padding *Padding `json:"padding"`
83+ // An object defining properties of geographic projection.
84+ //
85+ // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
86+ // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
87+ Projection *Projection `json:"projection,omitempty"`
88+ // A key-value mapping between selection names and definitions.
89+ Selection *map[string]SelectionDef `json:"selection,omitempty"`
90+ // Title for the plot.
91+ Title *Title `json:"title"`
92+ // An array of data transformations such as filter and new field calculation.
93+ Transform *[]Transform `json:"transform,omitempty"`
94+ // The width of a visualization.
95+ //
96+ // __Default value:__ This will be determined by the following rules:
97+ //
98+ // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
99+ // [continuous scale](scale.html#continuous), the width will be the value of
100+ // [`config.view.width`](spec.html#config).
101+ // - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
102+ // value or unspecified, the width is [determined by the range step, paddings, and the
103+ // cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
104+ // `rangeStep` is `null`, the width will be the value of
105+ // [`config.view.width`](spec.html#config).
106+ // - If no field is mapped to `x` channel, the `width` will be the value of
107+ // [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
108+ // the value of `rangeStep` for other marks.
109+ //
110+ // __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
111+ // represents the width of a single view.
112+ //
113+ // __See also:__ The documentation for [width and height](size.html) contains more examples.
114+ Width *float64 `json:"width,omitempty"`
115+ // Layer or single view specifications to be layered.
116+ //
117+ // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
118+ // layering facet specifications is not allowed.
119+ Layer *[]LayerSpec `json:"layer,omitempty"`
120+ // Scale, axis, and legend resolutions for layers.
121+ //
122+ // Scale, axis, and legend resolutions for facets.
123+ //
124+ // Scale and legend resolutions for repeated charts.
125+ //
126+ // Scale, axis, and legend resolutions for vertically concatenated charts.
127+ //
128+ // Scale, axis, and legend resolutions for horizontally concatenated charts.
129+ Resolve *Resolve `json:"resolve,omitempty"`
130+ // An object that describes mappings between `row` and `column` channels and their field
131+ // definitions.
132+ Facet *FacetMapping `json:"facet,omitempty"`
133+ // A specification of the view that gets faceted.
134+ Spec *Spec `json:"spec,omitempty"`
135+ // An object that describes what fields should be repeated into views that are laid out as a
136+ // `row` or `column`.
137+ Repeat *Repeat `json:"repeat,omitempty"`
138+ // A list of views that should be concatenated and put into a column.
139+ Vconcat *[]Spec `json:"vconcat,omitempty"`
140+ // A list of views that should be concatenated and put into a row.
141+ Hconcat *[]Spec `json:"hconcat,omitempty"`
142142 }
143143
144144 type AutoSizeParams struct {
@@ -166,125 +166,125 @@ type AutoSizeParams struct {
166166 // Vega-Lite configuration object. This property can only be defined at the top-level of a
167167 // specification.
168168 type Config struct {
169- // Area-Specific Config
170- Area *MarkConfig `json:"area,omitempty"`
171- // Sets how the visualization size should be determined. If a string, should be one of
172- // `"pad"`, `"fit"` or `"none"`.
173- // Object values can additionally specify parameters for content sizing and automatic
174- // resizing.
175- // `"fit"` is only supported for single and layered views that don't use `rangeStep`.
176- //
177- // __Default value__: `pad`
178- Autosize *Autosize `json:"autosize"`
179- // Axis configuration, which determines default properties for all `x` and `y`
180- // [axes](axis.html). For a full list of axis configuration options, please see the
181- // [corresponding section of the axis documentation](axis.html#config).
182- Axis *AxisConfig `json:"axis,omitempty"`
183- // Specific axis config for axes with "band" scales.
184- AxisBand *VGAxisConfig `json:"axisBand,omitempty"`
185- // Specific axis config for x-axis along the bottom edge of the chart.
186- AxisBottom *VGAxisConfig `json:"axisBottom,omitempty"`
187- // Specific axis config for y-axis along the left edge of the chart.
188- AxisLeft *VGAxisConfig `json:"axisLeft,omitempty"`
189- // Specific axis config for y-axis along the right edge of the chart.
190- AxisRight *VGAxisConfig `json:"axisRight,omitempty"`
191- // Specific axis config for x-axis along the top edge of the chart.
192- AxisTop *VGAxisConfig `json:"axisTop,omitempty"`
193- // X-axis specific config.
194- AxisX *VGAxisConfig `json:"axisX,omitempty"`
195- // Y-axis specific config.
196- AxisY *VGAxisConfig `json:"axisY,omitempty"`
197- // CSS color property to use as the background of visualization.
198- //
199- // __Default value:__ none (transparent)
200- Background *string `json:"background,omitempty"`
201- // Bar-Specific Config
202- Bar *BarConfig `json:"bar,omitempty"`
203- // Circle-Specific Config
204- Circle *MarkConfig `json:"circle,omitempty"`
205- // Default axis and legend title for count fields.
206- //
207- // __Default value:__ `'Number of Records'`.
208- CountTitle *string `json:"countTitle,omitempty"`
209- // Defines how Vega-Lite generates title for fields. There are three possible styles:
210- //
211- // - `"verbal"` (Default) - displays function in a verbal style (e.g., "Sum of field",
212- // "Year-month of date", "field (binned)").
213- // - `"function"` - displays function using parentheses and capitalized texts (e.g.,
214- // "SUM(field)", "YEARMONTH(date)", "BIN(field)").
215- // - `"plain"` - displays only the field name without functions (e.g., "field", "date",
216- // "field").
217- FieldTitle *FieldTitle `json:"fieldTitle,omitempty"`
218- // Geoshape-Specific Config
219- Geoshape *MarkConfig `json:"geoshape,omitempty"`
220- // Defines how Vega-Lite should handle invalid values (`null` and `NaN`).
221- // - If set to `"filter"` (default), all data items with null values are filtered.
222- // - If `null`, all data items are included. In this case, invalid values will be
223- // interpreted as zeroes.
224- InvalidValues *InvalidValues `json:"invalidValues,omitempty"`
225- // Legend configuration, which determines default properties for all [legends](legend.html).
226- // For a full list of legend configuration options, please see the [corresponding section of
227- // in the legend documentation](legend.html#config).
228- Legend *LegendConfig `json:"legend,omitempty"`
229- // Line-Specific Config
230- Line *MarkConfig `json:"line,omitempty"`
231- // Mark Config
232- Mark *MarkConfig `json:"mark,omitempty"`
233- // D3 Number format for axis labels and text tables. For example "s" for SI units. Use [D3's
234- // number format pattern](https://github.com/d3/d3-format#locale_format).
235- NumberFormat *string `json:"numberFormat,omitempty"`
236- // The default visualization padding, in pixels, from the edge of the visualization canvas
237- // to the data rectangle. If a number, specifies padding for all sides.
238- // If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
239- // "bottom": 5}` to specify padding for each side of the visualization.
240- //
241- // __Default value__: `5`
242- Padding *Padding `json:"padding"`
243- // Point-Specific Config
244- Point *MarkConfig `json:"point,omitempty"`
245- // Projection configuration, which determines default properties for all
246- // [projections](projection.html). For a full list of projection configuration options,
247- // please see the [corresponding section of the projection
248- // documentation](projection.html#config).
249- Projection *ProjectionConfig `json:"projection,omitempty"`
250- // An object hash that defines default range arrays or schemes for using with scales.
251- // For a full list of scale range configuration options, please see the [corresponding
252- // section of the scale documentation](scale.html#config).
253- Range map[string]*RangeConfigValue `json:"range,omitempty"`
254- // Rect-Specific Config
255- Rect *MarkConfig `json:"rect,omitempty"`
256- // Rule-Specific Config
257- Rule *MarkConfig `json:"rule,omitempty"`
258- // Scale configuration determines default properties for all [scales](scale.html). For a
259- // full list of scale configuration options, please see the [corresponding section of the
260- // scale documentation](scale.html#config).
261- Scale *ScaleConfig `json:"scale,omitempty"`
262- // An object hash for defining default properties for each type of selections.
263- Selection *SelectionConfig `json:"selection,omitempty"`
264- // Square-Specific Config
265- Square *MarkConfig `json:"square,omitempty"`
266- // Default stack offset for stackable mark.
267- Stack *StackOffset `json:"stack,omitempty"`
268- // An object hash that defines key-value mappings to determine default properties for marks
269- // with a given [style](mark.html#mark-def). The keys represent styles names; the value are
270- // valid [mark configuration objects](mark.html#config).
271- Style map[string]VGMarkConfig `json:"style,omitempty"`
272- // Text-Specific Config
273- Text *TextConfig `json:"text,omitempty"`
274- // Tick-Specific Config
275- Tick *TickConfig `json:"tick,omitempty"`
276- // Default datetime format for axis and legend labels. The format can be set directly on
277- // each axis and legend. Use [D3's time format
278- // pattern](https://github.com/d3/d3-time-format#locale_format).
279- //
280- // __Default value:__ `'%b %d, %Y'`.
281- TimeFormat *string `json:"timeFormat,omitempty"`
282- // Title configuration, which determines default properties for all [titles](title.html).
283- // For a full list of title configuration options, please see the [corresponding section of
284- // the title documentation](title.html#config).
285- Title *VGTitleConfig `json:"title,omitempty"`
286- // Default properties for [single view plots](spec.html#single).
287- View *ViewConfig `json:"view,omitempty"`
169+ // Area-Specific Config
170+ Area *MarkConfig `json:"area,omitempty"`
171+ // Sets how the visualization size should be determined. If a string, should be one of
172+ // `"pad"`, `"fit"` or `"none"`.
173+ // Object values can additionally specify parameters for content sizing and automatic
174+ // resizing.
175+ // `"fit"` is only supported for single and layered views that don't use `rangeStep`.
176+ //
177+ // __Default value__: `pad`
178+ Autosize *Autosize `json:"autosize"`
179+ // Axis configuration, which determines default properties for all `x` and `y`
180+ // [axes](axis.html). For a full list of axis configuration options, please see the
181+ // [corresponding section of the axis documentation](axis.html#config).
182+ Axis *AxisConfig `json:"axis,omitempty"`
183+ // Specific axis config for axes with "band" scales.
184+ AxisBand *VGAxisConfig `json:"axisBand,omitempty"`
185+ // Specific axis config for x-axis along the bottom edge of the chart.
186+ AxisBottom *VGAxisConfig `json:"axisBottom,omitempty"`
187+ // Specific axis config for y-axis along the left edge of the chart.
188+ AxisLeft *VGAxisConfig `json:"axisLeft,omitempty"`
189+ // Specific axis config for y-axis along the right edge of the chart.
190+ AxisRight *VGAxisConfig `json:"axisRight,omitempty"`
191+ // Specific axis config for x-axis along the top edge of the chart.
192+ AxisTop *VGAxisConfig `json:"axisTop,omitempty"`
193+ // X-axis specific config.
194+ AxisX *VGAxisConfig `json:"axisX,omitempty"`
195+ // Y-axis specific config.
196+ AxisY *VGAxisConfig `json:"axisY,omitempty"`
197+ // CSS color property to use as the background of visualization.
198+ //
199+ // __Default value:__ none (transparent)
200+ Background *string `json:"background,omitempty"`
201+ // Bar-Specific Config
202+ Bar *BarConfig `json:"bar,omitempty"`
203+ // Circle-Specific Config
204+ Circle *MarkConfig `json:"circle,omitempty"`
205+ // Default axis and legend title for count fields.
206+ //
207+ // __Default value:__ `'Number of Records'`.
208+ CountTitle *string `json:"countTitle,omitempty"`
209+ // Defines how Vega-Lite generates title for fields. There are three possible styles:
210+ //
211+ // - `"verbal"` (Default) - displays function in a verbal style (e.g., "Sum of field",
212+ // "Year-month of date", "field (binned)").
213+ // - `"function"` - displays function using parentheses and capitalized texts (e.g.,
214+ // "SUM(field)", "YEARMONTH(date)", "BIN(field)").
215+ // - `"plain"` - displays only the field name without functions (e.g., "field", "date",
216+ // "field").
217+ FieldTitle *FieldTitle `json:"fieldTitle,omitempty"`
218+ // Geoshape-Specific Config
219+ Geoshape *MarkConfig `json:"geoshape,omitempty"`
220+ // Defines how Vega-Lite should handle invalid values (`null` and `NaN`).
221+ // - If set to `"filter"` (default), all data items with null values are filtered.
222+ // - If `null`, all data items are included. In this case, invalid values will be
223+ // interpreted as zeroes.
224+ InvalidValues *InvalidValues `json:"invalidValues,omitempty"`
225+ // Legend configuration, which determines default properties for all [legends](legend.html).
226+ // For a full list of legend configuration options, please see the [corresponding section of
227+ // in the legend documentation](legend.html#config).
228+ Legend *LegendConfig `json:"legend,omitempty"`
229+ // Line-Specific Config
230+ Line *MarkConfig `json:"line,omitempty"`
231+ // Mark Config
232+ Mark *MarkConfig `json:"mark,omitempty"`
233+ // D3 Number format for axis labels and text tables. For example "s" for SI units. Use [D3's
234+ // number format pattern](https://github.com/d3/d3-format#locale_format).
235+ NumberFormat *string `json:"numberFormat,omitempty"`
236+ // The default visualization padding, in pixels, from the edge of the visualization canvas
237+ // to the data rectangle. If a number, specifies padding for all sides.
238+ // If an object, the value should have the format `{"left": 5, "top": 5, "right": 5,
239+ // "bottom": 5}` to specify padding for each side of the visualization.
240+ //
241+ // __Default value__: `5`
242+ Padding *Padding `json:"padding"`
243+ // Point-Specific Config
244+ Point *MarkConfig `json:"point,omitempty"`
245+ // Projection configuration, which determines default properties for all
246+ // [projections](projection.html). For a full list of projection configuration options,
247+ // please see the [corresponding section of the projection
248+ // documentation](projection.html#config).
249+ Projection *ProjectionConfig `json:"projection,omitempty"`
250+ // An object hash that defines default range arrays or schemes for using with scales.
251+ // For a full list of scale range configuration options, please see the [corresponding
252+ // section of the scale documentation](scale.html#config).
253+ Range *map[string]*RangeConfigValue `json:"range,omitempty"`
254+ // Rect-Specific Config
255+ Rect *MarkConfig `json:"rect,omitempty"`
256+ // Rule-Specific Config
257+ Rule *MarkConfig `json:"rule,omitempty"`
258+ // Scale configuration determines default properties for all [scales](scale.html). For a
259+ // full list of scale configuration options, please see the [corresponding section of the
260+ // scale documentation](scale.html#config).
261+ Scale *ScaleConfig `json:"scale,omitempty"`
262+ // An object hash for defining default properties for each type of selections.
263+ Selection *SelectionConfig `json:"selection,omitempty"`
264+ // Square-Specific Config
265+ Square *MarkConfig `json:"square,omitempty"`
266+ // Default stack offset for stackable mark.
267+ Stack *StackOffset `json:"stack,omitempty"`
268+ // An object hash that defines key-value mappings to determine default properties for marks
269+ // with a given [style](mark.html#mark-def). The keys represent styles names; the value are
270+ // valid [mark configuration objects](mark.html#config).
271+ Style *map[string]VGMarkConfig `json:"style,omitempty"`
272+ // Text-Specific Config
273+ Text *TextConfig `json:"text,omitempty"`
274+ // Tick-Specific Config
275+ Tick *TickConfig `json:"tick,omitempty"`
276+ // Default datetime format for axis and legend labels. The format can be set directly on
277+ // each axis and legend. Use [D3's time format
278+ // pattern](https://github.com/d3/d3-time-format#locale_format).
279+ //
280+ // __Default value:__ `'%b %d, %Y'`.
281+ TimeFormat *string `json:"timeFormat,omitempty"`
282+ // Title configuration, which determines default properties for all [titles](title.html).
283+ // For a full list of title configuration options, please see the [corresponding section of
284+ // the title documentation](title.html#config).
285+ Title *VGTitleConfig `json:"title,omitempty"`
286+ // Default properties for [single view plots](spec.html#single).
287+ View *ViewConfig `json:"view,omitempty"`
288288 }
289289
290290 // Area-Specific Config
@@ -411,7 +411,7 @@ type MarkConfig struct {
411411 // __Default value:__ (None)
412412 Stroke *string `json:"stroke,omitempty"`
413413 // An array of alternating stroke, space lengths for creating dashed or dotted lines.
414- StrokeDash []float64 `json:"strokeDash,omitempty"`
414+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
415415 // The offset (in pixels) into which to begin drawing with the stroke dash array.
416416 StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
417417 // The stroke opacity (value between [0,1]).
@@ -460,7 +460,7 @@ type AxisConfig struct {
460460 // Color of gridlines.
461461 GridColor *string `json:"gridColor,omitempty"`
462462 // The offset (in pixels) into which to begin drawing with the grid dash array.
463- GridDash []float64 `json:"gridDash,omitempty"`
463+ GridDash *[]float64 `json:"gridDash,omitempty"`
464464 // The stroke opacity of grid (value between [0,1])
465465 //
466466 // __Default value:__ (`1` by default)
@@ -602,7 +602,7 @@ type VGAxisConfig struct {
602602 // Color of gridlines.
603603 GridColor *string `json:"gridColor,omitempty"`
604604 // The offset (in pixels) into which to begin drawing with the grid dash array.
605- GridDash []float64 `json:"gridDash,omitempty"`
605+ GridDash *[]float64 `json:"gridDash,omitempty"`
606606 // The stroke opacity of grid (value between [0,1])
607607 //
608608 // __Default value:__ (`1` by default)
@@ -821,7 +821,7 @@ type BarConfig struct {
821821 // __Default value:__ (None)
822822 Stroke *string `json:"stroke,omitempty"`
823823 // An array of alternating stroke, space lengths for creating dashed or dotted lines.
824- StrokeDash []float64 `json:"strokeDash,omitempty"`
824+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
825825 // The offset (in pixels) into which to begin drawing with the stroke dash array.
826826 StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
827827 // The stroke opacity (value between [0,1]).
@@ -901,7 +901,7 @@ type LegendConfig struct {
901901 // Border stroke color for the full legend.
902902 StrokeColor *string `json:"strokeColor,omitempty"`
903903 // Border stroke dash pattern for the full legend.
904- StrokeDash []float64 `json:"strokeDash,omitempty"`
904+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
905905 // Border stroke width for the full legend.
906906 StrokeWidth *float64 `json:"strokeWidth,omitempty"`
907907 // The color of the legend symbol,
@@ -944,56 +944,56 @@ type PaddingClass struct {
944944 //
945945 // Any property of Projection can be in config
946946 type ProjectionConfig struct {
947- // Sets the projection’s center to the specified center, a two-element array of longitude
948- // and latitude in degrees.
949- //
950- // __Default value:__ `[0, 0]`
951- Center []float64 `json:"center,omitempty"`
952- // Sets the projection’s clipping circle radius to the specified angle in degrees. If
953- // `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
954- // than small-circle clipping.
955- ClipAngle *float64 `json:"clipAngle,omitempty"`
956- // Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
957- // bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
958- // the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
959- // viewport clipping is performed.
960- ClipExtent [][]float64 `json:"clipExtent,omitempty"`
961- Coefficient *float64 `json:"coefficient,omitempty"`
962- Distance *float64 `json:"distance,omitempty"`
963- Fraction *float64 `json:"fraction,omitempty"`
964- Lobes *float64 `json:"lobes,omitempty"`
965- Parallel *float64 `json:"parallel,omitempty"`
966- // Sets the threshold for the projection’s [adaptive
967- // resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
968- // value corresponds to the [Douglas–Peucker
969- // distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
970- // If precision is not specified, returns the projection’s current resampling precision
971- // which defaults to `√0.5 ≅ 0.70710…`.
972- Precision map[string]*TitleFontWeight `json:"precision,omitempty"`
973- Radius *float64 `json:"radius,omitempty"`
974- Ratio *float64 `json:"ratio,omitempty"`
975- // Sets the projection’s three-axis rotation to the specified angles, which must be a two-
976- // or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
977- // angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
978- //
979- // __Default value:__ `[0, 0, 0]`
980- Rotate []float64 `json:"rotate,omitempty"`
981- Spacing *float64 `json:"spacing,omitempty"`
982- Tilt *float64 `json:"tilt,omitempty"`
983- // The cartographic projection to use. This value is case-insensitive, for example
984- // `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
985- // projection types [in the
986- // documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
987- //
988- // __Default value:__ `mercator`
989- Type *VGProjectionType `json:"type,omitempty"`
947+ // Sets the projection’s center to the specified center, a two-element array of longitude
948+ // and latitude in degrees.
949+ //
950+ // __Default value:__ `[0, 0]`
951+ Center *[]float64 `json:"center,omitempty"`
952+ // Sets the projection’s clipping circle radius to the specified angle in degrees. If
953+ // `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
954+ // than small-circle clipping.
955+ ClipAngle *float64 `json:"clipAngle,omitempty"`
956+ // Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
957+ // bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
958+ // the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
959+ // viewport clipping is performed.
960+ ClipExtent *[][]float64 `json:"clipExtent,omitempty"`
961+ Coefficient *float64 `json:"coefficient,omitempty"`
962+ Distance *float64 `json:"distance,omitempty"`
963+ Fraction *float64 `json:"fraction,omitempty"`
964+ Lobes *float64 `json:"lobes,omitempty"`
965+ Parallel *float64 `json:"parallel,omitempty"`
966+ // Sets the threshold for the projection’s [adaptive
967+ // resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
968+ // value corresponds to the [Douglas–Peucker
969+ // distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
970+ // If precision is not specified, returns the projection’s current resampling precision
971+ // which defaults to `√0.5 ≅ 0.70710…`.
972+ Precision *map[string]*TitleFontWeight `json:"precision,omitempty"`
973+ Radius *float64 `json:"radius,omitempty"`
974+ Ratio *float64 `json:"ratio,omitempty"`
975+ // Sets the projection’s three-axis rotation to the specified angles, which must be a two-
976+ // or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
977+ // angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
978+ //
979+ // __Default value:__ `[0, 0, 0]`
980+ Rotate *[]float64 `json:"rotate,omitempty"`
981+ Spacing *float64 `json:"spacing,omitempty"`
982+ Tilt *float64 `json:"tilt,omitempty"`
983+ // The cartographic projection to use. This value is case-insensitive, for example
984+ // `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
985+ // projection types [in the
986+ // documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
987+ //
988+ // __Default value:__ `mercator`
989+ Type *VGProjectionType `json:"type,omitempty"`
990990 }
991991
992992 type VGScheme struct {
993- Count *float64 `json:"count,omitempty"`
994- Extent []float64 `json:"extent,omitempty"`
995- Scheme *string `json:"scheme,omitempty"`
996- Step *float64 `json:"step,omitempty"`
993+ Count *float64 `json:"count,omitempty"`
994+ Extent *[]float64 `json:"extent,omitempty"`
995+ Scheme *string `json:"scheme,omitempty"`
996+ Step *float64 `json:"step,omitempty"`
997997 }
998998
999999 // Scale configuration determines default properties for all [scales](scale.html). For a
@@ -1128,10 +1128,10 @@ type IntervalSelectionConfig struct {
11281128 Empty *Empty `json:"empty,omitempty"`
11291129 // An array of encoding channels. The corresponding data field values
11301130 // must match for a data tuple to fall within the selection.
1131- Encodings []SingleDefChannel `json:"encodings,omitempty"`
1131+ Encodings *[]SingleDefChannel `json:"encodings,omitempty"`
11321132 // An array of field names whose values must match for a data tuple to
11331133 // fall within the selection.
1134- Fields []string `json:"fields,omitempty"`
1134+ Fields *[]string `json:"fields,omitempty"`
11351135 // An interval selection also adds a rectangle mark to depict the
11361136 // extents of the interval. The `mark` property can be used to customize the
11371137 // appearance of the mark.
@@ -1168,27 +1168,27 @@ type IntervalSelectionConfig struct {
11681168 // extents of the interval. The `mark` property can be used to customize the
11691169 // appearance of the mark.
11701170 type BrushConfig struct {
1171- // The fill color of the interval mark.
1172- //
1173- // __Default value:__ `#333333`
1174- Fill *string `json:"fill,omitempty"`
1175- // The fill opacity of the interval mark (a value between 0 and 1).
1176- //
1177- // __Default value:__ `0.125`
1178- FillOpacity *float64 `json:"fillOpacity,omitempty"`
1179- // The stroke color of the interval mark.
1180- //
1181- // __Default value:__ `#ffffff`
1182- Stroke *string `json:"stroke,omitempty"`
1183- // An array of alternating stroke and space lengths,
1184- // for creating dashed or dotted lines.
1185- StrokeDash []float64 `json:"strokeDash,omitempty"`
1186- // The offset (in pixels) with which to begin drawing the stroke dash array.
1187- StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
1188- // The stroke opacity of the interval mark (a value between 0 and 1).
1189- StrokeOpacity *float64 `json:"strokeOpacity,omitempty"`
1190- // The stroke width of the interval mark.
1191- StrokeWidth *float64 `json:"strokeWidth,omitempty"`
1171+ // The fill color of the interval mark.
1172+ //
1173+ // __Default value:__ `#333333`
1174+ Fill *string `json:"fill,omitempty"`
1175+ // The fill opacity of the interval mark (a value between 0 and 1).
1176+ //
1177+ // __Default value:__ `0.125`
1178+ FillOpacity *float64 `json:"fillOpacity,omitempty"`
1179+ // The stroke color of the interval mark.
1180+ //
1181+ // __Default value:__ `#ffffff`
1182+ Stroke *string `json:"stroke,omitempty"`
1183+ // An array of alternating stroke and space lengths,
1184+ // for creating dashed or dotted lines.
1185+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
1186+ // The offset (in pixels) with which to begin drawing the stroke dash array.
1187+ StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
1188+ // The stroke opacity of the interval mark (a value between 0 and 1).
1189+ StrokeOpacity *float64 `json:"strokeOpacity,omitempty"`
1190+ // The stroke width of the interval mark.
1191+ StrokeWidth *float64 `json:"strokeWidth,omitempty"`
11921192 }
11931193
11941194 // The default definition for a [`multi`](selection.html#type) selection. All properties and
@@ -1203,10 +1203,10 @@ type MultiSelectionConfig struct {
12031203 Empty *Empty `json:"empty,omitempty"`
12041204 // An array of encoding channels. The corresponding data field values
12051205 // must match for a data tuple to fall within the selection.
1206- Encodings []SingleDefChannel `json:"encodings,omitempty"`
1206+ Encodings *[]SingleDefChannel `json:"encodings,omitempty"`
12071207 // An array of field names whose values must match for a data tuple to
12081208 // fall within the selection.
1209- Fields []string `json:"fields,omitempty"`
1209+ Fields *[]string `json:"fields,omitempty"`
12101210 // When true, an invisible voronoi diagram is computed to accelerate discrete
12111211 // selection. The data value _nearest_ the mouse cursor is added to the selection.
12121212 //
@@ -1239,45 +1239,45 @@ type MultiSelectionConfig struct {
12391239 // For instance, setting `single` to `{"on": "dblclick"}` populates single selections on
12401240 // double-click by default.
12411241 type SingleSelectionConfig struct {
1242- // Establish a two-way binding between a single selection and input elements
1243- // (also known as dynamic query widgets). A binding takes the form of
1244- // Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)
1245- // or can be a mapping between projected field/encodings and binding definitions.
1246- //
1247- // See the [bind transform](bind.html) documentation for more information.
1248- Bind map[string]VGBinding `json:"bind,omitempty"`
1249- // By default, all data values are considered to lie within an empty selection.
1250- // When set to `none`, empty selections contain no data values.
1251- Empty *Empty `json:"empty,omitempty"`
1252- // An array of encoding channels. The corresponding data field values
1253- // must match for a data tuple to fall within the selection.
1254- Encodings []SingleDefChannel `json:"encodings,omitempty"`
1255- // An array of field names whose values must match for a data tuple to
1256- // fall within the selection.
1257- Fields []string `json:"fields,omitempty"`
1258- // When true, an invisible voronoi diagram is computed to accelerate discrete
1259- // selection. The data value _nearest_ the mouse cursor is added to the selection.
1260- //
1261- // See the [nearest transform](nearest.html) documentation for more information.
1262- Nearest *bool `json:"nearest,omitempty"`
1263- // A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
1264- // selector) that triggers the selection.
1265- // For interval selections, the event stream must specify a [start and
1266- // end](https://vega.github.io/vega/docs/event-streams/#between-filters).
1267- On interface{} `json:"on"`
1268- // With layered and multi-view displays, a strategy that determines how
1269- // selections' data queries are resolved when applied in a filter transform,
1270- // conditional encoding rule, or scale domain.
1271- Resolve *SelectionResolution `json:"resolve,omitempty"`
1242+ // Establish a two-way binding between a single selection and input elements
1243+ // (also known as dynamic query widgets). A binding takes the form of
1244+ // Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)
1245+ // or can be a mapping between projected field/encodings and binding definitions.
1246+ //
1247+ // See the [bind transform](bind.html) documentation for more information.
1248+ Bind *map[string]VGBinding `json:"bind,omitempty"`
1249+ // By default, all data values are considered to lie within an empty selection.
1250+ // When set to `none`, empty selections contain no data values.
1251+ Empty *Empty `json:"empty,omitempty"`
1252+ // An array of encoding channels. The corresponding data field values
1253+ // must match for a data tuple to fall within the selection.
1254+ Encodings *[]SingleDefChannel `json:"encodings,omitempty"`
1255+ // An array of field names whose values must match for a data tuple to
1256+ // fall within the selection.
1257+ Fields *[]string `json:"fields,omitempty"`
1258+ // When true, an invisible voronoi diagram is computed to accelerate discrete
1259+ // selection. The data value _nearest_ the mouse cursor is added to the selection.
1260+ //
1261+ // See the [nearest transform](nearest.html) documentation for more information.
1262+ Nearest *bool `json:"nearest,omitempty"`
1263+ // A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or
1264+ // selector) that triggers the selection.
1265+ // For interval selections, the event stream must specify a [start and
1266+ // end](https://vega.github.io/vega/docs/event-streams/#between-filters).
1267+ On interface{} `json:"on"`
1268+ // With layered and multi-view displays, a strategy that determines how
1269+ // selections' data queries are resolved when applied in a filter transform,
1270+ // conditional encoding rule, or scale domain.
1271+ Resolve *SelectionResolution `json:"resolve,omitempty"`
12721272 }
12731273
12741274 type VGBinding struct {
1275- Element *string `json:"element,omitempty"`
1276- Input string `json:"input"`
1277- Options []string `json:"options,omitempty"`
1278- Max *float64 `json:"max,omitempty"`
1279- Min *float64 `json:"min,omitempty"`
1280- Step *float64 `json:"step,omitempty"`
1275+ Element *string `json:"element,omitempty"`
1276+ Input string `json:"input"`
1277+ Options *[]string `json:"options,omitempty"`
1278+ Max *float64 `json:"max,omitempty"`
1279+ Min *float64 `json:"min,omitempty"`
1280+ Step *float64 `json:"step,omitempty"`
12811281 }
12821282
12831283 type VGMarkConfig struct {
@@ -1372,7 +1372,7 @@ type VGMarkConfig struct {
13721372 // __Default value:__ (None)
13731373 Stroke *string `json:"stroke,omitempty"`
13741374 // An array of alternating stroke, space lengths for creating dashed or dotted lines.
1375- StrokeDash []float64 `json:"strokeDash,omitempty"`
1375+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
13761376 // The offset (in pixels) into which to begin drawing with the stroke dash array.
13771377 StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
13781378 // The stroke opacity (value between [0,1]).
@@ -1502,7 +1502,7 @@ type TextConfig struct {
15021502 // __Default value:__ (None)
15031503 Stroke *string `json:"stroke,omitempty"`
15041504 // An array of alternating stroke, space lengths for creating dashed or dotted lines.
1505- StrokeDash []float64 `json:"strokeDash,omitempty"`
1505+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
15061506 // The offset (in pixels) into which to begin drawing with the stroke dash array.
15071507 StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
15081508 // The stroke opacity (value between [0,1]).
@@ -1634,7 +1634,7 @@ type TickConfig struct {
16341634 // __Default value:__ (None)
16351635 Stroke *string `json:"stroke,omitempty"`
16361636 // An array of alternating stroke, space lengths for creating dashed or dotted lines.
1637- StrokeDash []float64 `json:"strokeDash,omitempty"`
1637+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
16381638 // The offset (in pixels) into which to begin drawing with the stroke dash array.
16391639 StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
16401640 // The stroke opacity (value between [0,1]).
@@ -1697,47 +1697,47 @@ type VGTitleConfig struct {
16971697
16981698 // Default properties for [single view plots](spec.html#single).
16991699 type ViewConfig struct {
1700- // Whether the view should be clipped.
1701- Clip *bool `json:"clip,omitempty"`
1702- // The fill color.
1703- //
1704- // __Default value:__ (none)
1705- Fill *string `json:"fill,omitempty"`
1706- // The fill opacity (value between [0,1]).
1707- //
1708- // __Default value:__ (none)
1709- FillOpacity *float64 `json:"fillOpacity,omitempty"`
1710- // The default height of the single plot or each plot in a trellis plot when the
1711- // visualization has a continuous (non-ordinal) y-scale with `rangeStep` = `null`.
1712- //
1713- // __Default value:__ `200`
1714- Height *float64 `json:"height,omitempty"`
1715- // The stroke color.
1716- //
1717- // __Default value:__ (none)
1718- Stroke *string `json:"stroke,omitempty"`
1719- // An array of alternating stroke, space lengths for creating dashed or dotted lines.
1720- //
1721- // __Default value:__ (none)
1722- StrokeDash []float64 `json:"strokeDash,omitempty"`
1723- // The offset (in pixels) into which to begin drawing with the stroke dash array.
1724- //
1725- // __Default value:__ (none)
1726- StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
1727- // The stroke opacity (value between [0,1]).
1728- //
1729- // __Default value:__ (none)
1730- StrokeOpacity *float64 `json:"strokeOpacity,omitempty"`
1731- // The stroke width, in pixels.
1732- //
1733- // __Default value:__ (none)
1734- StrokeWidth *float64 `json:"strokeWidth,omitempty"`
1735- // The default width of the single plot or each plot in a trellis plot when the
1736- // visualization has a continuous (non-ordinal) x-scale or ordinal x-scale with `rangeStep`
1737- // = `null`.
1738- //
1739- // __Default value:__ `200`
1740- Width *float64 `json:"width,omitempty"`
1700+ // Whether the view should be clipped.
1701+ Clip *bool `json:"clip,omitempty"`
1702+ // The fill color.
1703+ //
1704+ // __Default value:__ (none)
1705+ Fill *string `json:"fill,omitempty"`
1706+ // The fill opacity (value between [0,1]).
1707+ //
1708+ // __Default value:__ (none)
1709+ FillOpacity *float64 `json:"fillOpacity,omitempty"`
1710+ // The default height of the single plot or each plot in a trellis plot when the
1711+ // visualization has a continuous (non-ordinal) y-scale with `rangeStep` = `null`.
1712+ //
1713+ // __Default value:__ `200`
1714+ Height *float64 `json:"height,omitempty"`
1715+ // The stroke color.
1716+ //
1717+ // __Default value:__ (none)
1718+ Stroke *string `json:"stroke,omitempty"`
1719+ // An array of alternating stroke, space lengths for creating dashed or dotted lines.
1720+ //
1721+ // __Default value:__ (none)
1722+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
1723+ // The offset (in pixels) into which to begin drawing with the stroke dash array.
1724+ //
1725+ // __Default value:__ (none)
1726+ StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
1727+ // The stroke opacity (value between [0,1]).
1728+ //
1729+ // __Default value:__ (none)
1730+ StrokeOpacity *float64 `json:"strokeOpacity,omitempty"`
1731+ // The stroke width, in pixels.
1732+ //
1733+ // __Default value:__ (none)
1734+ StrokeWidth *float64 `json:"strokeWidth,omitempty"`
1735+ // The default width of the single plot or each plot in a trellis plot when the
1736+ // visualization has a continuous (non-ordinal) x-scale or ordinal x-scale with `rangeStep`
1737+ // = `null`.
1738+ //
1739+ // __Default value:__ `200`
1740+ Width *float64 `json:"width,omitempty"`
17411741 }
17421742
17431743 // An object describing the data source
@@ -1975,35 +1975,35 @@ type MarkPropDefWithCondition struct {
19751975
19761976 // Binning properties or boolean flag for determining whether to bin data or not.
19771977 type BinParams struct {
1978- // The number base to use for automatic bin determination (default is base 10).
1979- //
1980- // __Default value:__ `10`
1981- Base *float64 `json:"base,omitempty"`
1982- // Scale factors indicating allowable subdivisions. The default value is [5, 2], which
1983- // indicates that for base 10 numbers (the default base), the method may consider dividing
1984- // bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can
1985- // check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the
1986- // given constraints.
1987- //
1988- // __Default value:__ `[5, 2]`
1989- Divide []float64 `json:"divide,omitempty"`
1990- // A two-element (`[min, max]`) array indicating the range of desired bin values.
1991- Extent []float64 `json:"extent,omitempty"`
1992- // Maximum number of bins.
1993- //
1994- // __Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels
1995- Maxbins *float64 `json:"maxbins,omitempty"`
1996- // A minimum allowable step size (particularly useful for integer values).
1997- Minstep *float64 `json:"minstep,omitempty"`
1998- // If true (the default), attempts to make the bin boundaries use human-friendly boundaries,
1999- // such as multiples of ten.
2000- Nice *bool `json:"nice,omitempty"`
2001- // An exact step size to use between bins.
2002- //
2003- // __Note:__ If provided, options such as maxbins will be ignored.
2004- Step *float64 `json:"step,omitempty"`
2005- // An array of allowable step sizes to choose from.
2006- Steps []float64 `json:"steps,omitempty"`
1978+ // The number base to use for automatic bin determination (default is base 10).
1979+ //
1980+ // __Default value:__ `10`
1981+ Base *float64 `json:"base,omitempty"`
1982+ // Scale factors indicating allowable subdivisions. The default value is [5, 2], which
1983+ // indicates that for base 10 numbers (the default base), the method may consider dividing
1984+ // bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can
1985+ // check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the
1986+ // given constraints.
1987+ //
1988+ // __Default value:__ `[5, 2]`
1989+ Divide *[]float64 `json:"divide,omitempty"`
1990+ // A two-element (`[min, max]`) array indicating the range of desired bin values.
1991+ Extent *[]float64 `json:"extent,omitempty"`
1992+ // Maximum number of bins.
1993+ //
1994+ // __Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels
1995+ Maxbins *float64 `json:"maxbins,omitempty"`
1996+ // A minimum allowable step size (particularly useful for integer values).
1997+ Minstep *float64 `json:"minstep,omitempty"`
1998+ // If true (the default), attempts to make the bin boundaries use human-friendly boundaries,
1999+ // such as multiples of ten.
2000+ Nice *bool `json:"nice,omitempty"`
2001+ // An exact step size to use between bins.
2002+ //
2003+ // __Note:__ If provided, options such as maxbins will be ignored.
2004+ Step *float64 `json:"step,omitempty"`
2005+ // An array of allowable step sizes to choose from.
2006+ Steps *[]float64 `json:"steps,omitempty"`
20072007 }
20082008
20092009 type ConditionalValueDef struct {
@@ -2017,33 +2017,33 @@ type ConditionalValueDef struct {
20172017 }
20182018
20192019 type Selection struct {
2020- Not *SelectionOperand `json:"not"`
2021- And []SelectionOperand `json:"and,omitempty"`
2022- Or []SelectionOperand `json:"or,omitempty"`
2020+ Not *SelectionOperand `json:"not"`
2021+ And *[]SelectionOperand `json:"and,omitempty"`
2022+ Or *[]SelectionOperand `json:"or,omitempty"`
20232023 }
20242024
20252025 type Predicate struct {
2026- Not *LogicalOperandPredicate `json:"not"`
2027- And []LogicalOperandPredicate `json:"and,omitempty"`
2028- Or []LogicalOperandPredicate `json:"or,omitempty"`
2029- // The value that the field should be equal to.
2030- Equal *Equal `json:"equal"`
2031- // Field to be filtered.
2032- //
2033- // Field to be filtered
2034- Field *string `json:"field,omitempty"`
2035- // Time unit for the field to be filtered.
2036- //
2037- // time unit for the field to be filtered.
2038- TimeUnit *TimeUnit `json:"timeUnit,omitempty"`
2039- // An array of inclusive minimum and maximum values
2040- // for a field value of a data item to be included in the filtered data.
2041- Range []RangeElement `json:"range,omitempty"`
2042- // A set of values that the `field`'s value should be a member of,
2043- // for a data item included in the filtered data.
2044- OneOf []Equal `json:"oneOf,omitempty"`
2045- // Filter using a selection name.
2046- Selection *SelectionOperand `json:"selection"`
2026+ Not *LogicalOperandPredicate `json:"not"`
2027+ And *[]LogicalOperandPredicate `json:"and,omitempty"`
2028+ Or *[]LogicalOperandPredicate `json:"or,omitempty"`
2029+ // The value that the field should be equal to.
2030+ Equal *Equal `json:"equal"`
2031+ // Field to be filtered.
2032+ //
2033+ // Field to be filtered
2034+ Field *string `json:"field,omitempty"`
2035+ // Time unit for the field to be filtered.
2036+ //
2037+ // time unit for the field to be filtered.
2038+ TimeUnit *TimeUnit `json:"timeUnit,omitempty"`
2039+ // An array of inclusive minimum and maximum values
2040+ // for a field value of a data item to be included in the filtered data.
2041+ Range *[]RangeElement `json:"range,omitempty"`
2042+ // A set of values that the `field`'s value should be a member of,
2043+ // for a data item included in the filtered data.
2044+ OneOf *[]Equal `json:"oneOf,omitempty"`
2045+ // Filter using a selection name.
2046+ Selection *SelectionOperand `json:"selection"`
20472047 }
20482048
20492049 // Object for defining datetime in Vega-Lite Filter.
@@ -2147,58 +2147,58 @@ type RepeatRef struct {
21472147
21482148 // Properties of a legend or boolean flag for determining whether to show it.
21492149 type Legend struct {
2150- // Padding (in pixels) between legend entries in a symbol legend.
2151- EntryPadding *float64 `json:"entryPadding,omitempty"`
2152- // The formatting pattern for labels. This is D3's [number format
2153- // pattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's
2154- // [time format pattern](https://github.com/d3/d3-time-format#locale_format) for time
2155- // field.
2156- //
2157- // See the [format documentation](format.html) for more information.
2158- //
2159- // __Default value:__ derived from [numberFormat](config.html#format) config for
2160- // quantitative fields and from [timeFormat](config.html#format) config for temporal fields.
2161- Format *string `json:"format,omitempty"`
2162- // The offset, in pixels, by which to displace the legend from the edge of the enclosing
2163- // group or data rectangle.
2164- //
2165- // __Default value:__ `0`
2166- Offset *float64 `json:"offset,omitempty"`
2167- // The orientation of the legend, which determines how the legend is positioned within the
2168- // scene. One of "left", "right", "top-left", "top-right", "bottom-left", "bottom-right",
2169- // "none".
2170- //
2171- // __Default value:__ `"right"`
2172- Orient *LegendOrient `json:"orient,omitempty"`
2173- // The padding, in pixels, between the legend and axis.
2174- Padding *float64 `json:"padding,omitempty"`
2175- // The desired number of tick values for quantitative legends.
2176- TickCount *float64 `json:"tickCount,omitempty"`
2177- // A title for the field. If `null`, the title will be removed.
2178- //
2179- // __Default value:__ derived from the field's name and transformation function
2180- // (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the
2181- // function is displayed as a part of the title (e.g., `"Sum of Profit"`). If the field is
2182- // binned or has a time unit applied, the applied function will be denoted in parentheses
2183- // (e.g., `"Profit (binned)"`, `"Transaction Date (year-month)"`). Otherwise, the title is
2184- // simply the field name.
2185- //
2186- // __Note__: You can customize the default field title format by providing the [`fieldTitle`
2187- // property in the [config](config.html) or [`fieldTitle` function via the `compile`
2188- // function's options](compile.html#field-title).
2189- Title *string `json:"title"`
2190- // The type of the legend. Use `"symbol"` to create a discrete legend and `"gradient"` for a
2191- // continuous color gradient.
2192- //
2193- // __Default value:__ `"gradient"` for non-binned quantitative fields and temporal fields;
2194- // `"symbol"` otherwise.
2195- Type *LegendType `json:"type,omitempty"`
2196- // Explicitly set the visible legend values.
2197- Values []LegendValue `json:"values,omitempty"`
2198- // A non-positive integer indicating z-index of the legend.
2199- // If zindex is 0, legend should be drawn behind all chart elements.
2200- // To put them in front, use zindex = 1.
2201- Zindex *float64 `json:"zindex,omitempty"`
2150+ // Padding (in pixels) between legend entries in a symbol legend.
2151+ EntryPadding *float64 `json:"entryPadding,omitempty"`
2152+ // The formatting pattern for labels. This is D3's [number format
2153+ // pattern](https://github.com/d3/d3-format#locale_format) for quantitative fields and D3's
2154+ // [time format pattern](https://github.com/d3/d3-time-format#locale_format) for time
2155+ // field.
2156+ //
2157+ // See the [format documentation](format.html) for more information.
2158+ //
2159+ // __Default value:__ derived from [numberFormat](config.html#format) config for
2160+ // quantitative fields and from [timeFormat](config.html#format) config for temporal fields.
2161+ Format *string `json:"format,omitempty"`
2162+ // The offset, in pixels, by which to displace the legend from the edge of the enclosing
2163+ // group or data rectangle.
2164+ //
2165+ // __Default value:__ `0`
2166+ Offset *float64 `json:"offset,omitempty"`
2167+ // The orientation of the legend, which determines how the legend is positioned within the
2168+ // scene. One of "left", "right", "top-left", "top-right", "bottom-left", "bottom-right",
2169+ // "none".
2170+ //
2171+ // __Default value:__ `"right"`
2172+ Orient *LegendOrient `json:"orient,omitempty"`
2173+ // The padding, in pixels, between the legend and axis.
2174+ Padding *float64 `json:"padding,omitempty"`
2175+ // The desired number of tick values for quantitative legends.
2176+ TickCount *float64 `json:"tickCount,omitempty"`
2177+ // A title for the field. If `null`, the title will be removed.
2178+ //
2179+ // __Default value:__ derived from the field's name and transformation function
2180+ // (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the
2181+ // function is displayed as a part of the title (e.g., `"Sum of Profit"`). If the field is
2182+ // binned or has a time unit applied, the applied function will be denoted in parentheses
2183+ // (e.g., `"Profit (binned)"`, `"Transaction Date (year-month)"`). Otherwise, the title is
2184+ // simply the field name.
2185+ //
2186+ // __Note__: You can customize the default field title format by providing the [`fieldTitle`
2187+ // property in the [config](config.html) or [`fieldTitle` function via the `compile`
2188+ // function's options](compile.html#field-title).
2189+ Title *string `json:"title"`
2190+ // The type of the legend. Use `"symbol"` to create a discrete legend and `"gradient"` for a
2191+ // continuous color gradient.
2192+ //
2193+ // __Default value:__ `"gradient"` for non-binned quantitative fields and temporal fields;
2194+ // `"symbol"` otherwise.
2195+ Type *LegendType `json:"type,omitempty"`
2196+ // Explicitly set the visible legend values.
2197+ Values *[]LegendValue `json:"values,omitempty"`
2198+ // A non-positive integer indicating z-index of the legend.
2199+ // If zindex is 0, legend should be drawn behind all chart elements.
2200+ // To put them in front, use zindex = 1.
2201+ Zindex *float64 `json:"zindex,omitempty"`
22022202 }
22032203
22042204 // An object defining properties of the channel's scale, which is the function that
@@ -2401,15 +2401,15 @@ type NiceClass struct {
24012401 }
24022402
24032403 type SchemeParams struct {
2404- // For sequential and diverging schemes only, determines the extent of the color range to
2405- // use. For example `[0.2, 1]` will rescale the color scheme such that color values in the
2406- // range _[0, 0.2)_ are excluded from the scheme.
2407- Extent []float64 `json:"extent,omitempty"`
2408- // A color scheme name for sequential/ordinal scales (e.g., `"category10"` or `"viridis"`).
2409- //
2410- // For the full list of supported scheme, please refer to the [Vega
2411- // Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.
2412- Name string `json:"name"`
2404+ // For sequential and diverging schemes only, determines the extent of the color range to
2405+ // use. For example `[0.2, 1]` will rescale the color scheme such that color values in the
2406+ // range _[0, 0.2)_ are excluded from the scheme.
2407+ Extent *[]float64 `json:"extent,omitempty"`
2408+ // A color scheme name for sequential/ordinal scales (e.g., `"category10"` or `"viridis"`).
2409+ //
2410+ // For the full list of supported scheme, please refer to the [Vega
2411+ // Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.
2412+ Name string `json:"name"`
24132413 }
24142414
24152415 type SortField struct {
@@ -2985,7 +2985,7 @@ type Axis struct {
29852985 // The padding, in pixels, between title and axis.
29862986 TitlePadding *float64 `json:"titlePadding,omitempty"`
29872987 // Explicitly set the visible axis tick values.
2988- Values []AxisValue `json:"values,omitempty"`
2988+ Values *[]AxisValue `json:"values,omitempty"`
29892989 // A non-positive integer indicating z-index of the axis.
29902990 // If zindex is 0, axes should be drawn behind all chart elements.
29912991 // To put them in front, use `"zindex = 1"`.
@@ -3051,96 +3051,96 @@ type FacetMapping struct {
30513051
30523052 // Unit spec that can have a composite mark.
30533053 type Spec struct {
3054- // An object describing the data source
3055- Data *Data `json:"data,omitempty"`
3056- // Description of this mark for commenting purpose.
3057- Description *string `json:"description,omitempty"`
3058- // The height of a visualization.
3059- //
3060- // __Default value:__
3061- // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
3062- // [continuous scale](scale.html#continuous), the height will be the value of
3063- // [`config.view.height`](spec.html#config).
3064- // - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3065- // value or unspecified, the height is [determined by the range step, paddings, and the
3066- // cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
3067- // `rangeStep` is `null`, the height will be the value of
3068- // [`config.view.height`](spec.html#config).
3069- // - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
3070- //
3071- // __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
3072- // represents the height of a single view.
3073- //
3074- // __See also:__ The documentation for [width and height](size.html) contains more examples.
3075- Height *float64 `json:"height,omitempty"`
3076- // Layer or single view specifications to be layered.
3077- //
3078- // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
3079- // layering facet specifications is not allowed.
3080- Layer []LayerSpec `json:"layer,omitempty"`
3081- // Name of the visualization for later reference.
3082- Name *string `json:"name,omitempty"`
3083- // Scale, axis, and legend resolutions for layers.
3084- //
3085- // Scale, axis, and legend resolutions for facets.
3086- //
3087- // Scale and legend resolutions for repeated charts.
3088- //
3089- // Scale, axis, and legend resolutions for vertically concatenated charts.
3090- //
3091- // Scale, axis, and legend resolutions for horizontally concatenated charts.
3092- Resolve *Resolve `json:"resolve,omitempty"`
3093- // Title for the plot.
3094- Title *Title `json:"title"`
3095- // An array of data transformations such as filter and new field calculation.
3096- Transform []Transform `json:"transform,omitempty"`
3097- // The width of a visualization.
3098- //
3099- // __Default value:__ This will be determined by the following rules:
3100- //
3101- // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
3102- // [continuous scale](scale.html#continuous), the width will be the value of
3103- // [`config.view.width`](spec.html#config).
3104- // - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3105- // value or unspecified, the width is [determined by the range step, paddings, and the
3106- // cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
3107- // `rangeStep` is `null`, the width will be the value of
3108- // [`config.view.width`](spec.html#config).
3109- // - If no field is mapped to `x` channel, the `width` will be the value of
3110- // [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
3111- // the value of `rangeStep` for other marks.
3112- //
3113- // __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
3114- // represents the width of a single view.
3115- //
3116- // __See also:__ The documentation for [width and height](size.html) contains more examples.
3117- Width *float64 `json:"width,omitempty"`
3118- // A key-value mapping between encoding channels and definition of fields.
3119- Encoding *Encoding `json:"encoding,omitempty"`
3120- // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
3121- // `"line"`,
3122- // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
3123- // object](mark.html#mark-def).
3124- Mark *AnyMark `json:"mark"`
3125- // An object defining properties of geographic projection.
3126- //
3127- // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
3128- // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
3129- Projection *Projection `json:"projection,omitempty"`
3130- // A key-value mapping between selection names and definitions.
3131- Selection map[string]SelectionDef `json:"selection,omitempty"`
3132- // An object that describes mappings between `row` and `column` channels and their field
3133- // definitions.
3134- Facet *FacetMapping `json:"facet,omitempty"`
3135- // A specification of the view that gets faceted.
3136- Spec *Spec `json:"spec,omitempty"`
3137- // An object that describes what fields should be repeated into views that are laid out as a
3138- // `row` or `column`.
3139- Repeat *Repeat `json:"repeat,omitempty"`
3140- // A list of views that should be concatenated and put into a column.
3141- Vconcat []Spec `json:"vconcat,omitempty"`
3142- // A list of views that should be concatenated and put into a row.
3143- Hconcat []Spec `json:"hconcat,omitempty"`
3054+ // An object describing the data source
3055+ Data *Data `json:"data,omitempty"`
3056+ // Description of this mark for commenting purpose.
3057+ Description *string `json:"description,omitempty"`
3058+ // The height of a visualization.
3059+ //
3060+ // __Default value:__
3061+ // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
3062+ // [continuous scale](scale.html#continuous), the height will be the value of
3063+ // [`config.view.height`](spec.html#config).
3064+ // - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3065+ // value or unspecified, the height is [determined by the range step, paddings, and the
3066+ // cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
3067+ // `rangeStep` is `null`, the height will be the value of
3068+ // [`config.view.height`](spec.html#config).
3069+ // - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
3070+ //
3071+ // __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
3072+ // represents the height of a single view.
3073+ //
3074+ // __See also:__ The documentation for [width and height](size.html) contains more examples.
3075+ Height *float64 `json:"height,omitempty"`
3076+ // Layer or single view specifications to be layered.
3077+ //
3078+ // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
3079+ // layering facet specifications is not allowed.
3080+ Layer *[]LayerSpec `json:"layer,omitempty"`
3081+ // Name of the visualization for later reference.
3082+ Name *string `json:"name,omitempty"`
3083+ // Scale, axis, and legend resolutions for layers.
3084+ //
3085+ // Scale, axis, and legend resolutions for facets.
3086+ //
3087+ // Scale and legend resolutions for repeated charts.
3088+ //
3089+ // Scale, axis, and legend resolutions for vertically concatenated charts.
3090+ //
3091+ // Scale, axis, and legend resolutions for horizontally concatenated charts.
3092+ Resolve *Resolve `json:"resolve,omitempty"`
3093+ // Title for the plot.
3094+ Title *Title `json:"title"`
3095+ // An array of data transformations such as filter and new field calculation.
3096+ Transform *[]Transform `json:"transform,omitempty"`
3097+ // The width of a visualization.
3098+ //
3099+ // __Default value:__ This will be determined by the following rules:
3100+ //
3101+ // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
3102+ // [continuous scale](scale.html#continuous), the width will be the value of
3103+ // [`config.view.width`](spec.html#config).
3104+ // - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3105+ // value or unspecified, the width is [determined by the range step, paddings, and the
3106+ // cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
3107+ // `rangeStep` is `null`, the width will be the value of
3108+ // [`config.view.width`](spec.html#config).
3109+ // - If no field is mapped to `x` channel, the `width` will be the value of
3110+ // [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
3111+ // the value of `rangeStep` for other marks.
3112+ //
3113+ // __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
3114+ // represents the width of a single view.
3115+ //
3116+ // __See also:__ The documentation for [width and height](size.html) contains more examples.
3117+ Width *float64 `json:"width,omitempty"`
3118+ // A key-value mapping between encoding channels and definition of fields.
3119+ Encoding *Encoding `json:"encoding,omitempty"`
3120+ // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
3121+ // `"line"`,
3122+ // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
3123+ // object](mark.html#mark-def).
3124+ Mark *AnyMark `json:"mark"`
3125+ // An object defining properties of geographic projection.
3126+ //
3127+ // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
3128+ // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
3129+ Projection *Projection `json:"projection,omitempty"`
3130+ // A key-value mapping between selection names and definitions.
3131+ Selection *map[string]SelectionDef `json:"selection,omitempty"`
3132+ // An object that describes mappings between `row` and `column` channels and their field
3133+ // definitions.
3134+ Facet *FacetMapping `json:"facet,omitempty"`
3135+ // A specification of the view that gets faceted.
3136+ Spec *Spec `json:"spec,omitempty"`
3137+ // An object that describes what fields should be repeated into views that are laid out as a
3138+ // `row` or `column`.
3139+ Repeat *Repeat `json:"repeat,omitempty"`
3140+ // A list of views that should be concatenated and put into a column.
3141+ Vconcat *[]Spec `json:"vconcat,omitempty"`
3142+ // A list of views that should be concatenated and put into a row.
3143+ Hconcat *[]Spec `json:"hconcat,omitempty"`
31443144 }
31453145
31463146 // A key-value mapping between encoding channels and definition of fields.
@@ -3201,76 +3201,76 @@ type Encoding struct {
32013201
32023202 // Unit spec that can have a composite mark.
32033203 type LayerSpec struct {
3204- // An object describing the data source
3205- Data *Data `json:"data,omitempty"`
3206- // Description of this mark for commenting purpose.
3207- Description *string `json:"description,omitempty"`
3208- // The height of a visualization.
3209- //
3210- // __Default value:__
3211- // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
3212- // [continuous scale](scale.html#continuous), the height will be the value of
3213- // [`config.view.height`](spec.html#config).
3214- // - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3215- // value or unspecified, the height is [determined by the range step, paddings, and the
3216- // cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
3217- // `rangeStep` is `null`, the height will be the value of
3218- // [`config.view.height`](spec.html#config).
3219- // - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
3220- //
3221- // __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
3222- // represents the height of a single view.
3223- //
3224- // __See also:__ The documentation for [width and height](size.html) contains more examples.
3225- Height *float64 `json:"height,omitempty"`
3226- // Layer or single view specifications to be layered.
3227- //
3228- // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
3229- // layering facet specifications is not allowed.
3230- Layer []LayerSpec `json:"layer,omitempty"`
3231- // Name of the visualization for later reference.
3232- Name *string `json:"name,omitempty"`
3233- // Scale, axis, and legend resolutions for layers.
3234- Resolve *Resolve `json:"resolve,omitempty"`
3235- // Title for the plot.
3236- Title *Title `json:"title"`
3237- // An array of data transformations such as filter and new field calculation.
3238- Transform []Transform `json:"transform,omitempty"`
3239- // The width of a visualization.
3240- //
3241- // __Default value:__ This will be determined by the following rules:
3242- //
3243- // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
3244- // [continuous scale](scale.html#continuous), the width will be the value of
3245- // [`config.view.width`](spec.html#config).
3246- // - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3247- // value or unspecified, the width is [determined by the range step, paddings, and the
3248- // cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
3249- // `rangeStep` is `null`, the width will be the value of
3250- // [`config.view.width`](spec.html#config).
3251- // - If no field is mapped to `x` channel, the `width` will be the value of
3252- // [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
3253- // the value of `rangeStep` for other marks.
3254- //
3255- // __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
3256- // represents the width of a single view.
3257- //
3258- // __See also:__ The documentation for [width and height](size.html) contains more examples.
3259- Width *float64 `json:"width,omitempty"`
3260- // A key-value mapping between encoding channels and definition of fields.
3261- Encoding *Encoding `json:"encoding,omitempty"`
3262- // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
3263- // `"line"`,
3264- // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
3265- // object](mark.html#mark-def).
3266- Mark *AnyMark `json:"mark"`
3267- // An object defining properties of geographic projection.
3268- //
3269- // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
3270- // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
3271- Projection *Projection `json:"projection,omitempty"`
3272- // A key-value mapping between selection names and definitions.
3273- Selection map[string]SelectionDef `json:"selection,omitempty"`
3204+ // An object describing the data source
3205+ Data *Data `json:"data,omitempty"`
3206+ // Description of this mark for commenting purpose.
3207+ Description *string `json:"description,omitempty"`
3208+ // The height of a visualization.
3209+ //
3210+ // __Default value:__
3211+ // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its y-channel has a
3212+ // [continuous scale](scale.html#continuous), the height will be the value of
3213+ // [`config.view.height`](spec.html#config).
3214+ // - For y-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3215+ // value or unspecified, the height is [determined by the range step, paddings, and the
3216+ // cardinality of the field mapped to y-channel](scale.html#band). Otherwise, if the
3217+ // `rangeStep` is `null`, the height will be the value of
3218+ // [`config.view.height`](spec.html#config).
3219+ // - If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.
3220+ //
3221+ // __Note__: For plots with [`row` and `column` channels](encoding.html#facet), this
3222+ // represents the height of a single view.
3223+ //
3224+ // __See also:__ The documentation for [width and height](size.html) contains more examples.
3225+ Height *float64 `json:"height,omitempty"`
3226+ // Layer or single view specifications to be layered.
3227+ //
3228+ // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
3229+ // layering facet specifications is not allowed.
3230+ Layer *[]LayerSpec `json:"layer,omitempty"`
3231+ // Name of the visualization for later reference.
3232+ Name *string `json:"name,omitempty"`
3233+ // Scale, axis, and legend resolutions for layers.
3234+ Resolve *Resolve `json:"resolve,omitempty"`
3235+ // Title for the plot.
3236+ Title *Title `json:"title"`
3237+ // An array of data transformations such as filter and new field calculation.
3238+ Transform *[]Transform `json:"transform,omitempty"`
3239+ // The width of a visualization.
3240+ //
3241+ // __Default value:__ This will be determined by the following rules:
3242+ //
3243+ // - If a view's [`autosize`](size.html#autosize) type is `"fit"` or its x-channel has a
3244+ // [continuous scale](scale.html#continuous), the width will be the value of
3245+ // [`config.view.width`](spec.html#config).
3246+ // - For x-axis with a band or point scale: if [`rangeStep`](scale.html#band) is a numeric
3247+ // value or unspecified, the width is [determined by the range step, paddings, and the
3248+ // cardinality of the field mapped to x-channel](scale.html#band). Otherwise, if the
3249+ // `rangeStep` is `null`, the width will be the value of
3250+ // [`config.view.width`](spec.html#config).
3251+ // - If no field is mapped to `x` channel, the `width` will be the value of
3252+ // [`config.scale.textXRangeStep`](size.html#default-width-and-height) for `text` mark and
3253+ // the value of `rangeStep` for other marks.
3254+ //
3255+ // __Note:__ For plots with [`row` and `column` channels](encoding.html#facet), this
3256+ // represents the width of a single view.
3257+ //
3258+ // __See also:__ The documentation for [width and height](size.html) contains more examples.
3259+ Width *float64 `json:"width,omitempty"`
3260+ // A key-value mapping between encoding channels and definition of fields.
3261+ Encoding *Encoding `json:"encoding,omitempty"`
3262+ // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
3263+ // `"line"`,
3264+ // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
3265+ // object](mark.html#mark-def).
3266+ Mark *AnyMark `json:"mark"`
3267+ // An object defining properties of geographic projection.
3268+ //
3269+ // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
3270+ // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
3271+ Projection *Projection `json:"projection,omitempty"`
3272+ // A key-value mapping between selection names and definitions.
3273+ Selection *map[string]SelectionDef `json:"selection,omitempty"`
32743274 }
32753275
32763276 type MarkDef struct {
@@ -3382,7 +3382,7 @@ type MarkDef struct {
33823382 // __Default value:__ (None)
33833383 Stroke *string `json:"stroke,omitempty"`
33843384 // An array of alternating stroke, space lengths for creating dashed or dotted lines.
3385- StrokeDash []float64 `json:"strokeDash,omitempty"`
3385+ StrokeDash *[]float64 `json:"strokeDash,omitempty"`
33863386 // The offset (in pixels) into which to begin drawing with the stroke dash array.
33873387 StrokeDashOffset *float64 `json:"strokeDashOffset,omitempty"`
33883388 // The stroke opacity (value between [0,1]).
@@ -3423,49 +3423,49 @@ type MarkDef struct {
34233423 // Works with `"geoshape"` marks and `"point"` or `"line"` marks that have a channel (one or
34243424 // more of `"X"`, `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`.
34253425 type Projection struct {
3426- // Sets the projection’s center to the specified center, a two-element array of longitude
3427- // and latitude in degrees.
3428- //
3429- // __Default value:__ `[0, 0]`
3430- Center []float64 `json:"center,omitempty"`
3431- // Sets the projection’s clipping circle radius to the specified angle in degrees. If
3432- // `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
3433- // than small-circle clipping.
3434- ClipAngle *float64 `json:"clipAngle,omitempty"`
3435- // Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
3436- // bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
3437- // the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
3438- // viewport clipping is performed.
3439- ClipExtent [][]float64 `json:"clipExtent,omitempty"`
3440- Coefficient *float64 `json:"coefficient,omitempty"`
3441- Distance *float64 `json:"distance,omitempty"`
3442- Fraction *float64 `json:"fraction,omitempty"`
3443- Lobes *float64 `json:"lobes,omitempty"`
3444- Parallel *float64 `json:"parallel,omitempty"`
3445- // Sets the threshold for the projection’s [adaptive
3446- // resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
3447- // value corresponds to the [Douglas–Peucker
3448- // distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
3449- // If precision is not specified, returns the projection’s current resampling precision
3450- // which defaults to `√0.5 ≅ 0.70710…`.
3451- Precision map[string]*TitleFontWeight `json:"precision,omitempty"`
3452- Radius *float64 `json:"radius,omitempty"`
3453- Ratio *float64 `json:"ratio,omitempty"`
3454- // Sets the projection’s three-axis rotation to the specified angles, which must be a two-
3455- // or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
3456- // angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
3457- //
3458- // __Default value:__ `[0, 0, 0]`
3459- Rotate []float64 `json:"rotate,omitempty"`
3460- Spacing *float64 `json:"spacing,omitempty"`
3461- Tilt *float64 `json:"tilt,omitempty"`
3462- // The cartographic projection to use. This value is case-insensitive, for example
3463- // `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
3464- // projection types [in the
3465- // documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
3466- //
3467- // __Default value:__ `mercator`
3468- Type *VGProjectionType `json:"type,omitempty"`
3426+ // Sets the projection’s center to the specified center, a two-element array of longitude
3427+ // and latitude in degrees.
3428+ //
3429+ // __Default value:__ `[0, 0]`
3430+ Center *[]float64 `json:"center,omitempty"`
3431+ // Sets the projection’s clipping circle radius to the specified angle in degrees. If
3432+ // `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather
3433+ // than small-circle clipping.
3434+ ClipAngle *float64 `json:"clipAngle,omitempty"`
3435+ // Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent
3436+ // bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of
3437+ // the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no
3438+ // viewport clipping is performed.
3439+ ClipExtent *[][]float64 `json:"clipExtent,omitempty"`
3440+ Coefficient *float64 `json:"coefficient,omitempty"`
3441+ Distance *float64 `json:"distance,omitempty"`
3442+ Fraction *float64 `json:"fraction,omitempty"`
3443+ Lobes *float64 `json:"lobes,omitempty"`
3444+ Parallel *float64 `json:"parallel,omitempty"`
3445+ // Sets the threshold for the projection’s [adaptive
3446+ // resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This
3447+ // value corresponds to the [Douglas–Peucker
3448+ // distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
3449+ // If precision is not specified, returns the projection’s current resampling precision
3450+ // which defaults to `√0.5 ≅ 0.70710…`.
3451+ Precision *map[string]*TitleFontWeight `json:"precision,omitempty"`
3452+ Radius *float64 `json:"radius,omitempty"`
3453+ Ratio *float64 `json:"ratio,omitempty"`
3454+ // Sets the projection’s three-axis rotation to the specified angles, which must be a two-
3455+ // or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation
3456+ // angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
3457+ //
3458+ // __Default value:__ `[0, 0, 0]`
3459+ Rotate *[]float64 `json:"rotate,omitempty"`
3460+ Spacing *float64 `json:"spacing,omitempty"`
3461+ Tilt *float64 `json:"tilt,omitempty"`
3462+ // The cartographic projection to use. This value is case-insensitive, for example
3463+ // `"albers"` and `"Albers"` indicate the same projection type. You can find all valid
3464+ // projection types [in the
3465+ // documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).
3466+ //
3467+ // __Default value:__ `mercator`
3468+ Type *VGProjectionType `json:"type,omitempty"`
34693469 }
34703470
34713471 // Scale, axis, and legend resolutions for layers.
@@ -3524,10 +3524,10 @@ type SelectionDef struct {
35243524 Empty *Empty `json:"empty,omitempty"`
35253525 // An array of encoding channels. The corresponding data field values
35263526 // must match for a data tuple to fall within the selection.
3527- Encodings []SingleDefChannel `json:"encodings,omitempty"`
3527+ Encodings *[]SingleDefChannel `json:"encodings,omitempty"`
35283528 // An array of field names whose values must match for a data tuple to
35293529 // fall within the selection.
3530- Fields []string `json:"fields,omitempty"`
3530+ Fields *[]string `json:"fields,omitempty"`
35313531 // When true, an invisible voronoi diagram is computed to accelerate discrete
35323532 // selection. The data value _nearest_ the mouse cursor is added to the selection.
35333533 //
@@ -3642,10 +3642,10 @@ type Transform struct {
36423642 // The timeUnit.
36433643 TimeUnit *TimeUnit `json:"timeUnit,omitempty"`
36443644 // Array of objects that define fields to aggregate.
3645- Aggregate []AggregatedFieldDef `json:"aggregate,omitempty"`
3645+ Aggregate *[]AggregatedFieldDef `json:"aggregate,omitempty"`
36463646 // The data fields to group by. If not specified, a single group containing all data objects
36473647 // will be used.
3648- Groupby []string `json:"groupby,omitempty"`
3648+ Groupby *[]string `json:"groupby,omitempty"`
36493649 }
36503650
36513651 type AggregatedFieldDef struct {
@@ -3662,22 +3662,22 @@ type AggregatedFieldDef struct {
36623662
36633663 // Secondary data reference.
36643664 type LookupData struct {
3665- // Secondary data source to lookup in.
3666- Data Data `json:"data"`
3667- // Fields in foreign data to lookup.
3668- // If not specified, the entire object is queried.
3669- Fields []string `json:"fields,omitempty"`
3670- // Key in data to lookup.
3671- Key string `json:"key"`
3665+ // Secondary data source to lookup in.
3666+ Data Data `json:"data"`
3667+ // Fields in foreign data to lookup.
3668+ // If not specified, the entire object is queried.
3669+ Fields *[]string `json:"fields,omitempty"`
3670+ // Key in data to lookup.
3671+ Key string `json:"key"`
36723672 }
36733673
36743674 // An object that describes what fields should be repeated into views that are laid out as a
36753675 // `row` or `column`.
36763676 type Repeat struct {
3677- // Horizontal repeated views.
3678- Column []string `json:"column,omitempty"`
3679- // Vertical repeated views.
3680- Row []string `json:"row,omitempty"`
3677+ // Horizontal repeated views.
3678+ Column *[]string `json:"column,omitempty"`
3679+ // Vertical repeated views.
3680+ Row *[]string `json:"row,omitempty"`
36813681 }
36823682
36833683 // Determines how size calculation should be performed, one of `"content"` or `"padding"`.
No generated files match these filters.