Skip to content

Commit

Permalink
fix: allow any value as default value in lookup transforms (#7074)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored Dec 2, 2020
1 parent 4081b2a commit 522d327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10398,7 +10398,7 @@
"properties": {
"filter": {
"$ref": "#/definitions/PredicateComposition",
"description": "The `filter` property must be a predication definition, which can take one of the following forms:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string, where `datum` can be used to refer to the current data object. For example, `{filter: \"datum.b2 > 60\"}` would make the output data includes only items that have values in the field `b2` over 60.\n\n2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate): [`equal`](https://vega.github.io/vega-lite/docs/predicate.html#field-equal-predicate), [`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate), [`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate), [`gt`](https://vega.github.io/vega-lite/docs/predicate.html#gt-predicate), [`gte`](https://vega.github.io/vega-lite/docs/predicate.html#gte-predicate), [`range`](https://vega.github.io/vega-lite/docs/predicate.html#range-predicate), [`oneOf`](https://vega.github.io/vega-lite/docs/predicate.html#one-of-predicate), or [`valid`](https://vega.github.io/vega-lite/docs/predicate.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/predicate.html#selection-predicate), which define the names of a selection that the data point should belong to (or a logical composition of selections).\n\n4) a [logical composition](https://vega.github.io/vega-lite/docs/predicate.html#composition) of (1), (2), or (3)."
"description": "The `filter` property must be a predication definition, which can take one of the following forms:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string, where `datum` can be used to refer to the current data object. For example, `{filter: \"datum.b2 > 60\"}` would make the output data includes only items that have values in the field `b2` over 60.\n\n2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate): [`equal`](https://vega.github.io/vega-lite/docs/predicate.html#field-equal-predicate), [`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate), [`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate), [`gt`](https://vega.github.io/vega-lite/docs/predicate.html#gt-predicate), [`gte`](https://vega.github.io/vega-lite/docs/predicate.html#gte-predicate), [`range`](https://vega.github.io/vega-lite/docs/predicate.html#range-predicate), [`oneOf`](https://vega.github.io/vega-lite/docs/predicate.html#one-of-predicate), or [`valid`](https://vega.github.io/vega-lite/docs/predicate.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/predicate.html#selection-predicate), which define the names of a selection that the data point should belong to (or a logical composition of selections).\n\n4) a [logical composition](https://vega.github.io/vega-lite/docs/predicate.html#composition) of (1), (2), or (3)."
}
},
"required": [
Expand Down Expand Up @@ -15238,8 +15238,7 @@
"description": "The output fields on which to store the looked up data values.\n\nFor data lookups, this property may be left blank if `from.fields` has been specified (those field names will be used); if `from.fields` has not been specified, `as` must be a string.\n\nFor selection lookups, this property is optional: if unspecified, looked up values will be stored under a property named for the selection; and if specified, it must correspond to `from.fields`."
},
"default": {
"description": "The default value to use if lookup fails.\n\n__Default value:__ `null`",
"type": "string"
"description": "The default value to use if lookup fails.\n\n__Default value:__ `null`"
},
"from": {
"anyOf": [
Expand Down
4 changes: 2 additions & 2 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface FilterTransform {
* where `datum` can be used to refer to the current data object.
* For example, `{filter: "datum.b2 > 60"}` would make the output data includes only items that have values in the field `b2` over 60.
*
* 2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate):
* 2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate):
* [`equal`](https://vega.github.io/vega-lite/docs/predicate.html#field-equal-predicate),
* [`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate),
* [`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate),
Expand Down Expand Up @@ -356,7 +356,7 @@ export interface LookupTransform {
*
* __Default value:__ `null`
*/
default?: string;
default?: any;

/**
* Data source or selection for secondary data reference.
Expand Down

0 comments on commit 522d327

Please sign in to comment.