diff --git a/_data/link.yml b/_data/link.yml index 3918de9ee4..371f2b6e99 100644 --- a/_data/link.yml +++ b/_data/link.yml @@ -128,6 +128,8 @@ SingleDefChannel: SingleDefUnitChannel: name: "Channel" link: "encoding.html#channels" +AllSortString: + name: "String" # Channel Definitions NumericFieldDefWithCondition: diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 8aa5c544b5..454a7a2834 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -95,6 +95,19 @@ ], "type": "string" }, + "AllSortString": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/SortByChannel" + }, + { + "$ref": "#/definitions/SortByChannelDesc" + } + ] + }, "AnyMark": { "anyOf": [ { @@ -2528,7 +2541,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "test": { "$ref": "#/definitions/LogicalOperand", @@ -2605,7 +2618,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "test": { "$ref": "#/definitions/LogicalOperand", @@ -2812,7 +2825,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", @@ -2889,7 +2902,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", @@ -4420,7 +4433,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", @@ -4507,7 +4520,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", @@ -4594,7 +4607,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", @@ -9340,7 +9353,7 @@ }, "sort": { "$ref": "#/definitions/Sort", - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ @@ -10808,7 +10821,6 @@ "shape", "key", "text", - "tooltip", "href", "url" ], @@ -10978,7 +10990,7 @@ "$ref": "#/definitions/SortArray" }, { - "$ref": "#/definitions/SortOrder" + "$ref": "#/definitions/AllSortString" }, { "$ref": "#/definitions/EncodingSortField" @@ -11019,11 +11031,45 @@ } ] }, + "SortByChannel": { + "enum": [ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text" + ], + "type": "string" + }, + "SortByChannelDesc": { + "enum": [ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text" + ], + "type": "string" + }, "SortByEncoding": { "additionalProperties": false, "properties": { "encoding": { - "$ref": "#/definitions/SingleDefUnitChannel", + "$ref": "#/definitions/SortByChannel", "description": "The [encoding channel](https://vega.github.io/vega-lite/docs/encoding.html#channels) to sort by (e.g., `\"x\"`, `\"y\"`)" }, "order": { diff --git a/examples/compiled/bar_aggregate_sort_by_encoding.svg b/examples/compiled/bar_aggregate_sort_by_encoding.svg index caf66bae8d..57e7f02dc0 100644 --- a/examples/compiled/bar_aggregate_sort_by_encoding.svg +++ b/examples/compiled/bar_aggregate_sort_by_encoding.svg @@ -1 +1 @@ -05,000,00010,000,00015,000,00020,000,000population908580757065605550020251545301054035age \ No newline at end of file +05,000,00010,000,00015,000,00020,000,000population354051030451525200505560657075808590age \ No newline at end of file diff --git a/examples/compiled/bar_aggregate_sort_by_encoding.vg.json b/examples/compiled/bar_aggregate_sort_by_encoding.vg.json index 31365cd30e..6f83cb6b9e 100644 --- a/examples/compiled/bar_aggregate_sort_by_encoding.vg.json +++ b/examples/compiled/bar_aggregate_sort_by_encoding.vg.json @@ -65,7 +65,7 @@ "domain": { "data": "source_0", "field": "age", - "sort": {"op": "sum", "field": "people"} + "sort": {"op": "sum", "field": "people", "order": "descending"} }, "range": {"step": {"signal": "y_step"}}, "paddingInner": 0.1, diff --git a/examples/compiled/trellis_barley.svg b/examples/compiled/trellis_barley.svg index ca74224193..e69de29bb2 100644 --- a/examples/compiled/trellis_barley.svg +++ b/examples/compiled/trellis_barley.svg @@ -1 +0,0 @@ -siteTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462Svansotavariety10203040506070Median of yield10203040506070Median of yieldGrand RapidsDuluthUniversity FarmMorrisCrookstonWaseca19311932year \ No newline at end of file diff --git a/examples/compiled/trellis_barley.vg.json b/examples/compiled/trellis_barley.vg.json index d90e5e9c84..e69de29bb2 100644 --- a/examples/compiled/trellis_barley.vg.json +++ b/examples/compiled/trellis_barley.vg.json @@ -1,237 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega/v5.json", - "description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.", - "autosize": "pad", - "padding": 5, - "data": [ - {"name": "source_0", "url": "data/barley.json", "format": {"type": "json"}}, - { - "name": "trellis_barley_facet_domain", - "source": "source_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["site"], - "fields": ["yield"], - "ops": ["median"], - "as": ["median_yield"] - } - ] - }, - { - "name": "trellis_barley_facet_domain_row", - "transform": [ - { - "type": "sequence", - "start": 0, - "stop": { - "signal": "ceil(length(data(\"trellis_barley_facet_domain\")) / 2)" - } - } - ] - }, - { - "name": "trellis_barley_facet_domain_column", - "transform": [ - { - "type": "sequence", - "start": 0, - "stop": { - "signal": "min(length(data(\"trellis_barley_facet_domain\")), 2)" - } - } - ] - }, - { - "name": "data_2", - "source": "source_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["variety", "year", "site"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - } - ], - "signals": [ - {"name": "trellis_barley_child_width", "value": 200}, - {"name": "trellis_barley_y_step", "value": 12}, - { - "name": "trellis_barley_child_height", - "update": "bandspace(domain('trellis_barley_y').length, 1, 0.5) * trellis_barley_y_step" - } - ], - "layout": {"padding": 20, "bounds": "full", "align": "all", "columns": 2}, - "marks": [ - { - "name": "facet-title", - "type": "group", - "role": "column-title", - "title": {"text": "site", "style": "guide-title", "offset": 10} - }, - { - "name": "trellis_barley_row_header", - "type": "group", - "role": "row-header", - "from": {"data": "trellis_barley_facet_domain_row"}, - "encode": { - "update": {"height": {"signal": "trellis_barley_child_height"}} - }, - "axes": [ - { - "scale": "trellis_barley_y", - "orient": "left", - "grid": false, - "title": "variety", - "labelOverlap": true, - "zindex": 1 - } - ] - }, - { - "name": "trellis_barley_column_footer", - "type": "group", - "role": "column-footer", - "from": {"data": "trellis_barley_facet_domain_column"}, - "encode": {"update": {"width": {"signal": "trellis_barley_child_width"}}}, - "axes": [ - { - "scale": "trellis_barley_x", - "orient": "bottom", - "grid": false, - "title": "Median of yield", - "labelFlush": true, - "labelOverlap": true, - "tickCount": {"signal": "ceil(trellis_barley_child_width/40)"}, - "zindex": 1 - } - ] - }, - { - "name": "trellis_barley_cell", - "type": "group", - "title": { - "text": {"signal": "''+parent[\"site\"]"}, - "style": "guide-label", - "frame": "group", - "offset": 10 - }, - "style": "cell", - "from": { - "facet": { - "name": "trellis_barley_facet", - "data": "source_0", - "groupby": ["site"], - "aggregate": { - "fields": ["yield"], - "ops": ["median"], - "as": ["median_yield_by_site"] - } - } - }, - "sort": { - "field": ["datum[\"median_yield_by_site\"]"], - "order": ["ascending"] - }, - "data": [ - { - "source": "trellis_barley_facet", - "name": "data_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["variety", "year"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - } - ], - "encode": { - "update": { - "width": {"signal": "trellis_barley_child_width"}, - "height": {"signal": "trellis_barley_child_height"} - } - }, - "marks": [ - { - "name": "trellis_barley_child_marks", - "type": "symbol", - "style": ["point"], - "from": {"data": "data_0"}, - "encode": { - "update": { - "fill": {"value": "transparent"}, - "stroke": {"scale": "trellis_barley_color", "field": "year"}, - "x": [ - { - "test": "datum[\"median_yield\"] === null || isNaN(datum[\"median_yield\"])", - "value": 0 - }, - {"scale": "trellis_barley_x", "field": "median_yield"} - ], - "y": {"scale": "trellis_barley_y", "field": "variety"} - } - } - } - ], - "axes": [ - { - "scale": "trellis_barley_x", - "orient": "bottom", - "gridScale": "trellis_barley_y", - "grid": true, - "tickCount": {"signal": "ceil(trellis_barley_child_width/40)"}, - "domain": false, - "labels": false, - "maxExtent": 0, - "minExtent": 0, - "ticks": false, - "zindex": 0 - } - ] - } - ], - "scales": [ - { - "name": "trellis_barley_x", - "type": "linear", - "domain": {"data": "data_2", "field": "median_yield"}, - "range": [0, {"signal": "trellis_barley_child_width"}], - "zero": false, - "nice": true - }, - { - "name": "trellis_barley_y", - "type": "point", - "domain": { - "data": "source_0", - "field": "variety", - "sort": {"op": "median", "field": "yield", "order": "descending"} - }, - "range": {"step": {"signal": "trellis_barley_y_step"}}, - "padding": 0.5 - }, - { - "name": "trellis_barley_color", - "type": "ordinal", - "domain": {"data": "data_2", "field": "year", "sort": true}, - "range": "category" - } - ], - "legends": [ - { - "stroke": "trellis_barley_color", - "gradientLength": { - "signal": "clamp(trellis_barley_child_height, 64, 200)" - }, - "symbolType": "circle", - "title": "year", - "encode": {"symbols": {"update": {"fill": {"value": "transparent"}}}} - } - ] -} diff --git a/examples/compiled/trellis_barley_independent.svg b/examples/compiled/trellis_barley_independent.svg index 4091a8b0ab..e69de29bb2 100644 --- a/examples/compiled/trellis_barley_independent.svg +++ b/examples/compiled/trellis_barley_independent.svg @@ -1 +0,0 @@ -siteGrand Rapids10203040506070Median of yieldTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyDuluth10203040506070Median of yieldTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyUniversity Farm10203040506070Median of yieldTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyMorris10203040506070Median of yieldTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyCrookston10203040506070Median of yieldTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyWaseca10203040506070Median of yieldTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462Svansotavariety19311932year \ No newline at end of file diff --git a/examples/compiled/trellis_barley_independent.vg.json b/examples/compiled/trellis_barley_independent.vg.json index 7c00e113ff..e69de29bb2 100644 --- a/examples/compiled/trellis_barley_independent.vg.json +++ b/examples/compiled/trellis_barley_independent.vg.json @@ -1,180 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega/v5.json", - "description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.", - "autosize": "pad", - "padding": 5, - "data": [ - {"name": "source_0", "url": "data/barley.json", "format": {"type": "json"}}, - { - "name": "data_2", - "source": "source_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["variety", "year", "site"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - } - ], - "signals": [ - {"name": "trellis_barley_child_width", "value": 200}, - {"name": "trellis_barley_y_step", "value": 12}, - { - "name": "trellis_barley_child_height", - "update": "bandspace(domain('trellis_barley_y').length, 1, 0.5) * trellis_barley_y_step" - } - ], - "layout": {"padding": 20, "bounds": "full", "align": "all", "columns": 2}, - "marks": [ - { - "name": "facet-title", - "type": "group", - "role": "column-title", - "title": {"text": "site", "style": "guide-title", "offset": 10} - }, - { - "name": "trellis_barley_cell", - "type": "group", - "title": { - "text": {"signal": "''+parent[\"site\"]"}, - "style": "guide-label", - "frame": "group", - "offset": 10 - }, - "style": "cell", - "from": { - "facet": { - "name": "trellis_barley_facet", - "data": "source_0", - "groupby": ["site"], - "aggregate": { - "fields": ["yield"], - "ops": ["median"], - "as": ["median_yield_by_site"] - } - } - }, - "sort": { - "field": ["datum[\"median_yield_by_site\"]"], - "order": ["ascending"] - }, - "data": [ - { - "source": "trellis_barley_facet", - "name": "data_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["variety", "year"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - } - ], - "encode": { - "update": { - "width": {"signal": "trellis_barley_child_width"}, - "height": {"signal": "trellis_barley_child_height"} - } - }, - "marks": [ - { - "name": "trellis_barley_child_marks", - "type": "symbol", - "style": ["point"], - "from": {"data": "data_0"}, - "encode": { - "update": { - "fill": {"value": "transparent"}, - "stroke": {"scale": "trellis_barley_color", "field": "year"}, - "x": [ - { - "test": "datum[\"median_yield\"] === null || isNaN(datum[\"median_yield\"])", - "value": 0 - }, - {"scale": "trellis_barley_x", "field": "median_yield"} - ], - "y": {"scale": "trellis_barley_y", "field": "variety"} - } - } - } - ], - "axes": [ - { - "scale": "trellis_barley_x", - "orient": "bottom", - "grid": false, - "title": "Median of yield", - "labelFlush": true, - "labelOverlap": true, - "tickCount": {"signal": "ceil(trellis_barley_child_width/40)"}, - "zindex": 1 - }, - { - "scale": "trellis_barley_x", - "orient": "bottom", - "gridScale": "trellis_barley_y", - "grid": true, - "tickCount": {"signal": "ceil(trellis_barley_child_width/40)"}, - "domain": false, - "labels": false, - "maxExtent": 0, - "minExtent": 0, - "ticks": false, - "zindex": 0 - }, - { - "scale": "trellis_barley_y", - "orient": "left", - "grid": false, - "title": "variety", - "labelOverlap": true, - "zindex": 1 - } - ] - } - ], - "scales": [ - { - "name": "trellis_barley_x", - "type": "linear", - "domain": {"data": "data_2", "field": "median_yield"}, - "range": [0, {"signal": "trellis_barley_child_width"}], - "zero": false, - "nice": true - }, - { - "name": "trellis_barley_y", - "type": "point", - "domain": { - "data": "source_0", - "field": "variety", - "sort": {"op": "median", "field": "yield", "order": "descending"} - }, - "range": {"step": {"signal": "trellis_barley_y_step"}}, - "padding": 0.5 - }, - { - "name": "trellis_barley_color", - "type": "ordinal", - "domain": {"data": "data_2", "field": "year", "sort": true}, - "range": "category" - } - ], - "legends": [ - { - "stroke": "trellis_barley_color", - "gradientLength": { - "signal": "clamp(trellis_barley_child_height, 64, 200)" - }, - "symbolType": "circle", - "title": "year", - "encode": {"symbols": {"update": {"fill": {"value": "transparent"}}}} - } - ] -} diff --git a/examples/compiled/trellis_barley_layer_median.svg b/examples/compiled/trellis_barley_layer_median.svg index 11c2e12332..e69de29bb2 100644 --- a/examples/compiled/trellis_barley_layer_median.svg +++ b/examples/compiled/trellis_barley_layer_median.svg @@ -1 +0,0 @@ -siteGrand RapidsTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyDuluthTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyUniversity FarmTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyMorrisTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyCrookstonTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462SvansotavarietyWasecaTrebiWisconsin No. 38No. 457GlabronPeatlandVelvetNo. 475ManchuriaNo. 462Svansotavariety10203040506070Median of yield19311932year \ No newline at end of file diff --git a/examples/compiled/trellis_barley_layer_median.vg.json b/examples/compiled/trellis_barley_layer_median.vg.json index 9159215b47..e69de29bb2 100644 --- a/examples/compiled/trellis_barley_layer_median.vg.json +++ b/examples/compiled/trellis_barley_layer_median.vg.json @@ -1,276 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega/v5.json", - "description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.", - "autosize": "pad", - "padding": 5, - "data": [ - {"name": "source_0", "url": "data/barley.json", "format": {"type": "json"}}, - { - "name": "trellis_barley_row_domain", - "source": "source_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["site"], - "fields": ["yield"], - "ops": ["median"], - "as": ["median_yield"] - } - ] - }, - { - "name": "data_2", - "source": "source_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["variety", "year", "site"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - }, - { - "name": "data_3", - "source": "source_0", - "transform": [ - { - "type": "aggregate", - "groupby": ["site"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - } - ], - "signals": [ - {"name": "trellis_barley_child_width", "value": 200}, - {"name": "trellis_barley_y_step", "value": 12}, - { - "name": "trellis_barley_child_height", - "update": "bandspace(domain('trellis_barley_y').length, 1, 0.5) * trellis_barley_y_step" - } - ], - "layout": { - "padding": 20, - "offset": {"rowTitle": 10}, - "columns": 1, - "bounds": "full", - "align": "all" - }, - "marks": [ - { - "name": "row-title", - "type": "group", - "role": "row-title", - "title": { - "text": "site", - "orient": "left", - "style": "guide-title", - "offset": 10 - } - }, - { - "name": "trellis_barley_row_header", - "type": "group", - "role": "row-header", - "from": {"data": "trellis_barley_row_domain"}, - "sort": {"field": "datum[\"median_yield\"]", "order": "ascending"}, - "title": { - "text": {"signal": "''+parent[\"site\"]"}, - "orient": "left", - "style": "guide-label", - "frame": "group", - "offset": 10 - }, - "encode": { - "update": {"height": {"signal": "trellis_barley_child_height"}} - }, - "axes": [ - { - "scale": "trellis_barley_y", - "orient": "left", - "grid": false, - "title": "variety", - "labelOverlap": true, - "zindex": 1 - } - ] - }, - { - "name": "trellis_barley_column_footer", - "type": "group", - "role": "column-footer", - "encode": {"update": {"width": {"signal": "trellis_barley_child_width"}}}, - "axes": [ - { - "scale": "trellis_barley_x", - "orient": "bottom", - "grid": false, - "title": "Median of yield", - "labelFlush": true, - "labelOverlap": true, - "tickCount": {"signal": "ceil(trellis_barley_child_width/40)"}, - "zindex": 1 - } - ] - }, - { - "name": "trellis_barley_cell", - "type": "group", - "style": "cell", - "from": { - "facet": { - "name": "trellis_barley_facet", - "data": "source_0", - "groupby": ["site"], - "aggregate": { - "fields": ["yield"], - "ops": ["median"], - "as": ["median_yield_by_site"] - } - } - }, - "sort": { - "field": ["datum[\"median_yield_by_site\"]"], - "order": ["ascending"] - }, - "data": [ - { - "name": "data_1", - "source": "trellis_barley_facet", - "transform": [ - { - "type": "aggregate", - "groupby": ["variety", "year"], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - }, - { - "name": "data_2", - "source": "trellis_barley_facet", - "transform": [ - { - "type": "aggregate", - "groupby": [], - "ops": ["median"], - "fields": ["yield"], - "as": ["median_yield"] - } - ] - } - ], - "encode": { - "update": { - "width": {"signal": "trellis_barley_child_width"}, - "height": {"signal": "trellis_barley_child_height"} - } - }, - "marks": [ - { - "name": "trellis_barley_child_layer_0_marks", - "type": "symbol", - "style": ["point"], - "from": {"data": "data_1"}, - "encode": { - "update": { - "fill": {"value": "transparent"}, - "stroke": {"scale": "trellis_barley_color", "field": "year"}, - "x": [ - { - "test": "datum[\"median_yield\"] === null || isNaN(datum[\"median_yield\"])", - "value": 0 - }, - {"scale": "trellis_barley_x", "field": "median_yield"} - ], - "y": {"scale": "trellis_barley_y", "field": "variety"} - } - } - }, - { - "name": "trellis_barley_child_layer_1_marks", - "type": "rule", - "style": ["rule"], - "from": {"data": "data_2"}, - "encode": { - "update": { - "stroke": {"value": "black"}, - "x": [ - { - "test": "datum[\"median_yield\"] === null || isNaN(datum[\"median_yield\"])", - "value": 0 - }, - {"scale": "trellis_barley_x", "field": "median_yield"} - ], - "y": {"field": {"group": "height"}}, - "y2": {"value": 0} - } - } - } - ], - "axes": [ - { - "scale": "trellis_barley_x", - "orient": "bottom", - "gridScale": "trellis_barley_y", - "grid": true, - "tickCount": {"signal": "ceil(trellis_barley_child_width/40)"}, - "domain": false, - "labels": false, - "maxExtent": 0, - "minExtent": 0, - "ticks": false, - "zindex": 0 - } - ] - } - ], - "scales": [ - { - "name": "trellis_barley_x", - "type": "linear", - "domain": { - "fields": [ - {"data": "data_2", "field": "median_yield"}, - {"data": "data_3", "field": "median_yield"} - ] - }, - "range": [0, {"signal": "trellis_barley_child_width"}], - "zero": false, - "nice": true - }, - { - "name": "trellis_barley_y", - "type": "point", - "domain": { - "data": "source_0", - "field": "variety", - "sort": {"op": "median", "field": "yield", "order": "descending"} - }, - "range": {"step": {"signal": "trellis_barley_y_step"}}, - "padding": 0.5 - }, - { - "name": "trellis_barley_color", - "type": "ordinal", - "domain": {"data": "data_2", "field": "year", "sort": true}, - "range": "category" - } - ], - "legends": [ - { - "stroke": "trellis_barley_color", - "gradientLength": { - "signal": "clamp(trellis_barley_child_height, 64, 200)" - }, - "symbolType": "circle", - "title": "year", - "encode": {"symbols": {"update": {"fill": {"value": "transparent"}}}} - } - ] -} diff --git a/examples/specs/bar_aggregate_sort_by_encoding.vl.json b/examples/specs/bar_aggregate_sort_by_encoding.vl.json index acfe6457a9..f03630dae9 100644 --- a/examples/specs/bar_aggregate_sort_by_encoding.vl.json +++ b/examples/specs/bar_aggregate_sort_by_encoding.vl.json @@ -9,7 +9,7 @@ "y": { "field": "age", "type": "ordinal", - "sort": {"encoding": "x"} + "sort": "-x" }, "x": { "aggregate": "sum", diff --git a/examples/specs/bar_count_minimap.vl.json b/examples/specs/bar_count_minimap.vl.json index db21c79852..10b9b09bb5 100644 --- a/examples/specs/bar_count_minimap.vl.json +++ b/examples/specs/bar_count_minimap.vl.json @@ -9,7 +9,7 @@ "type": "nominal", "scale": {"domain": {"selection": "brush"}}, "axis": {"minExtent": 200, "title": null}, - "sort": {"encoding": "x", "order": "descending"} + "sort": "-x" }, "x": { "aggregate": "count", @@ -32,7 +32,7 @@ "y": { "field": "Name", "type": "nominal", - "sort": {"encoding": "x", "order": "descending"}, + "sort": "-x", "axis": null }, "x": { diff --git a/examples/specs/interactive_dashboard_europe_pop.vl.json b/examples/specs/interactive_dashboard_europe_pop.vl.json index cc2af47ae6..95567433ca 100644 --- a/examples/specs/interactive_dashboard_europe_pop.vl.json +++ b/examples/specs/interactive_dashboard_europe_pop.vl.json @@ -315,10 +315,7 @@ "y": { "field": "Country", "type": "ordinal", - "sort": { - "encoding": "x", - "order": "descending" - } + "sort": "-x" }, "x": { "field": "Population_ages_15_64_of_total", @@ -340,10 +337,7 @@ "y": { "field": "Country", "type": "ordinal", - "sort": { - "encoding": "x", - "order": "descending" - } + "sort": "-x" }, "x": { "field": "Population_ages_65_and_above_of_total", diff --git a/examples/specs/normalized/airport_connections_normalized.vl.json b/examples/specs/normalized/airport_connections_normalized.vl.json index 84e0c1ed48..e69de29bb2 100644 --- a/examples/specs/normalized/airport_connections_normalized.vl.json +++ b/examples/specs/normalized/airport_connections_normalized.vl.json @@ -1,94 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "An interactive visualization of connections among major U.S. airports in 2008. Based on a U.S. airports example by Mike Bostock.", - "layer": [ - { - "mark": { - "type": "geoshape", - "fill": "#ddd", - "stroke": "#fff", - "strokeWidth": 1 - }, - "data": { - "url": "data/us-10m.json", - "format": {"type": "topojson", "feature": "states"} - }, - "projection": {"type": "albersUsa"} - }, - { - "mark": {"type": "rule", "color": "#000", "opacity": 0.35}, - "data": {"url": "data/flights-airport.csv"}, - "transform": [ - {"filter": {"selection": "single"}}, - { - "lookup": "origin", - "from": { - "data": {"url": "data/airports.csv"}, - "key": "iata", - "fields": ["latitude", "longitude"] - } - }, - { - "lookup": "destination", - "from": { - "data": {"url": "data/airports.csv"}, - "key": "iata", - "fields": ["latitude", "longitude"] - }, - "as": ["lat2", "lon2"] - } - ], - "encoding": { - "latitude": {"field": "latitude", "type": "quantitative"}, - "longitude": {"field": "longitude", "type": "quantitative"}, - "latitude2": {"field": "lat2"}, - "longitude2": {"field": "lon2"} - }, - "projection": {"type": "albersUsa"} - }, - { - "mark": {"type": "circle"}, - "data": {"url": "data/flights-airport.csv"}, - "transform": [ - {"aggregate": [{"op": "count", "as": "routes"}], "groupby": ["origin"]}, - { - "lookup": "origin", - "from": { - "data": {"url": "data/airports.csv"}, - "key": "iata", - "fields": ["state", "latitude", "longitude"] - } - }, - {"filter": "datum.state !== 'PR' && datum.state !== 'VI'"} - ], - "selection": { - "single": { - "type": "single", - "on": "mouseover", - "nearest": true, - "fields": ["origin"], - "empty": "none" - } - }, - "encoding": { - "latitude": {"field": "latitude", "type": "quantitative"}, - "longitude": {"field": "longitude", "type": "quantitative"}, - "size": { - "field": "routes", - "type": "quantitative", - "scale": {"range": [0, 1000]}, - "legend": null - }, - "order": { - "field": "routes", - "type": "quantitative", - "sort": "descending" - } - }, - "projection": {"type": "albersUsa"} - } - ], - "width": 900, - "height": 500, - "config": {"view": {"stroke": null}} -} \ No newline at end of file diff --git a/examples/specs/normalized/area_density_normalized.vl.json b/examples/specs/normalized/area_density_normalized.vl.json index a71ce21ea1..e69de29bb2 100644 --- a/examples/specs/normalized/area_density_normalized.vl.json +++ b/examples/specs/normalized/area_density_normalized.vl.json @@ -1,21 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/iris.json"}, - "transform": [ - { - "fold": ["petalWidth", "petalLength", "sepalWidth", "sepalLength"], - "as": ["organ", "value"] - }, - {"density": "value", "bandwidth": 0.3, "groupby": ["organ"]} - ], - "facet": {"row": {"field": "organ", "type": "nominal"}}, - "spec": { - "mark": "area", - "width": 300, - "height": 50, - "encoding": { - "x": {"field": "value", "type": "quantitative"}, - "y": {"field": "density", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/area_overlay_normalized.vl.json b/examples/specs/normalized/area_overlay_normalized.vl.json index a58e2d1431..e69de29bb2 100644 --- a/examples/specs/normalized/area_overlay_normalized.vl.json +++ b/examples/specs/normalized/area_overlay_normalized.vl.json @@ -1,29 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Google's stock price over time.", - "data": {"url": "data/stocks.csv"}, - "transform": [{"filter": "datum.symbol==='GOOG'"}], - "layer": [ - { - "mark": {"type": "area", "opacity": 0.7}, - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"} - } - }, - { - "mark": {"type": "line"}, - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/bar_column_fold_normalized.vl.json b/examples/specs/normalized/bar_column_fold_normalized.vl.json index 52b08a9f91..e69de29bb2 100644 --- a/examples/specs/normalized/bar_column_fold_normalized.vl.json +++ b/examples/specs/normalized/bar_column_fold_normalized.vl.json @@ -1,19 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - {"country": "USA", "gold": 10, "silver": 20}, - {"country": "Canada", "gold": 7, "silver": 26} - ] - }, - "transform": [{"fold": ["gold", "silver"]}], - "facet": {"column": {"field": "key", "type": "nominal"}}, - "spec": { - "mark": "bar", - "encoding": { - "x": {"field": "country", "type": "nominal"}, - "y": {"field": "value", "type": "quantitative"}, - "color": {"field": "country", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/bar_grouped_horizontal_normalized.vl.json b/examples/specs/normalized/bar_grouped_horizontal_normalized.vl.json index 5b046b325c..e69de29bb2 100644 --- a/examples/specs/normalized/bar_grouped_horizontal_normalized.vl.json +++ b/examples/specs/normalized/bar_grouped_horizontal_normalized.vl.json @@ -1,29 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/population.json"}, - "transform": [ - {"filter": "datum.year == 2000"}, - {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} - ], - "spacing": 10, - "config": {"view": {"stroke": "transparent"}, "axis": {"domainWidth": 1}}, - "facet": {"row": {"field": "age", "type": "ordinal"}}, - "spec": { - "mark": "bar", - "height": {"step": 6}, - "encoding": { - "x": { - "aggregate": "sum", - "field": "people", - "type": "quantitative", - "axis": {"title": "population", "grid": false} - }, - "y": {"field": "gender", "type": "nominal", "axis": null}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - } - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/bar_grouped_normalized.vl.json b/examples/specs/normalized/bar_grouped_normalized.vl.json index 9cde204404..e69de29bb2 100644 --- a/examples/specs/normalized/bar_grouped_normalized.vl.json +++ b/examples/specs/normalized/bar_grouped_normalized.vl.json @@ -1,29 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/population.json"}, - "transform": [ - {"filter": "datum.year == 2000"}, - {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} - ], - "spacing": 10, - "config": {"view": {"stroke": "transparent"}, "axis": {"domainWidth": 1}}, - "facet": {"column": {"field": "age", "type": "ordinal"}}, - "spec": { - "mark": "bar", - "width": {"step": 12}, - "encoding": { - "y": { - "aggregate": "sum", - "field": "people", - "type": "quantitative", - "axis": {"title": "population", "grid": false} - }, - "x": {"field": "gender", "type": "nominal", "axis": {"title": ""}}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - } - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/bar_layered_weather_normalized.vl.json b/examples/specs/normalized/bar_layered_weather_normalized.vl.json index f07789f5e4..e69de29bb2 100644 --- a/examples/specs/normalized/bar_layered_weather_normalized.vl.json +++ b/examples/specs/normalized/bar_layered_weather_normalized.vl.json @@ -1,167 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A layered bar chart with floating bars representing weekly weather data", - "title": { - "text": "Weekly Weather Observations and Predictions", - "frame": "bounds" - }, - "data": {"url": "data/weather.json"}, - "width": 250, - "height": 200, - "layer": [ - { - "mark": {"type": "bar", "style": "box"}, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "y": { - "field": "record.low", - "type": "quantitative", - "scale": {"domain": [10, 70]}, - "axis": {"title": "Temperature (F)"} - }, - "y2": {"field": "record.high"}, - "size": {"value": 20}, - "color": {"value": "#ccc"} - } - }, - { - "mark": {"type": "bar", "style": "box"}, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "y": {"field": "normal.low", "type": "quantitative"}, - "y2": {"field": "normal.high"}, - "size": {"value": 20}, - "color": {"value": "#999"} - } - }, - { - "mark": {"type": "bar", "style": "box"}, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "y": {"field": "actual.low", "type": "quantitative"}, - "y2": {"field": "actual.high"}, - "size": {"value": 12}, - "color": {"value": "#000"} - } - }, - { - "mark": {"type": "bar", "style": "box"}, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "y": {"field": "forecast.low.low", "type": "quantitative"}, - "y2": {"field": "forecast.low.high"}, - "size": {"value": 12}, - "color": {"value": "#000"} - } - }, - { - "mark": {"type": "bar", "style": "box"}, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "y": {"field": "forecast.low.high", "type": "quantitative"}, - "y2": {"field": "forecast.high.low"}, - "size": {"value": 3}, - "color": {"value": "#000"} - } - }, - { - "mark": {"type": "bar", "style": "box"}, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "y": {"field": "forecast.high.low", "type": "quantitative"}, - "y2": {"field": "forecast.high.high"}, - "size": {"value": 12}, - "color": {"value": "#000"} - } - }, - { - "mark": { - "type": "text", - "align": "center", - "baseline": "bottom", - "y": -5 - }, - "encoding": { - "x": { - "field": "id", - "type": "ordinal", - "axis": { - "domain": false, - "ticks": false, - "labels": false, - "title": "Day", - "titlePadding": 25, - "orient": "top" - } - }, - "text": {"field": "day", "type": "nominal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json b/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json index f68dd2bfea..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json +++ b/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json @@ -1,254 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A vertical 2D box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": {"x": {"field": "people", "type": "quantitative"}} - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - }, - { - "mark": { - "type": "tick", - "color": "black", - "opacity": 1, - "orient": "vertical", - "style": "boxplot-ticks" - }, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - }, - { - "mark": { - "type": "tick", - "color": "black", - "opacity": 1, - "orient": "vertical", - "style": "boxplot-ticks" - }, - "encoding": { - "x": { - "field": "upper_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - }, - { - "mark": { - "color": "red", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json b/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json index 91efed5689..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json +++ b/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json @@ -1,198 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A 1D horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": {"x": {"field": "people", "type": "quantitative"}} - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json b/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json index 91efed5689..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json +++ b/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json @@ -1,198 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A 1D horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": {"x": {"field": "people", "type": "quantitative"}} - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json b/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json index 40857c1883..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json +++ b/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json @@ -1,198 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A vertical 1D box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": {"y": {"field": "people", "type": "quantitative"}} - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "lower_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "upper_whisker_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - } - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": [] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "y": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "upper_box_people", "type": "quantitative"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "horizontal", - "style": "boxplot-median" - }, - "encoding": { - "y": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json b/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json index 66fc3bd6a4..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json +++ b/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json @@ -1,212 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": { - "x": {"field": "people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"} - } - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "size": {"value": 5}, - "color": {"value": "teal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y": {"field": "age", "type": "ordinal"}, - "size": {"value": 5}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json b/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json index 9149938951..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json +++ b/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json @@ -1,209 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": { - "x": {"field": "people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"} - } - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json b/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json index adb559e855..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json +++ b/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json @@ -1,211 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A vertical 2D box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": { - "y": {"field": "people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"} - } - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "lower_box_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "upper_whisker_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "y": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "upper_box_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "size": {"value": 5}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "horizontal", - "style": "boxplot-median" - }, - "encoding": { - "y": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x": {"field": "age", "type": "ordinal"}, - "size": {"value": 5}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json b/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json index 8037379981..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json +++ b/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json @@ -1,185 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "config": {"boxplot": {"median": {"color": "orange"}}}, - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "orange", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json b/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json index 34b7da2a32..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json +++ b/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json @@ -1,184 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json b/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json index 61f2c4e1b1..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json +++ b/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json @@ -1,184 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A vertical 2D box plot showing median, min, and max in the US population distribution of age groups in 2000.", - "data": {"url": "data/population.json"}, - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "lower_box_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "upper_whisker_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "y": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y2": {"field": "upper_box_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "horizontal", - "style": "boxplot-median" - }, - "encoding": { - "y": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json b/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json index 6e047a4a0c..8edd1ca2a1 100644 --- a/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json +++ b/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json @@ -145,4 +145,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json b/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json index b2171fe904..e69de29bb2 100644 --- a/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json +++ b/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json @@ -1,209 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/population.json"}, - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "transform": [ - { - "filter": "(datum[\"people\"] < datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"])) || (datum[\"people\"] > datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - } - ], - "mark": {"type": "point", "style": "boxplot-outliers"}, - "encoding": { - "y": {"field": "people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": {"field": "year", "type": "quantitative"} - } - }, - { - "transform": [ - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "people" - }, - "y2": {"field": "lower_box_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "y": { - "field": "upper_box_people", - "type": "quantitative", - "title": "people" - }, - "y2": {"field": "upper_whisker_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "y": { - "field": "lower_box_people", - "type": "quantitative", - "title": "people" - }, - "y2": {"field": "upper_box_people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "horizontal", - "style": "boxplot-median" - }, - "encoding": { - "y": { - "field": "mid_box_people", - "type": "quantitative", - "title": "people" - }, - "x": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/concat_hover_filter_normalized.vl.json b/examples/specs/normalized/concat_hover_filter_normalized.vl.json index 82d61f02ef..e69de29bb2 100644 --- a/examples/specs/normalized/concat_hover_filter_normalized.vl.json +++ b/examples/specs/normalized/concat_hover_filter_normalized.vl.json @@ -1,51 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Drag out a rectangular brush to highlight points.", - "data": {"url": "data/cars.json"}, - "hconcat": [ - { - "layer": [ - { - "selection": { - "hover": {"type": "single", "on": "mouseover", "empty": "none"} - }, - "mark": "point", - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Miles_per_Gallon", "type": "quantitative"} - } - }, - { - "mark": {"type": "point", "color": "goldenrod"}, - "transform": [{"filter": {"selection": "hover"}}], - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Miles_per_Gallon", "type": "quantitative"} - } - } - ] - }, - { - "layer": [ - { - "selection": { - "hover": {"type": "single", "on": "mouseover", "empty": "none"} - }, - "mark": "point", - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Acceleration", "type": "quantitative"} - } - }, - { - "mark": {"type": "point", "color": "goldenrod"}, - "transform": [{"filter": {"selection": "hover"}}], - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Acceleration", "type": "quantitative"} - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/concat_layer_voyager_result_future_normalized.vl.json b/examples/specs/normalized/concat_layer_voyager_result_future_normalized.vl.json index a2992480cb..e69de29bb2 100644 --- a/examples/specs/normalized/concat_layer_voyager_result_future_normalized.vl.json +++ b/examples/specs/normalized/concat_layer_voyager_result_future_normalized.vl.json @@ -1,180 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - { - "measure": "Open Exploration", - "mean": 1.813, - "lo": 1.255, - "hi": 2.37, - "study": "PoleStar vs Voyager" - }, - { - "measure": "Focused Question Answering", - "mean": -1.688, - "lo": -2.325, - "hi": -1.05, - "study": "PoleStar vs Voyager" - }, - { - "measure": "Open Exploration", - "mean": 2.1875, - "lo": 1.665, - "hi": 2.71, - "study": "PoleStar vs Voyager 2" - }, - { - "measure": "Focused Question Answering", - "mean": -0.0625, - "lo": -0.474, - "hi": 0.349, - "study": "PoleStar vs Voyager 2" - } - ] - }, - "spacing": 10, - "vconcat": [ - { - "title": {"text": "Mean of Subject Ratings (95% CIs)", "frame": "bounds"}, - "layer": [ - { - "mark": "rule", - "encoding": { - "y": { - "field": "study", - "type": "nominal", - "axis": { - "title": null, - "labelPadding": 5, - "domain": false, - "ticks": false, - "grid": false - } - }, - "x": { - "field": "lo", - "type": "quantitative", - "scale": {"domain": [-3, 3]}, - "axis": { - "title": "", - "encoding": { - "grid": { - "strokeDash": {"value": [3, 3]}, - "stroke": { - "condition": { - "test": "datum.value === 0", - "value": "#666" - }, - "value": "#CCC" - } - } - } - } - }, - "x2": {"field": "hi"} - } - }, - { - "mark": {"type": "circle", "stroke": "black", "opacity": 1}, - "encoding": { - "y": { - "field": "study", - "type": "nominal", - "axis": { - "title": null, - "labelPadding": 5, - "domain": false, - "ticks": false, - "grid": false - } - }, - "x": {"field": "mean", "type": "quantitative"}, - "color": { - "field": "measure", - "type": "nominal", - "scale": {"range": ["black", "white"]}, - "legend": null - } - } - } - ] - }, - { - "data": { - "values": [ - {"from": -0.25, "to": -2.9, "label": "PoleStar"}, - {"from": 0.25, "to": 2.9, "label": "Voyager / Voyager 2"} - ] - }, - "layer": [ - { - "mark": "rule", - "encoding": { - "x": { - "field": "from", - "type": "quantitative", - "scale": {"zero": false}, - "axis": null - }, - "x2": {"field": "to"} - } - }, - { - "mark": { - "type": "point", - "filled": true, - "size": 60, - "fill": "black" - }, - "encoding": { - "x": {"field": "to", "type": "quantitative", "axis": null}, - "shape": { - "condition": {"test": "datum.to > 0", "value": "triangle-right"}, - "value": "triangle-left" - } - } - }, - { - "mark": {"type": "text", "align": "right", "style": "arrow-label"}, - "transform": [{"filter": "datum.label === 'PoleStar'"}], - "encoding": { - "x": {"field": "from", "type": "quantitative", "axis": null}, - "text": {"field": "label", "type": "nominal"} - } - }, - { - "mark": {"type": "text", "align": "left", "style": "arrow-label"}, - "transform": [{"filter": "datum.label !== 'PoleStar'"}], - "encoding": { - "x": {"field": "from", "type": "quantitative", "axis": null}, - "text": {"field": "label", "type": "nominal"} - } - }, - { - "mark": {"type": "text", "align": "right", "style": "arrow-label2"}, - "transform": [{"filter": "datum.label === 'PoleStar'"}], - "encoding": { - "x": {"field": "from", "type": "quantitative", "axis": null}, - "text": {"value": "more valuable"} - } - }, - { - "mark": {"type": "text", "align": "left", "style": "arrow-label2"}, - "transform": [{"filter": "datum.label !== 'PoleStar'"}], - "encoding": { - "x": {"field": "from", "type": "quantitative", "axis": null}, - "text": {"value": "more valuable"} - } - } - ] - } - ], - "config": { - "view": {"stroke": "transparent"}, - "style": { - "arrow-label": {"dy": 12, "fontSize": 9.5}, - "arrow-label2": {"dy": 24, "fontSize": 9.5} - }, - "title": {"fontSize": 12} - } -} \ No newline at end of file diff --git a/examples/specs/normalized/connected_scatterplot_normalized.vl.json b/examples/specs/normalized/connected_scatterplot_normalized.vl.json index a3691202f5..e69de29bb2 100644 --- a/examples/specs/normalized/connected_scatterplot_normalized.vl.json +++ b/examples/specs/normalized/connected_scatterplot_normalized.vl.json @@ -1,30 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/driving.json"}, - "layer": [ - { - "mark": "line", - "encoding": { - "x": { - "field": "miles", - "type": "quantitative", - "scale": {"zero": false} - }, - "y": {"field": "gas", "type": "quantitative", "scale": {"zero": false}}, - "order": {"field": "year", "type": "temporal"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": { - "field": "miles", - "type": "quantitative", - "scale": {"zero": false} - }, - "y": {"field": "gas", "type": "quantitative", "scale": {"zero": false}}, - "order": {"field": "year", "type": "temporal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/errorband_2d_horizontal_color_encoding_normalized.vl.json b/examples/specs/normalized/errorband_2d_horizontal_color_encoding_normalized.vl.json index 11893307e7..e69de29bb2 100644 --- a/examples/specs/normalized/errorband_2d_horizontal_color_encoding_normalized.vl.json +++ b/examples/specs/normalized/errorband_2d_horizontal_color_encoding_normalized.vl.json @@ -1,157 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "layer": [ - { - "transform": [ - {"timeUnit": "year", "field": "Year", "as": "year_Year"}, - { - "aggregate": [ - { - "op": "ci0", - "field": "Miles_per_Gallon", - "as": "lower_Miles_per_Gallon" - }, - { - "op": "ci1", - "field": "Miles_per_Gallon", - "as": "upper_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": ["year_Year"] - } - ], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "area", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "color": {"value": "black"}, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": {"type": "line", "style": "errorband-borders"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "color": {"value": "black"}, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": {"type": "line", "style": "errorband-borders"}, - "encoding": { - "y": { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "color": {"value": "black"}, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/errorband_2d_vertical_borders_normalized.vl.json b/examples/specs/normalized/errorband_2d_vertical_borders_normalized.vl.json index c5d1c17670..e69de29bb2 100644 --- a/examples/specs/normalized/errorband_2d_vertical_borders_normalized.vl.json +++ b/examples/specs/normalized/errorband_2d_vertical_borders_normalized.vl.json @@ -1,150 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "transform": [ - {"timeUnit": "year", "field": "Year", "as": "year_Year"}, - { - "aggregate": [ - { - "op": "ci0", - "field": "Miles_per_Gallon", - "as": "lower_Miles_per_Gallon" - }, - { - "op": "ci1", - "field": "Miles_per_Gallon", - "as": "upper_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": ["year_Year"] - } - ], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "area", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": {"type": "line", "style": "errorband-borders"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": {"type": "line", "style": "errorband-borders"}, - "encoding": { - "y": { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/errorbar_2d_vertical_ticks_normalized.vl.json b/examples/specs/normalized/errorbar_2d_vertical_ticks_normalized.vl.json index dd534e39f8..e69de29bb2 100644 --- a/examples/specs/normalized/errorbar_2d_vertical_ticks_normalized.vl.json +++ b/examples/specs/normalized/errorbar_2d_vertical_ticks_normalized.vl.json @@ -1,158 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "transform": [ - {"timeUnit": "year", "field": "Year", "as": "year_Year"}, - { - "aggregate": [ - { - "op": "ci0", - "field": "Miles_per_Gallon", - "as": "lower_Miles_per_Gallon" - }, - { - "op": "ci1", - "field": "Miles_per_Gallon", - "as": "upper_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": ["year_Year"] - } - ], - "layer": [ - { - "mark": { - "type": "tick", - "orient": "horizontal", - "style": "errorbar-ticks" - }, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": { - "type": "tick", - "orient": "horizontal", - "style": "errorbar-ticks" - }, - "encoding": { - "y": { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/facet_custom_header_normalized.vl.json b/examples/specs/normalized/facet_custom_header_normalized.vl.json index bb485302da..e69de29bb2 100644 --- a/examples/specs/normalized/facet_custom_header_normalized.vl.json +++ b/examples/specs/normalized/facet_custom_header_normalized.vl.json @@ -1,34 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A trellis bar chart showing the US population distribution of age groups and gender in 2000.", - "data": {"url": "data/population.json"}, - "transform": [ - {"filter": "datum.year == 2000"}, - {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} - ], - "facet": { - "column": { - "field": "gender", - "type": "nominal", - "header": {"titleFontSize": 20, "labelFontSize": 15} - } - }, - "spec": { - "mark": "bar", - "width": {"step": 17}, - "encoding": { - "y": { - "aggregate": "sum", - "field": "people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x": {"field": "age", "type": "ordinal"}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - } - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/facet_custom_normalized.vl.json b/examples/specs/normalized/facet_custom_normalized.vl.json index bb485302da..e69de29bb2 100644 --- a/examples/specs/normalized/facet_custom_normalized.vl.json +++ b/examples/specs/normalized/facet_custom_normalized.vl.json @@ -1,34 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A trellis bar chart showing the US population distribution of age groups and gender in 2000.", - "data": {"url": "data/population.json"}, - "transform": [ - {"filter": "datum.year == 2000"}, - {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} - ], - "facet": { - "column": { - "field": "gender", - "type": "nominal", - "header": {"titleFontSize": 20, "labelFontSize": 15} - } - }, - "spec": { - "mark": "bar", - "width": {"step": 17}, - "encoding": { - "y": { - "aggregate": "sum", - "field": "people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x": {"field": "age", "type": "ordinal"}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - } - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/geo_constant_value_normalized.vl.json b/examples/specs/normalized/geo_constant_value_normalized.vl.json index 3b5a777d3d..e69de29bb2 100644 --- a/examples/specs/normalized/geo_constant_value_normalized.vl.json +++ b/examples/specs/normalized/geo_constant_value_normalized.vl.json @@ -1,38 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 500, - "height": 300, - "data": {"url": "data/airports.csv"}, - "layer": [ - { - "mark": "square", - "encoding": { - "longitude": {"field": "longitude", "type": "quantitative"}, - "latitude": {"field": "latitude", "type": "quantitative"}, - "size": {"value": 1}, - "color": {"value": "gray"} - }, - "projection": {"type": "albersUsa"} - }, - { - "mark": "square", - "encoding": { - "longitude": {"value": -122.335167, "type": "quantitative"}, - "latitude": {"field": "latitude", "type": "quantitative"}, - "size": {"value": 1}, - "color": {"value": "steelblue"} - }, - "projection": {"type": "albersUsa"} - }, - { - "mark": "square", - "encoding": { - "longitude": {"field": "longitude", "type": "quantitative"}, - "latitude": {"value": 47.608013, "type": "quantitative"}, - "size": {"value": 1}, - "color": {"value": "firebrick"} - }, - "projection": {"type": "albersUsa"} - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/geo_custom_projection_normalized.vl.json b/examples/specs/normalized/geo_custom_projection_normalized.vl.json index 677c56a005..e69de29bb2 100644 --- a/examples/specs/normalized/geo_custom_projection_normalized.vl.json +++ b/examples/specs/normalized/geo_custom_projection_normalized.vl.json @@ -1,34 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 900, - "height": 560, - "layer": [ - { - "data": { - "url": "data/us-10m.json", - "format": {"type": "topojson", "feature": "states"} - }, - "mark": {"type": "geoshape", "fill": "#ccc", "stroke": "#fff"}, - "projection": { - "type": "albersUsa", - "scale": 3000, - "translate": [1200, 700] - } - }, - { - "data": {"url": "data/airports.csv"}, - "mark": "circle", - "encoding": { - "longitude": {"field": "longitude", "type": "quantitative"}, - "latitude": {"field": "latitude", "type": "quantitative"}, - "size": {"value": 10} - }, - "projection": { - "type": "albersUsa", - "scale": 3000, - "translate": [1200, 700] - } - } - ], - "config": {"view": {"stroke": null}} -} \ No newline at end of file diff --git a/examples/specs/normalized/geo_sphere_normalized.vl.json b/examples/specs/normalized/geo_sphere_normalized.vl.json index 130ec74b0d..e69de29bb2 100644 --- a/examples/specs/normalized/geo_sphere_normalized.vl.json +++ b/examples/specs/normalized/geo_sphere_normalized.vl.json @@ -1,25 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 200, - "height": 200, - "layer": [ - { - "data": {"sphere": true}, - "mark": {"type": "geoshape", "fill": "aliceblue"}, - "projection": { - "type": "orthographic", - "scale": 100, - "translate": [100, 100] - } - }, - { - "data": {"graticule": true}, - "mark": {"type": "geoshape", "stroke": "black", "strokeWidth": 0.5}, - "projection": { - "type": "orthographic", - "scale": 100, - "translate": [100, 100] - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/geo_text_normalized.vl.json b/examples/specs/normalized/geo_text_normalized.vl.json index 02311697ec..e69de29bb2 100644 --- a/examples/specs/normalized/geo_text_normalized.vl.json +++ b/examples/specs/normalized/geo_text_normalized.vl.json @@ -1,37 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 800, - "height": 500, - "layer": [ - { - "data": { - "url": "data/us-10m.json", - "format": {"type": "topojson", "feature": "states"} - }, - "mark": {"type": "geoshape", "fill": "lightgray", "stroke": "white"}, - "projection": {"type": "albersUsa"} - }, - { - "data": {"url": "data/us-state-capitals.json"}, - "layer": [ - { - "mark": {"type": "circle", "color": "orange"}, - "projection": {"type": "albersUsa"}, - "encoding": { - "longitude": {"field": "lon", "type": "quantitative"}, - "latitude": {"field": "lat", "type": "quantitative"} - } - }, - { - "mark": {"type": "text", "dy": -10}, - "encoding": { - "longitude": {"field": "lon", "type": "quantitative"}, - "latitude": {"field": "lat", "type": "quantitative"}, - "text": {"field": "city", "type": "nominal"} - }, - "projection": {"type": "albersUsa"} - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/geo_trellis_normalized.vl.json b/examples/specs/normalized/geo_trellis_normalized.vl.json index 8a08a9a35e..e69de29bb2 100644 --- a/examples/specs/normalized/geo_trellis_normalized.vl.json +++ b/examples/specs/normalized/geo_trellis_normalized.vl.json @@ -1,28 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/income.json"}, - "transform": [ - { - "lookup": "id", - "from": { - "data": { - "url": "data/us-10m.json", - "format": {"type": "topojson", "feature": "states"} - }, - "key": "id" - }, - "as": "geo" - } - ], - "facet": {"row": {"field": "group", "type": "nominal"}}, - "spec": { - "projection": {"type": "albersUsa"}, - "mark": "geoshape", - "width": 500, - "height": 300, - "encoding": { - "shape": {"field": "geo", "type": "geojson"}, - "color": {"field": "pct", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/interactive_area_brush_normalized.vl.json b/examples/specs/normalized/interactive_area_brush_normalized.vl.json index b09af5c06b..e69de29bb2 100644 --- a/examples/specs/normalized/interactive_area_brush_normalized.vl.json +++ b/examples/specs/normalized/interactive_area_brush_normalized.vl.json @@ -1,22 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/unemployment-across-industries.json"}, - "layer": [ - { - "selection": {"brush": {"type": "interval", "encodings": ["x"]}}, - "mark": "area", - "encoding": { - "x": {"timeUnit": "yearmonth", "field": "date", "type": "temporal"}, - "y": {"aggregate": "sum", "field": "count", "type": "quantitative"} - } - }, - { - "transform": [{"filter": {"selection": "brush"}}], - "mark": {"type": "area", "color": "goldenrod"}, - "encoding": { - "x": {"timeUnit": "yearmonth", "field": "date", "type": "temporal"}, - "y": {"aggregate": "sum", "field": "count", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/interactive_multi_line_tooltip_normalized.vl.json b/examples/specs/normalized/interactive_multi_line_tooltip_normalized.vl.json index f1fd09aba5..e69de29bb2 100644 --- a/examples/specs/normalized/interactive_multi_line_tooltip_normalized.vl.json +++ b/examples/specs/normalized/interactive_multi_line_tooltip_normalized.vl.json @@ -1,48 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/seattle-weather.csv", "format": {"type": "csv"}}, - "layer": [ - { - "mark": {"type": "line", "color": "orange"}, - "encoding": { - "x": {"timeUnit": "yearmonthdate", "field": "date", "type": "temporal"}, - "tooltip": [ - {"timeUnit": "yearmonthdate", "field": "date", "type": "temporal"}, - {"field": "temp_max", "type": "quantitative"}, - {"field": "temp_min", "type": "quantitative"} - ], - "y": {"field": "temp_max", "type": "quantitative"} - } - }, - { - "mark": {"type": "line", "color": "red"}, - "encoding": { - "x": {"timeUnit": "yearmonthdate", "field": "date", "type": "temporal"}, - "tooltip": [ - {"timeUnit": "yearmonthdate", "field": "date", "type": "temporal"}, - {"field": "temp_max", "type": "quantitative"}, - {"field": "temp_min", "type": "quantitative"} - ], - "y": {"field": "temp_min", "type": "quantitative"} - } - }, - { - "mark": "rule", - "selection": { - "hover": {"type": "single", "on": "mouseover", "empty": "none"} - }, - "encoding": { - "x": {"timeUnit": "yearmonthdate", "field": "date", "type": "temporal"}, - "tooltip": [ - {"timeUnit": "yearmonthdate", "field": "date", "type": "temporal"}, - {"field": "temp_max", "type": "quantitative"}, - {"field": "temp_min", "type": "quantitative"} - ], - "color": { - "condition": {"selection": {"not": "hover"}, "value": "transparent"} - } - } - } - ], - "config": {"axisY": {"minExtent": 30}} -} \ No newline at end of file diff --git a/examples/specs/normalized/interactive_stocks_nearest_index_normalized.vl.json b/examples/specs/normalized/interactive_stocks_nearest_index_normalized.vl.json index 415d05372b..e69de29bb2 100644 --- a/examples/specs/normalized/interactive_stocks_nearest_index_normalized.vl.json +++ b/examples/specs/normalized/interactive_stocks_nearest_index_normalized.vl.json @@ -1,51 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 600, - "height": 300, - "data": {"url": "data/stocks.csv"}, - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"}, - "color": {"field": "symbol", "type": "nominal"} - } - }, - { - "selection": { - "index": { - "type": "single", - "on": "mousemove", - "encodings": ["x"], - "nearest": true - } - }, - "mark": {"type": "point"}, - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"}, - "opacity": {"value": 0} - } - }, - { - "transform": [ - {"filter": {"and": ["index.date", {"selection": "index"}]}} - ], - "mark": "rule", - "encoding": {"x": {"field": "date", "type": "temporal"}} - }, - { - "transform": [ - {"filter": {"and": ["index.date", {"selection": "index"}]}} - ], - "mark": "text", - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"value": 10}, - "text": {"field": "date", "type": "temporal"} - } - } - ], - "config": {"text": {"align": "right", "dx": -5, "dy": 5}} -} \ No newline at end of file diff --git a/examples/specs/normalized/isotype_bar_chart_emoji_normalized.vl.json b/examples/specs/normalized/isotype_bar_chart_emoji_normalized.vl.json index a1b71c9eb2..e69de29bb2 100644 --- a/examples/specs/normalized/isotype_bar_chart_emoji_normalized.vl.json +++ b/examples/specs/normalized/isotype_bar_chart_emoji_normalized.vl.json @@ -1,66 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "config": {"view": {"stroke": ""}}, - "data": { - "values": [ - {"country": "Great Britain", "animal": "pigs"}, - {"country": "Great Britain", "animal": "pigs"}, - {"country": "Great Britain", "animal": "cattle"}, - {"country": "Great Britain", "animal": "cattle"}, - {"country": "Great Britain", "animal": "cattle"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "Great Britain", "animal": "sheep"}, - {"country": "United States", "animal": "pigs"}, - {"country": "United States", "animal": "pigs"}, - {"country": "United States", "animal": "pigs"}, - {"country": "United States", "animal": "pigs"}, - {"country": "United States", "animal": "pigs"}, - {"country": "United States", "animal": "pigs"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "cattle"}, - {"country": "United States", "animal": "sheep"}, - {"country": "United States", "animal": "sheep"}, - {"country": "United States", "animal": "sheep"}, - {"country": "United States", "animal": "sheep"}, - {"country": "United States", "animal": "sheep"}, - {"country": "United States", "animal": "sheep"}, - {"country": "United States", "animal": "sheep"} - ] - }, - "transform": [ - { - "calculate": "{'cattle': '🐄', 'pigs': '🐖', 'sheep': '🐏'}[datum.animal]", - "as": "emoji" - }, - {"window": [{"op": "rank", "as": "rank"}], "groupby": ["country", "animal"]} - ], - "facet": { - "row": {"field": "country", "type": "nominal", "header": {"title": ""}} - }, - "spec": { - "mark": {"type": "text", "baseline": "middle"}, - "width": 800, - "height": 200, - "encoding": { - "x": {"field": "rank", "type": "ordinal", "axis": null}, - "y": {"field": "animal", "type": "nominal", "axis": null, "sort": null}, - "text": {"field": "emoji", "type": "nominal"}, - "size": {"value": 65} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/isotype_bar_chart_normalized.vl.json b/examples/specs/normalized/isotype_bar_chart_normalized.vl.json index e009334665..e69de29bb2 100644 --- a/examples/specs/normalized/isotype_bar_chart_normalized.vl.json +++ b/examples/specs/normalized/isotype_bar_chart_normalized.vl.json @@ -1,87 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "config": {"view": {"stroke": ""}}, - "data": { - "values": [ - {"country": "Great Britain", "animal": "cattle", "col": 3}, - {"country": "Great Britain", "animal": "cattle", "col": 2}, - {"country": "Great Britain", "animal": "cattle", "col": 1}, - {"country": "Great Britain", "animal": "pigs", "col": 2}, - {"country": "Great Britain", "animal": "pigs", "col": 1}, - {"country": "Great Britain", "animal": "sheep", "col": 10}, - {"country": "Great Britain", "animal": "sheep", "col": 9}, - {"country": "Great Britain", "animal": "sheep", "col": 8}, - {"country": "Great Britain", "animal": "sheep", "col": 7}, - {"country": "Great Britain", "animal": "sheep", "col": 6}, - {"country": "Great Britain", "animal": "sheep", "col": 5}, - {"country": "Great Britain", "animal": "sheep", "col": 4}, - {"country": "Great Britain", "animal": "sheep", "col": 3}, - {"country": "Great Britain", "animal": "sheep", "col": 2}, - {"country": "Great Britain", "animal": "sheep", "col": 1}, - {"country": "United States", "animal": "cattle", "col": 9}, - {"country": "United States", "animal": "cattle", "col": 8}, - {"country": "United States", "animal": "cattle", "col": 7}, - {"country": "United States", "animal": "cattle", "col": 6}, - {"country": "United States", "animal": "cattle", "col": 5}, - {"country": "United States", "animal": "cattle", "col": 4}, - {"country": "United States", "animal": "cattle", "col": 3}, - {"country": "United States", "animal": "cattle", "col": 2}, - {"country": "United States", "animal": "cattle", "col": 1}, - {"country": "United States", "animal": "pigs", "col": 6}, - {"country": "United States", "animal": "pigs", "col": 5}, - {"country": "United States", "animal": "pigs", "col": 4}, - {"country": "United States", "animal": "pigs", "col": 3}, - {"country": "United States", "animal": "pigs", "col": 2}, - {"country": "United States", "animal": "pigs", "col": 1}, - {"country": "United States", "animal": "sheep", "col": 7}, - {"country": "United States", "animal": "sheep", "col": 6}, - {"country": "United States", "animal": "sheep", "col": 5}, - {"country": "United States", "animal": "sheep", "col": 4}, - {"country": "United States", "animal": "sheep", "col": 3}, - {"country": "United States", "animal": "sheep", "col": 2}, - {"country": "United States", "animal": "sheep", "col": 1} - ] - }, - "facet": { - "row": {"field": "country", "type": "nominal", "header": {"title": ""}} - }, - "spec": { - "mark": {"type": "point", "filled": true}, - "width": 800, - "height": 200, - "encoding": { - "x": {"field": "col", "type": "ordinal", "axis": null}, - "y": {"field": "animal", "type": "ordinal", "axis": null}, - "shape": { - "field": "animal", - "type": "nominal", - "scale": { - "domain": ["person", "cattle", "pigs", "sheep"], - "range": [ - "M1.7 -1.7h-0.8c0.3 -0.2 0.6 -0.5 0.6 -0.9c0 -0.6 -0.4 -1 -1 -1c-0.6 0 -1 0.4 -1 1c0 0.4 0.2 0.7 0.6 0.9h-0.8c-0.4 0 -0.7 0.3 -0.7 0.6v1.9c0 0.3 0.3 0.6 0.6 0.6h0.2c0 0 0 0.1 0 0.1v1.9c0 0.3 0.2 0.6 0.3 0.6h1.3c0.2 0 0.3 -0.3 0.3 -0.6v-1.8c0 0 0 -0.1 0 -0.1h0.2c0.3 0 0.6 -0.3 0.6 -0.6v-2c0.2 -0.3 -0.1 -0.6 -0.4 -0.6z", - "M4 -2c0 0 0.9 -0.7 1.1 -0.8c0.1 -0.1 -0.1 0.5 -0.3 0.7c-0.2 0.2 1.1 1.1 1.1 1.2c0 0.2 -0.2 0.8 -0.4 0.7c-0.1 0 -0.8 -0.3 -1.3 -0.2c-0.5 0.1 -1.3 1.6 -1.5 2c-0.3 0.4 -0.6 0.4 -0.6 0.4c0 0.1 0.3 1.7 0.4 1.8c0.1 0.1 -0.4 0.1 -0.5 0c0 0 -0.6 -1.9 -0.6 -1.9c-0.1 0 -0.3 -0.1 -0.3 -0.1c0 0.1 -0.5 1.4 -0.4 1.6c0.1 0.2 0.1 0.3 0.1 0.3c0 0 -0.4 0 -0.4 0c0 0 -0.2 -0.1 -0.1 -0.3c0 -0.2 0.3 -1.7 0.3 -1.7c0 0 -2.8 -0.9 -2.9 -0.8c-0.2 0.1 -0.4 0.6 -0.4 1c0 0.4 0.5 1.9 0.5 1.9l-0.5 0l-0.6 -2l0 -0.6c0 0 -1 0.8 -1 1c0 0.2 -0.2 1.3 -0.2 1.3c0 0 0.3 0.3 0.2 0.3c0 0 -0.5 0 -0.5 0c0 0 -0.2 -0.2 -0.1 -0.4c0 -0.1 0.2 -1.6 0.2 -1.6c0 0 0.5 -0.4 0.5 -0.5c0 -0.1 0 -2.7 -0.2 -2.7c-0.1 0 -0.4 2 -0.4 2c0 0 0 0.2 -0.2 0.5c-0.1 0.4 -0.2 1.1 -0.2 1.1c0 0 -0.2 -0.1 -0.2 -0.2c0 -0.1 -0.1 -0.7 0 -0.7c0.1 -0.1 0.3 -0.8 0.4 -1.4c0 -0.6 0.2 -1.3 0.4 -1.5c0.1 -0.2 0.6 -0.4 0.6 -0.4z", - "M1.2 -2c0 0 0.7 0 1.2 0.5c0.5 0.5 0.4 0.6 0.5 0.6c0.1 0 0.7 0 0.8 0.1c0.1 0 0.2 0.2 0.2 0.2c0 0 -0.6 0.2 -0.6 0.3c0 0.1 0.4 0.9 0.6 0.9c0.1 0 0.6 0 0.6 0.1c0 0.1 0 0.7 -0.1 0.7c-0.1 0 -1.2 0.4 -1.5 0.5c-0.3 0.1 -1.1 0.5 -1.1 0.7c-0.1 0.2 0.4 1.2 0.4 1.2l-0.4 0c0 0 -0.4 -0.8 -0.4 -0.9c0 -0.1 -0.1 -0.3 -0.1 -0.3l-0.2 0l-0.5 1.3l-0.4 0c0 0 -0.1 -0.4 0 -0.6c0.1 -0.1 0.3 -0.6 0.3 -0.7c0 0 -0.8 0 -1.5 -0.1c-0.7 -0.1 -1.2 -0.3 -1.2 -0.2c0 0.1 -0.4 0.6 -0.5 0.6c0 0 0.3 0.9 0.3 0.9l-0.4 0c0 0 -0.4 -0.5 -0.4 -0.6c0 -0.1 -0.2 -0.6 -0.2 -0.5c0 0 -0.4 0.4 -0.6 0.4c-0.2 0.1 -0.4 0.1 -0.4 0.1c0 0 -0.1 0.6 -0.1 0.6l-0.5 0l0 -1c0 0 0.5 -0.4 0.5 -0.5c0 -0.1 -0.7 -1.2 -0.6 -1.4c0.1 -0.1 0.1 -1.1 0.1 -1.1c0 0 -0.2 0.1 -0.2 0.1c0 0 0 0.9 0 1c0 0.1 -0.2 0.3 -0.3 0.3c-0.1 0 0 -0.5 0 -0.9c0 -0.4 0 -0.4 0.2 -0.6c0.2 -0.2 0.6 -0.3 0.8 -0.8c0.3 -0.5 1 -0.6 1 -0.6z", - "M-4.1 -0.5c0.2 0 0.2 0.2 0.5 0.2c0.3 0 0.3 -0.2 0.5 -0.2c0.2 0 0.2 0.2 0.4 0.2c0.2 0 0.2 -0.2 0.5 -0.2c0.2 0 0.2 0.2 0.4 0.2c0.2 0 0.2 -0.2 0.4 -0.2c0.1 0 0.2 0.2 0.4 0.1c0.2 0 0.2 -0.2 0.4 -0.3c0.1 0 0.1 -0.1 0.4 0c0.3 0 0.3 -0.4 0.6 -0.4c0.3 0 0.6 -0.3 0.7 -0.2c0.1 0.1 1.4 1 1.3 1.4c-0.1 0.4 -0.3 0.3 -0.4 0.3c-0.1 0 -0.5 -0.4 -0.7 -0.2c-0.3 0.2 -0.1 0.4 -0.2 0.6c-0.1 0.1 -0.2 0.2 -0.3 0.4c0 0.2 0.1 0.3 0 0.5c-0.1 0.2 -0.3 0.2 -0.3 0.5c0 0.3 -0.2 0.3 -0.3 0.6c-0.1 0.2 0 0.3 -0.1 0.5c-0.1 0.2 -0.1 0.2 -0.2 0.3c-0.1 0.1 0.3 1.1 0.3 1.1l-0.3 0c0 0 -0.3 -0.9 -0.3 -1c0 -0.1 -0.1 -0.2 -0.3 -0.2c-0.2 0 -0.3 0.1 -0.4 0.4c0 0.3 -0.2 0.8 -0.2 0.8l-0.3 0l0.3 -1c0 0 0.1 -0.6 -0.2 -0.5c-0.3 0.1 -0.2 -0.1 -0.4 -0.1c-0.2 -0.1 -0.3 0.1 -0.4 0c-0.2 -0.1 -0.3 0.1 -0.5 0c-0.2 -0.1 -0.1 0 -0.3 0.3c-0.2 0.3 -0.4 0.3 -0.4 0.3l0.2 1.1l-0.3 0l-0.2 -1.1c0 0 -0.4 -0.6 -0.5 -0.4c-0.1 0.3 -0.1 0.4 -0.3 0.4c-0.1 -0.1 -0.2 1.1 -0.2 1.1l-0.3 0l0.2 -1.1c0 0 -0.3 -0.1 -0.3 -0.5c0 -0.3 0.1 -0.5 0.1 -0.7c0.1 -0.2 -0.1 -1 -0.2 -1.1c-0.1 -0.2 -0.2 -0.8 -0.2 -0.8c0 0 -0.1 -0.5 0.4 -0.8z" - ] - }, - "legend": null - }, - "color": { - "field": "animal", - "type": "nominal", - "legend": null, - "scale": { - "domain": ["person", "cattle", "pigs", "sheep"], - "range": [ - "rgb(162,160,152)", - "rgb(194,81,64)", - "rgb(93,93,93)", - "rgb(91,131,149)" - ] - } - }, - "opacity": {"value": 1}, - "size": {"value": 200} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_bar_labels_normalized.vl.json b/examples/specs/normalized/layer_bar_labels_normalized.vl.json index 9158206e67..e69de29bb2 100644 --- a/examples/specs/normalized/layer_bar_labels_normalized.vl.json +++ b/examples/specs/normalized/layer_bar_labels_normalized.vl.json @@ -1,23 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [{"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43}] - }, - "layer": [ - { - "mark": "bar", - "encoding": { - "y": {"field": "a", "type": "ordinal"}, - "x": {"field": "b", "type": "quantitative"} - } - }, - { - "mark": {"type": "text", "align": "left", "baseline": "middle", "dx": 3}, - "encoding": { - "y": {"field": "a", "type": "ordinal"}, - "x": {"field": "b", "type": "quantitative"}, - "text": {"field": "b", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json b/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json index 551bef8677..e69de29bb2 100644 --- a/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json +++ b/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json @@ -1,209 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 500, - "description": "A horizontal box plot showing median, min, and max in the US population distribution of age groups in 2000 and all raw data on the top.", - "data": {"url": "data/population.json"}, - "layer": [ - { - "layer": [ - { - "transform": [ - { - "joinaggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"} - ], - "groupby": ["age"] - }, - { - "filter": "(datum[\"lower_box_people\"] - 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]) <= datum[\"people\"]) && (datum[\"people\"] <= datum[\"upper_box_people\"] + 1.5 * (datum[\"upper_box_people\"] - datum[\"lower_box_people\"]))" - }, - { - "aggregate": [ - {"op": "min", "field": "people", "as": "lower_whisker_people"}, - {"op": "max", "field": "people", "as": "upper_whisker_people"}, - { - "op": "min", - "field": "lower_box_people", - "as": "lower_box_people" - }, - { - "op": "max", - "field": "upper_box_people", - "as": "upper_box_people" - } - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "lower_whisker_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "lower_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "boxplot-rule"}, - "encoding": { - "x": { - "field": "upper_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_whisker_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_whisker_people", - "type": "quantitative", - "title": "Upper Whisker of people" - }, - { - "field": "lower_whisker_people", - "type": "quantitative", - "title": "Lower Whisker of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - }, - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "people", "as": "lower_box_people"}, - {"op": "q3", "field": "people", "as": "upper_box_people"}, - {"op": "median", "field": "people", "as": "mid_box_people"}, - {"op": "min", "field": "people", "as": "min_people"}, - {"op": "max", "field": "people", "as": "max_people"} - ], - "groupby": ["age"] - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 14, "style": "boxplot-box"}, - "encoding": { - "x": { - "field": "lower_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x2": {"field": "upper_box_people", "type": "quantitative"}, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - }, - { - "mark": { - "color": "white", - "type": "tick", - "size": 14, - "orient": "vertical", - "style": "boxplot-median" - }, - "encoding": { - "x": { - "field": "mid_box_people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "y": {"field": "age", "type": "ordinal"}, - "tooltip": [ - { - "field": "max_people", - "type": "quantitative", - "title": "Max of people" - }, - { - "field": "upper_box_people", - "type": "quantitative", - "title": "Q3 of people" - }, - { - "field": "mid_box_people", - "type": "quantitative", - "title": "Median of people" - }, - { - "field": "lower_box_people", - "type": "quantitative", - "title": "Q1 of people" - }, - { - "field": "min_people", - "type": "quantitative", - "title": "Min of people" - }, - {"field": "age", "type": "ordinal"} - ] - } - } - ] - } - ] - }, - { - "mark": "circle", - "encoding": { - "y": {"field": "age", "type": "ordinal"}, - "x": { - "field": "people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "color": {"value": "black"}, - "opacity": {"value": 0.2} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_candlestick_normalized.vl.json b/examples/specs/normalized/layer_candlestick_normalized.vl.json index b11edef57e..e69de29bb2 100644 --- a/examples/specs/normalized/layer_candlestick_normalized.vl.json +++ b/examples/specs/normalized/layer_candlestick_normalized.vl.json @@ -1,235 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "width": 320, - "description": "A candlestick chart inspired by an example in Protovis (http://mbostock.github.io/protovis/ex/candlestick.html)", - "data": { - "format": {"parse": {"date": "date:'%Y-%m-%d'"}}, - "values": [ - { - "date": "2009-06-01", - "open": 28.7, - "high": 30.05, - "low": 28.45, - "close": 30.04, - "signal": "short", - "ret": -4.89396411092985 - }, - { - "date": "2009-06-02", - "open": 30.04, - "high": 30.13, - "low": 28.3, - "close": 29.63, - "signal": "short", - "ret": -0.322580645161295 - }, - { - "date": "2009-06-03", - "open": 29.62, - "high": 31.79, - "low": 29.62, - "close": 31.02, - "signal": "short", - "ret": 3.68663594470045 - }, - { - "date": "2009-06-04", - "open": 31.02, - "high": 31.02, - "low": 29.92, - "close": 30.18, - "signal": "short", - "ret": 4.51010886469673 - }, - { - "date": "2009-06-05", - "open": 29.39, - "high": 30.81, - "low": 28.85, - "close": 29.62, - "signal": "short", - "ret": 6.08424336973478 - }, - { - "date": "2009-06-08", - "open": 30.84, - "high": 31.82, - "low": 26.41, - "close": 29.77, - "signal": "short", - "ret": 1.2539184952978 - }, - { - "date": "2009-06-09", - "open": 29.77, - "high": 29.77, - "low": 27.79, - "close": 28.27, - "signal": "short", - "ret": -5.02431118314424 - }, - { - "date": "2009-06-10", - "open": 26.9, - "high": 29.74, - "low": 26.9, - "close": 28.46, - "signal": "short", - "ret": -5.46623794212217 - }, - { - "date": "2009-06-11", - "open": 27.36, - "high": 28.11, - "low": 26.81, - "close": 28.11, - "signal": "short", - "ret": -8.3743842364532 - }, - { - "date": "2009-06-12", - "open": 28.08, - "high": 28.5, - "low": 27.73, - "close": 28.15, - "signal": "short", - "ret": -5.52763819095477 - }, - { - "date": "2009-06-15", - "open": 29.7, - "high": 31.09, - "low": 29.64, - "close": 30.81, - "signal": "long", - "ret": 3.4920634920635 - }, - { - "date": "2009-06-16", - "open": 30.81, - "high": 32.75, - "low": 30.07, - "close": 32.68, - "signal": "short", - "ret": 0.155038759689914 - }, - { - "date": "2009-06-17", - "open": 31.19, - "high": 32.77, - "low": 30.64, - "close": 31.54, - "signal": "short", - "ret": 5.82822085889571 - }, - { - "date": "2009-06-18", - "open": 31.54, - "high": 31.54, - "low": 29.6, - "close": 30.03, - "signal": "short", - "ret": 8.17610062893082 - }, - { - "date": "2009-06-19", - "open": 29.16, - "high": 29.32, - "low": 27.56, - "close": 27.99, - "signal": "short", - "ret": 8.59872611464968 - }, - { - "date": "2009-06-22", - "open": 30.4, - "high": 32.05, - "low": 30.3, - "close": 31.17, - "signal": "short", - "ret": 15.4907975460123 - }, - { - "date": "2009-06-23", - "open": 31.3, - "high": 31.54, - "low": 27.83, - "close": 30.58, - "signal": "short", - "ret": 11.7370892018779 - }, - { - "date": "2009-06-24", - "open": 30.58, - "high": 30.58, - "low": 28.79, - "close": 29.05, - "signal": "long", - "ret": -10.4234527687296 - }, - { - "date": "2009-06-25", - "open": 29.45, - "high": 29.56, - "low": 26.3, - "close": 26.36, - "signal": "long", - "ret": 0 - }, - { - "date": "2009-06-26", - "open": 27.09, - "high": 27.22, - "low": 25.76, - "close": 25.93, - "signal": "long", - "ret": 0 - }, - { - "date": "2009-06-29", - "open": 25.93, - "high": 27.18, - "low": 25.29, - "close": 25.35, - "signal": "long", - "ret": 5.26315789473684 - }, - { - "date": "2009-06-30", - "open": 25.36, - "high": 27.38, - "low": 25.02, - "close": 26.35, - "signal": "long", - "ret": 6.73758865248228 - } - ] - }, - "layer": [ - { - "mark": "rule", - "encoding": { - "x": {"field": "date", "type": "temporal", "title": "Date in 2009"}, - "color": { - "condition": {"test": "datum.open < datum.close", "value": "#06982d"}, - "value": "#ae1325" - }, - "y": {"field": "low", "type": "quantitative", "scale": {"zero": false}}, - "y2": {"field": "high"} - } - }, - { - "mark": "bar", - "encoding": { - "x": {"field": "date", "type": "temporal", "title": "Date in 2009"}, - "color": { - "condition": {"test": "datum.open < datum.close", "value": "#06982d"}, - "value": "#ae1325" - }, - "y": {"field": "open", "type": "quantitative"}, - "y2": {"field": "close"}, - "size": {"value": 5} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_cumulative_histogram_normalized.vl.json b/examples/specs/normalized/layer_cumulative_histogram_normalized.vl.json index 1b9b2e1640..e69de29bb2 100644 --- a/examples/specs/normalized/layer_cumulative_histogram_normalized.vl.json +++ b/examples/specs/normalized/layer_cumulative_histogram_normalized.vl.json @@ -1,45 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/movies.json"}, - "transform": [ - {"bin": true, "field": "IMDB_Rating", "as": "bin_IMDB_Rating"}, - { - "aggregate": [{"op": "count", "as": "count"}], - "groupby": ["bin_IMDB_Rating", "bin_IMDB_Rating_end"] - }, - {"filter": "datum.bin_IMDB_Rating !== null"}, - { - "sort": [{"field": "bin_IMDB_Rating"}], - "window": [{"op": "sum", "field": "count", "as": "cumulative_count"}], - "frame": [null, 0] - } - ], - "layer": [ - { - "mark": "bar", - "encoding": { - "x": { - "field": "bin_IMDB_Rating", - "type": "quantitative", - "scale": {"zero": false}, - "title": "IMDB Rating" - }, - "x2": {"field": "bin_IMDB_Rating_end"}, - "y": {"field": "cumulative_count", "type": "quantitative"} - } - }, - { - "mark": {"type": "bar", "color": "yellow", "opacity": 0.5}, - "encoding": { - "x": { - "field": "bin_IMDB_Rating", - "type": "quantitative", - "scale": {"zero": false}, - "title": "IMDB Rating" - }, - "x2": {"field": "bin_IMDB_Rating_end"}, - "y": {"field": "count", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_dual_axis_normalized.vl.json b/examples/specs/normalized/layer_dual_axis_normalized.vl.json index 2ea5fca25b..e69de29bb2 100644 --- a/examples/specs/normalized/layer_dual_axis_normalized.vl.json +++ b/examples/specs/normalized/layer_dual_axis_normalized.vl.json @@ -1,51 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v2.6.0.json", - "description": "A dual axis chart, created by setting y's scale resolution to `\"independent\"`", - "width": 400, - "height": 300, - "data": {"url": "data/weather.csv", "format": {"type": "csv"}}, - "transform": [{"filter": "datum.location == \"Seattle\""}], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "area", "color": "#85C5A6"}, - "encoding": { - "x": { - "field": "date", - "axis": {"format": "%b", "title": null}, - "type": "temporal", - "timeUnit": "month" - }, - "y": { - "aggregate": "average", - "field": "temp_max", - "scale": {"domain": [0, 30]}, - "type": "quantitative", - "axis": {"title": "Avg. Temperature (°C)", "titleColor": "#85C5A6"} - }, - "y2": { - "aggregate": "average", - "field": "temp_min", - "type": "quantitative" - } - } - }, - { - "mark": {"stroke": "#85A9C5", "type": "line", "interpolate": "monotone"}, - "encoding": { - "x": { - "field": "date", - "axis": {"format": "%b", "title": null}, - "type": "temporal", - "timeUnit": "month" - }, - "y": { - "aggregate": "average", - "field": "precipitation", - "type": "quantitative", - "axis": {"title": "Precipitation (inches)", "titleColor": "#85A9C5"} - } - } - } - ], - "resolve": {"scale": {"y": "independent"}} -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_likert_normalized.vl.json b/examples/specs/normalized/layer_likert_normalized.vl.json index 8374d34e2b..e69de29bb2 100644 --- a/examples/specs/normalized/layer_likert_normalized.vl.json +++ b/examples/specs/normalized/layer_likert_normalized.vl.json @@ -1,323 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Likert Scale Ratings Distributions and Medians. (Figure 9 from @jhoffswell and @zcliu's ['Interactive Repair of Tables Extracted from PDF Documents on Mobile Devices'](https://idl.cs.washington.edu/files/2019-InteractiveTableRepair-CHI.pdf))", - "datasets": { - "medians": [ - { - "name": "Identify Errors:", - "median": 1.999976, - "lo": "Easy", - "hi": "Hard" - }, - {"name": "Fix Errors:", "median": 2, "lo": "Easy", "hi": "Hard"}, - { - "name": "Easier to Fix:", - "median": 1.999969, - "lo": "Toolbar", - "hi": "Gesture" - }, - { - "name": "Faster to Fix:", - "median": 2.500045, - "lo": "Toolbar", - "hi": "Gesture" - }, - { - "name": "Easier on Phone:", - "median": 1.500022, - "lo": "Toolbar", - "hi": "Gesture" - }, - { - "name": "Easier on Tablet:", - "median": 2.99998, - "lo": "Toolbar", - "hi": "Gesture" - }, - { - "name": "Device Preference:", - "median": 4.500007, - "lo": "Phone", - "hi": "Tablet" - } - ], - "values": [ - {"value": "P1", "name": "Participant ID", "id": "P1"}, - {"value": 2, "name": "Identify Errors:", "id": "P1"}, - {"value": 2, "name": "Fix Errors:", "id": "P1"}, - {"value": 3, "name": "Easier to Fix:", "id": "P1"}, - {"value": 4, "name": "Faster to Fix:", "id": "P1"}, - {"value": 2, "name": "Easier on Phone:", "id": "P1"}, - {"value": 5, "name": "Easier on Tablet:", "id": "P1"}, - {"value": 5, "name": "Device Preference:", "id": "P1"}, - {"value": 1, "name": "Tablet_First", "id": "P1"}, - {"value": 1, "name": "Toolbar_First", "id": "P1"}, - {"value": "P2", "name": "Participant ID", "id": "P2"}, - {"value": 2, "name": "Identify Errors:", "id": "P2"}, - {"value": 3, "name": "Fix Errors:", "id": "P2"}, - {"value": 4, "name": "Easier to Fix:", "id": "P2"}, - {"value": 5, "name": "Faster to Fix:", "id": "P2"}, - {"value": 5, "name": "Easier on Phone:", "id": "P2"}, - {"value": 5, "name": "Easier on Tablet:", "id": "P2"}, - {"value": 5, "name": "Device Preference:", "id": "P2"}, - {"value": 1, "name": "Tablet_First", "id": "P2"}, - {"value": 1, "name": "Toolbar_First", "id": "P2"}, - {"value": "P3", "name": "Participant ID", "id": "P3"}, - {"value": 2, "name": "Identify Errors:", "id": "P3"}, - {"value": 2, "name": "Fix Errors:", "id": "P3"}, - {"value": 2, "name": "Easier to Fix:", "id": "P3"}, - {"value": 1, "name": "Faster to Fix:", "id": "P3"}, - {"value": 2, "name": "Easier on Phone:", "id": "P3"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P3"}, - {"value": 5, "name": "Device Preference:", "id": "P3"}, - {"value": 1, "name": "Tablet_First", "id": "P3"}, - {"value": 0, "name": "Toolbar_First", "id": "P3"}, - {"value": "P4", "name": "Participant ID", "id": "P4"}, - {"value": 3, "name": "Identify Errors:", "id": "P4"}, - {"value": 3, "name": "Fix Errors:", "id": "P4"}, - {"value": 2, "name": "Easier to Fix:", "id": "P4"}, - {"value": 2, "name": "Faster to Fix:", "id": "P4"}, - {"value": 4, "name": "Easier on Phone:", "id": "P4"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P4"}, - {"value": 5, "name": "Device Preference:", "id": "P4"}, - {"value": 1, "name": "Tablet_First", "id": "P4"}, - {"value": 0, "name": "Toolbar_First", "id": "P4"}, - {"value": "P5", "name": "Participant ID", "id": "P5"}, - {"value": 2, "name": "Identify Errors:", "id": "P5"}, - {"value": 2, "name": "Fix Errors:", "id": "P5"}, - {"value": 4, "name": "Easier to Fix:", "id": "P5"}, - {"value": 4, "name": "Faster to Fix:", "id": "P5"}, - {"value": 4, "name": "Easier on Phone:", "id": "P5"}, - {"value": 5, "name": "Easier on Tablet:", "id": "P5"}, - {"value": 5, "name": "Device Preference:", "id": "P5"}, - {"value": 0, "name": "Tablet_First", "id": "P5"}, - {"value": 1, "name": "Toolbar_First", "id": "P5"}, - {"value": "P6", "name": "Participant ID", "id": "P6"}, - {"value": 1, "name": "Identify Errors:", "id": "P6"}, - {"value": 3, "name": "Fix Errors:", "id": "P6"}, - {"value": 3, "name": "Easier to Fix:", "id": "P6"}, - {"value": 4, "name": "Faster to Fix:", "id": "P6"}, - {"value": 4, "name": "Easier on Phone:", "id": "P6"}, - {"value": 4, "name": "Easier on Tablet:", "id": "P6"}, - {"value": 4, "name": "Device Preference:", "id": "P6"}, - {"value": 0, "name": "Tablet_First", "id": "P6"}, - {"value": 1, "name": "Toolbar_First", "id": "P6"}, - {"value": "P7", "name": "Participant ID", "id": "P7"}, - {"value": 2, "name": "Identify Errors:", "id": "P7"}, - {"value": 3, "name": "Fix Errors:", "id": "P7"}, - {"value": 4, "name": "Easier to Fix:", "id": "P7"}, - {"value": 5, "name": "Faster to Fix:", "id": "P7"}, - {"value": 3, "name": "Easier on Phone:", "id": "P7"}, - {"value": 2, "name": "Easier on Tablet:", "id": "P7"}, - {"value": 4, "name": "Device Preference:", "id": "P7"}, - {"value": 0, "name": "Tablet_First", "id": "P7"}, - {"value": 0, "name": "Toolbar_First", "id": "P7"}, - {"value": "P8", "name": "Participant ID", "id": "P8"}, - {"value": 3, "name": "Identify Errors:", "id": "P8"}, - {"value": 1, "name": "Fix Errors:", "id": "P8"}, - {"value": 2, "name": "Easier to Fix:", "id": "P8"}, - {"value": 4, "name": "Faster to Fix:", "id": "P8"}, - {"value": 2, "name": "Easier on Phone:", "id": "P8"}, - {"value": 5, "name": "Easier on Tablet:", "id": "P8"}, - {"value": 5, "name": "Device Preference:", "id": "P8"}, - {"value": 0, "name": "Tablet_First", "id": "P8"}, - {"value": 0, "name": "Toolbar_First", "id": "P8"}, - {"value": "P9", "name": "Participant ID", "id": "P9"}, - {"value": 2, "name": "Identify Errors:", "id": "P9"}, - {"value": 3, "name": "Fix Errors:", "id": "P9"}, - {"value": 2, "name": "Easier to Fix:", "id": "P9"}, - {"value": 4, "name": "Faster to Fix:", "id": "P9"}, - {"value": 1, "name": "Easier on Phone:", "id": "P9"}, - {"value": 4, "name": "Easier on Tablet:", "id": "P9"}, - {"value": 4, "name": "Device Preference:", "id": "P9"}, - {"value": 1, "name": "Tablet_First", "id": "P9"}, - {"value": 1, "name": "Toolbar_First", "id": "P9"}, - {"value": "P10", "name": "Participant ID", "id": "P10"}, - {"value": 2, "name": "Identify Errors:", "id": "P10"}, - {"value": 2, "name": "Fix Errors:", "id": "P10"}, - {"value": 1, "name": "Easier to Fix:", "id": "P10"}, - {"value": 1, "name": "Faster to Fix:", "id": "P10"}, - {"value": 1, "name": "Easier on Phone:", "id": "P10"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P10"}, - {"value": 5, "name": "Device Preference:", "id": "P10"}, - {"value": 1, "name": "Tablet_First", "id": "P10"}, - {"value": 1, "name": "Toolbar_First", "id": "P10"}, - {"value": "P11", "name": "Participant ID", "id": "P11"}, - {"value": 2, "name": "Identify Errors:", "id": "P11"}, - {"value": 2, "name": "Fix Errors:", "id": "P11"}, - {"value": 1, "name": "Easier to Fix:", "id": "P11"}, - {"value": 1, "name": "Faster to Fix:", "id": "P11"}, - {"value": 1, "name": "Easier on Phone:", "id": "P11"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P11"}, - {"value": 4, "name": "Device Preference:", "id": "P11"}, - {"value": 1, "name": "Tablet_First", "id": "P11"}, - {"value": 0, "name": "Toolbar_First", "id": "P11"}, - {"value": "P12", "name": "Participant ID", "id": "P12"}, - {"value": 1, "name": "Identify Errors:", "id": "P12"}, - {"value": 3, "name": "Fix Errors:", "id": "P12"}, - {"value": 2, "name": "Easier to Fix:", "id": "P12"}, - {"value": 3, "name": "Faster to Fix:", "id": "P12"}, - {"value": 1, "name": "Easier on Phone:", "id": "P12"}, - {"value": 3, "name": "Easier on Tablet:", "id": "P12"}, - {"value": 3, "name": "Device Preference:", "id": "P12"}, - {"value": 0, "name": "Tablet_First", "id": "P12"}, - {"value": 1, "name": "Toolbar_First", "id": "P12"}, - {"value": "P13", "name": "Participant ID", "id": "P13"}, - {"value": 2, "name": "Identify Errors:", "id": "P13"}, - {"value": 2, "name": "Fix Errors:", "id": "P13"}, - {"value": 1, "name": "Easier to Fix:", "id": "P13"}, - {"value": 1, "name": "Faster to Fix:", "id": "P13"}, - {"value": 1, "name": "Easier on Phone:", "id": "P13"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P13"}, - {"value": 5, "name": "Device Preference:", "id": "P13"}, - {"value": 0, "name": "Tablet_First", "id": "P13"}, - {"value": 0, "name": "Toolbar_First", "id": "P13"}, - {"value": "P14", "name": "Participant ID", "id": "P14"}, - {"value": 3, "name": "Identify Errors:", "id": "P14"}, - {"value": 3, "name": "Fix Errors:", "id": "P14"}, - {"value": 2, "name": "Easier to Fix:", "id": "P14"}, - {"value": 2, "name": "Faster to Fix:", "id": "P14"}, - {"value": 1, "name": "Easier on Phone:", "id": "P14"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P14"}, - {"value": 1, "name": "Device Preference:", "id": "P14"}, - {"value": 1, "name": "Tablet_First", "id": "P14"}, - {"value": 1, "name": "Toolbar_First", "id": "P14"}, - {"value": "P15", "name": "Participant ID", "id": "P15"}, - {"value": 4, "name": "Identify Errors:", "id": "P15"}, - {"value": 5, "name": "Fix Errors:", "id": "P15"}, - {"value": 1, "name": "Easier to Fix:", "id": "P15"}, - {"value": 1, "name": "Faster to Fix:", "id": "P15"}, - {"value": 1, "name": "Easier on Phone:", "id": "P15"}, - {"value": 1, "name": "Easier on Tablet:", "id": "P15"}, - {"value": 5, "name": "Device Preference:", "id": "P15"}, - {"value": 1, "name": "Tablet_First", "id": "P15"}, - {"value": 0, "name": "Toolbar_First", "id": "P15"}, - {"value": "P16", "name": "Participant ID", "id": "P16"}, - {"value": 1, "name": "Identify Errors:", "id": "P16"}, - {"value": 3, "name": "Fix Errors:", "id": "P16"}, - {"value": 2, "name": "Easier to Fix:", "id": "P16"}, - {"value": 2, "name": "Faster to Fix:", "id": "P16"}, - {"value": 1, "name": "Easier on Phone:", "id": "P16"}, - {"value": 4, "name": "Easier on Tablet:", "id": "P16"}, - {"value": 5, "name": "Device Preference:", "id": "P16"}, - {"value": 0, "name": "Tablet_First", "id": "P16"}, - {"value": 1, "name": "Toolbar_First", "id": "P16"}, - {"value": "P17", "name": "Participant ID", "id": "P17"}, - {"value": 3, "name": "Identify Errors:", "id": "P17"}, - {"value": 2, "name": "Fix Errors:", "id": "P17"}, - {"value": 2, "name": "Easier to Fix:", "id": "P17"}, - {"value": 2, "name": "Faster to Fix:", "id": "P17"}, - {"value": 1, "name": "Easier on Phone:", "id": "P17"}, - {"value": 3, "name": "Easier on Tablet:", "id": "P17"}, - {"value": 2, "name": "Device Preference:", "id": "P17"}, - {"value": 0, "name": "Tablet_First", "id": "P17"}, - {"value": 0, "name": "Toolbar_First", "id": "P17"} - ] - }, - "data": {"name": "medians"}, - "title": "Questionnaire Ratings", - "width": 250, - "height": 175, - "view": {"stroke": null}, - "layer": [ - { - "mark": "circle", - "data": {"name": "values"}, - "transform": [ - {"filter": "datum.name != 'Toolbar_First'"}, - {"filter": "datum.name != 'Tablet_First'"}, - {"filter": "datum.name != 'Participant ID'"} - ], - "encoding": { - "y": { - "field": "name", - "type": "nominal", - "sort": null, - "axis": { - "domain": false, - "offset": 50, - "labelFontWeight": "bold", - "ticks": false, - "grid": true, - "title": null - } - }, - "x": { - "field": "value", - "type": "quantitative", - "scale": {"domain": [0, 6]}, - "axis": {"grid": false, "values": [1, 2, 3, 4, 5]} - }, - "size": { - "aggregate": "count", - "type": "quantitative", - "legend": {"title": "Number of Ratings", "offset": 75} - }, - "color": {"value": "#6EB4FD"} - } - }, - { - "mark": "tick", - "encoding": { - "y": { - "field": "name", - "type": "nominal", - "sort": null, - "axis": { - "domain": false, - "offset": 50, - "labelFontWeight": "bold", - "ticks": false, - "grid": true, - "title": null - } - }, - "x": { - "field": "median", - "type": "quantitative", - "scale": {"domain": [1, 5]}, - "axis": {"title": null} - }, - "color": {"value": "black"} - } - }, - { - "mark": {"type": "text", "x": -5, "align": "right"}, - "encoding": { - "y": { - "field": "name", - "type": "nominal", - "sort": null, - "axis": { - "domain": false, - "offset": 50, - "labelFontWeight": "bold", - "ticks": false, - "grid": true, - "title": null - } - }, - "text": {"field": "lo", "type": "nominal"} - } - }, - { - "mark": {"type": "text", "x": 255, "align": "left"}, - "encoding": { - "y": { - "field": "name", - "type": "nominal", - "sort": null, - "axis": { - "domain": false, - "offset": 50, - "labelFontWeight": "bold", - "ticks": false, - "grid": true, - "title": null - } - }, - "text": {"field": "hi", "type": "nominal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_line_co2_concentration_normalized.vl.json b/examples/specs/normalized/layer_line_co2_concentration_normalized.vl.json index 1d73d43470..e69de29bb2 100644 --- a/examples/specs/normalized/layer_line_co2_concentration_normalized.vl.json +++ b/examples/specs/normalized/layer_line_co2_concentration_normalized.vl.json @@ -1,91 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "url": "data/co2-concentration.csv", - "format": {"parse": {"Date": "utc:'%Y-%m-%d'"}} - }, - "width": 800, - "height": 500, - "transform": [ - {"calculate": "year(datum.Date)", "as": "year"}, - {"calculate": "floor(datum.year / 10)", "as": "decade"}, - { - "calculate": "(datum.year % 10) + (month(datum.Date)/12)", - "as": "scaled_date" - }, - { - "window": [ - {"op": "first_value", "field": "scaled_date", "as": "first_date"}, - {"op": "last_value", "field": "scaled_date", "as": "last_date"} - ], - "sort": [{"field": "scaled_date", "order": "ascending"}], - "groupby": ["decade"], - "frame": [null, null] - }, - { - "calculate": "datum.first_date === datum.scaled_date ? 'first' : datum.last_date === datum.scaled_date ? 'last' : null", - "as": "end" - } - ], - "layer": [ - { - "mark": "line", - "encoding": { - "x": { - "field": "scaled_date", - "type": "quantitative", - "axis": {"title": "Year into Decade", "tickCount": 11} - }, - "y": { - "field": "CO2", - "title": "CO2 concentration in ppm", - "type": "quantitative", - "scale": {"zero": false} - }, - "color": { - "field": "decade", - "type": "ordinal", - "scale": {"scheme": "magma"}, - "legend": null - } - } - }, - { - "transform": [{"filter": {"field": "end", "equal": "first"}}], - "mark": {"type": "text", "baseline": "top"}, - "encoding": { - "x": { - "field": "scaled_date", - "type": "quantitative", - "axis": {"title": "Year into Decade", "tickCount": 11} - }, - "y": { - "field": "CO2", - "title": "CO2 concentration in ppm", - "type": "quantitative", - "scale": {"zero": false} - }, - "text": {"field": "year", "type": "nominal"} - } - }, - { - "transform": [{"filter": {"field": "end", "equal": "last"}}], - "mark": {"type": "text", "baseline": "bottom"}, - "encoding": { - "x": { - "field": "scaled_date", - "type": "quantitative", - "axis": {"title": "Year into Decade", "tickCount": 11} - }, - "y": { - "field": "CO2", - "title": "CO2 concentration in ppm", - "type": "quantitative", - "scale": {"zero": false} - }, - "text": {"field": "year", "type": "nominal"} - } - } - ], - "config": {"text": {"align": "left", "dx": 3, "dy": 1}} -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_line_errorband_2d_horizontal_borders_strokedash_normalized.vl.json b/examples/specs/normalized/layer_line_errorband_2d_horizontal_borders_strokedash_normalized.vl.json index c3c2a40663..e69de29bb2 100644 --- a/examples/specs/normalized/layer_line_errorband_2d_horizontal_borders_strokedash_normalized.vl.json +++ b/examples/specs/normalized/layer_line_errorband_2d_horizontal_borders_strokedash_normalized.vl.json @@ -1,175 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "layer": [ - { - "transform": [ - {"timeUnit": "year", "field": "Year", "as": "year_Year"}, - { - "aggregate": [ - { - "op": "ci0", - "field": "Miles_per_Gallon", - "as": "lower_Miles_per_Gallon" - }, - { - "op": "ci1", - "field": "Miles_per_Gallon", - "as": "upper_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": ["year_Year"] - } - ], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "area", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": { - "type": "line", - "style": "errorband-borders", - "opacity": 0.5, - "strokeDash": [6, 4] - }, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - }, - { - "mark": { - "type": "line", - "style": "errorband-borders", - "opacity": 0.5, - "strokeDash": [6, 4] - }, - "encoding": { - "y": { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - } - ] - }, - { - "mark": "line", - "encoding": { - "y": { - "field": "Miles_per_Gallon", - "type": "quantitative", - "aggregate": "mean" - }, - "x": {"field": "Year", "type": "temporal", "timeUnit": "year"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_line_errorband_ci_normalized.vl.json b/examples/specs/normalized/layer_line_errorband_ci_normalized.vl.json index 3699c7d4e8..e69de29bb2 100644 --- a/examples/specs/normalized/layer_line_errorband_ci_normalized.vl.json +++ b/examples/specs/normalized/layer_line_errorband_ci_normalized.vl.json @@ -1,84 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "layer": [ - { - "transform": [ - {"timeUnit": "year", "field": "Year", "as": "year_Year"}, - { - "aggregate": [ - { - "op": "ci0", - "field": "Miles_per_Gallon", - "as": "lower_Miles_per_Gallon" - }, - { - "op": "ci1", - "field": "Miles_per_Gallon", - "as": "upper_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": ["year_Year"] - } - ], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "area", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles per Gallon (95% CIs)" - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci1 of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Ci0 of Miles_per_Gallon" - }, - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - } - ] - }, - { - "mark": "line", - "encoding": { - "x": {"field": "Year", "type": "temporal", "timeUnit": "year"}, - "y": { - "aggregate": "mean", - "field": "Miles_per_Gallon", - "type": "quantitative" - } - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_line_errorband_pre_aggregated_normalized.vl.json b/examples/specs/normalized/layer_line_errorband_pre_aggregated_normalized.vl.json index a38ed9a6ec..e69de29bb2 100644 --- a/examples/specs/normalized/layer_line_errorband_pre_aggregated_normalized.vl.json +++ b/examples/specs/normalized/layer_line_errorband_pre_aggregated_normalized.vl.json @@ -1,57 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - {"ci1": 23.5007, "ci0": 19.6912, "center": 21.5735, "Year": 189302400000}, - {"ci1": 25.8214, "ci0": 20.8554, "center": 23.375, "Year": 220924800000}, - {"ci1": 26.4472, "ci0": 21.9749, "center": 24.0611, "Year": 252460800000}, - {"ci1": 27.7074, "ci0": 22.6203, "center": 25.0931, "Year": 283996800000} - ] - }, - "layer": [ - { - "transform": [ - {"timeUnit": "year", "field": "Year", "as": "year_Year"}, - {"calculate": "datum[\"ci0\"]", "as": "upper_ci1"}, - {"calculate": "datum[\"ci1\"]", "as": "lower_ci1"} - ], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "area", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_ci1", - "type": "quantitative", - "title": "Mean of Miles per Gallon (95% CIs)", - "scale": {"zero": false} - }, - "y2": {"field": "upper_ci1", "type": "quantitative"}, - "x": { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - }, - "tooltip": [ - {"field": "upper_ci1", "type": "quantitative", "title": "ci0"}, - {"field": "lower_ci1", "type": "quantitative", "title": "ci1"}, - { - "title": "Year (year)", - "type": "temporal", - "field": "year_Year", - "axis": {"format": "%Y"} - } - ] - } - } - ] - }, - { - "mark": "line", - "encoding": { - "y": {"field": "center", "type": "quantitative"}, - "x": {"field": "Year", "type": "temporal", "timeUnit": "year"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_overlay_normalized.vl.json b/examples/specs/normalized/layer_overlay_normalized.vl.json index c59f3bf023..e69de29bb2 100644 --- a/examples/specs/normalized/layer_overlay_normalized.vl.json +++ b/examples/specs/normalized/layer_overlay_normalized.vl.json @@ -1,66 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "layer": [ - { - "data": {"url": "data/cars.json"}, - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"field": "Cylinders", "type": "ordinal"}, - "y": { - "aggregate": "max", - "bin": false, - "field": "Horsepower", - "type": "quantitative" - }, - "color": {"value": "darkred"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": {"field": "Cylinders", "type": "ordinal"}, - "y": { - "aggregate": "max", - "bin": false, - "field": "Horsepower", - "type": "quantitative" - }, - "color": {"value": "darkred"} - } - } - ] - }, - { - "data": {"url": "data/cars.json"}, - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"field": "Cylinders", "type": "ordinal"}, - "y": { - "aggregate": "min", - "bin": false, - "field": "Horsepower", - "type": "quantitative" - } - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": {"field": "Cylinders", "type": "ordinal"}, - "y": { - "aggregate": "min", - "bin": false, - "field": "Horsepower", - "type": "quantitative" - } - } - } - ] - } - ], - "config": {"line": {"point": true}} -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_1d_horizontal_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_1d_horizontal_normalized.vl.json index 51d52ba61d..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_1d_horizontal_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_1d_horizontal_normalized.vl.json @@ -1,62 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stderr", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": [] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - } - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "aggregate": "mean", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_1d_vertical_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_1d_vertical_normalized.vl.json index 70d0c84955..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_1d_vertical_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_1d_vertical_normalized.vl.json @@ -1,62 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stderr", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": [] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "y": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "y2": {"field": "upper_yield", "type": "quantitative"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - } - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "y": {"field": "yield", "aggregate": "mean", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_ci_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_ci_normalized.vl.json index 791a4b4d43..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_ci_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_ci_normalized.vl.json @@ -1,58 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "ci0", "field": "yield", "as": "lower_yield"}, - {"op": "ci1", "field": "yield", "as": "upper_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_yield", - "type": "quantitative", - "title": "Ci1 of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Ci0 of yield" - }, - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "mean"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_color_encoding_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_color_encoding_normalized.vl.json index e706b8612a..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_color_encoding_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_color_encoding_normalized.vl.json @@ -1,136 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stderr", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": { - "type": "tick", - "orient": "vertical", - "style": "errorbar-ticks" - }, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "y": {"field": "variety", "type": "ordinal"}, - "color": {"value": "#4682b4"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - }, - { - "mark": { - "type": "tick", - "orient": "vertical", - "style": "errorbar-ticks" - }, - "encoding": { - "x": { - "field": "upper_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "y": {"field": "variety", "type": "ordinal"}, - "color": {"value": "#4682b4"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "color": {"value": "#4682b4"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "mean"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_custom_ticks_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_custom_ticks_normalized.vl.json index 268997dedd..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_custom_ticks_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_custom_ticks_normalized.vl.json @@ -1,135 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stderr", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": { - "type": "tick", - "orient": "vertical", - "style": "errorbar-ticks", - "color": "teal" - }, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - }, - { - "mark": { - "type": "tick", - "orient": "vertical", - "style": "errorbar-ticks", - "color": "teal" - }, - "encoding": { - "x": { - "field": "upper_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - }, - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "mean"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_iqr_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_iqr_normalized.vl.json index 4f8cbbac94..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_iqr_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_iqr_normalized.vl.json @@ -1,58 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "q1", "field": "yield", "as": "lower_yield"}, - {"op": "q3", "field": "yield", "as": "upper_yield"}, - {"op": "median", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_yield", - "type": "quantitative", - "title": "Q3 of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Q1 of yield" - }, - { - "field": "center_yield", - "type": "quantitative", - "title": "Median of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "median"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_normalized.vl.json index 79ef5ef8ea..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_normalized.vl.json @@ -1,65 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stderr", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "mean"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_stdev_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_stdev_normalized.vl.json index 6969ca6fa5..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_horizontal_stdev_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_horizontal_stdev_normalized.vl.json @@ -1,65 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stdev", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stdev of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stdev of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "mean"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_2d_vertical_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_2d_vertical_normalized.vl.json index 84938f7312..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_2d_vertical_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_2d_vertical_normalized.vl.json @@ -1,65 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "transform": [ - { - "aggregate": [ - {"op": "stderr", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "y": { - "field": "lower_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "y2": {"field": "upper_yield", "type": "quantitative"}, - "x": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stderr of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stderr of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "y": {"field": "yield", "type": "quantitative", "aggregate": "mean"}, - "x": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_ci_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_ci_normalized.vl.json index 5a451a1e03..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_ci_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_ci_normalized.vl.json @@ -1,64 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "mark": {"type": "point", "filled": true}, - "encoding": { - "y": {"field": "variety", "type": "ordinal"}, - "x": { - "aggregate": "mean", - "field": "yield", - "type": "quantitative", - "scale": {"zero": false}, - "title": "Barley Yield" - }, - "color": {"value": "black"} - } - }, - { - "transform": [ - { - "aggregate": [ - {"op": "ci0", "field": "yield", "as": "lower_yield"}, - {"op": "ci1", "field": "yield", "as": "upper_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "Barley Yield" - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_yield", - "type": "quantitative", - "title": "Ci1 of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Ci0 of yield" - }, - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_pre_aggregated_asymmetric_error_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_pre_aggregated_asymmetric_error_normalized.vl.json index 2aa5bff952..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_pre_aggregated_asymmetric_error_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_pre_aggregated_asymmetric_error_normalized.vl.json @@ -1,85 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - { - "yield_error": 7.5522, - "yield_error2": -10.5522, - "yield_center": 32.4, - "variety": "Glabron" - }, - { - "yield_error": 6.9775, - "yield_error2": -3.9775, - "yield_center": 30.96667, - "variety": "Manchuria" - }, - { - "yield_error": 3.9167, - "yield_error2": -0.9167, - "yield_center": 33.966665, - "variety": "No. 457" - }, - { - "yield_error": 11.9732, - "yield_error2": -15.9732, - "yield_center": 30.45, - "variety": "No. 462" - } - ] - }, - "layer": [ - { - "transform": [ - { - "calculate": "datum[\"yield_center\"] + datum[\"yield_error\"]", - "as": "upper_yield_center" - }, - { - "calculate": "datum[\"yield_center\"] + datum[\"yield_error2\"]", - "as": "lower_yield_center" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield_center", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield_center", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "yield_center", - "type": "quantitative", - "title": "yield_center" - }, - { - "field": "upper_yield_center", - "type": "quantitative", - "title": "yield_center + yield_error" - }, - { - "field": "lower_yield_center", - "type": "quantitative", - "title": "yield_center + yield_error2" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield_center", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_pre_aggregated_symmetric_error_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_pre_aggregated_symmetric_error_normalized.vl.json index adb9a935ae..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_pre_aggregated_symmetric_error_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_pre_aggregated_symmetric_error_normalized.vl.json @@ -1,65 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - {"yield_error": 7.5522, "yield_center": 32.4, "variety": "Glabron"}, - {"yield_error": 6.9775, "yield_center": 30.96667, "variety": "Manchuria"}, - {"yield_error": 3.9167, "yield_center": 33.966665, "variety": "No. 457"}, - {"yield_error": 11.9732, "yield_center": 30.45, "variety": "No. 462"} - ] - }, - "layer": [ - { - "transform": [ - { - "calculate": "datum[\"yield_center\"] + datum[\"yield_error\"]", - "as": "upper_yield_center" - }, - { - "calculate": "datum[\"yield_center\"] - datum[\"yield_error\"]", - "as": "lower_yield_center" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield_center", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_yield_center", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "yield_center", - "type": "quantitative", - "title": "yield_center" - }, - { - "field": "upper_yield_center", - "type": "quantitative", - "title": "yield_center + yield_error" - }, - { - "field": "lower_yield_center", - "type": "quantitative", - "title": "yield_center - yield_error" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "yield_center", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_pre_aggregated_upper_lower_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_pre_aggregated_upper_lower_normalized.vl.json index 281fe28ec7..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_pre_aggregated_upper_lower_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_pre_aggregated_upper_lower_normalized.vl.json @@ -1,74 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - { - "lower_yield": 23.1311, - "upper_yield": 43.5522, - "center": 32.4, - "variety": "Glabron" - }, - { - "lower_yield": 23.9503, - "upper_yield": 38.9775, - "center": 30.96667, - "variety": "Manchuria" - }, - { - "lower_yield": 24.7778, - "upper_yield": 46.9167, - "center": 33.966665, - "variety": "No. 457" - }, - { - "lower_yield": 21.7823, - "upper_yield": 48.9732, - "center": 30.45, - "variety": "No. 462" - } - ] - }, - "layer": [ - { - "transform": [ - {"calculate": "datum[\"lower_yield\"]", "as": "upper_upper_yield"}, - {"calculate": "datum[\"upper_yield\"]", "as": "lower_upper_yield"} - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_upper_yield", - "type": "quantitative", - "title": "yield", - "scale": {"zero": false} - }, - "x2": {"field": "upper_upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "upper_upper_yield", - "type": "quantitative", - "title": "lower_yield" - }, - { - "field": "lower_upper_yield", - "type": "quantitative", - "title": "upper_yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - }, - { - "mark": {"type": "point", "filled": true, "color": "black"}, - "encoding": { - "x": {"field": "center", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_point_errorbar_stdev_normalized.vl.json b/examples/specs/normalized/layer_point_errorbar_stdev_normalized.vl.json index 85bac9e3de..e69de29bb2 100644 --- a/examples/specs/normalized/layer_point_errorbar_stdev_normalized.vl.json +++ b/examples/specs/normalized/layer_point_errorbar_stdev_normalized.vl.json @@ -1,71 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "layer": [ - { - "mark": {"type": "point", "filled": true}, - "encoding": { - "y": {"field": "variety", "type": "ordinal"}, - "x": { - "aggregate": "mean", - "field": "yield", - "type": "quantitative", - "scale": {"zero": false}, - "title": "Barley Yield" - }, - "color": {"value": "black"} - } - }, - { - "transform": [ - { - "aggregate": [ - {"op": "stdev", "field": "yield", "as": "extent_yield"}, - {"op": "mean", "field": "yield", "as": "center_yield"} - ], - "groupby": ["variety"] - }, - { - "calculate": "datum[\"center_yield\"] + datum[\"extent_yield\"]", - "as": "upper_yield" - }, - { - "calculate": "datum[\"center_yield\"] - datum[\"extent_yield\"]", - "as": "lower_yield" - } - ], - "layer": [ - { - "mark": {"type": "rule", "style": "errorbar-rule"}, - "encoding": { - "x": { - "field": "lower_yield", - "type": "quantitative", - "title": "Barley Yield" - }, - "x2": {"field": "upper_yield", "type": "quantitative"}, - "y": {"field": "variety", "type": "ordinal"}, - "tooltip": [ - { - "field": "center_yield", - "type": "quantitative", - "title": "Mean of yield" - }, - { - "field": "upper_yield", - "type": "quantitative", - "title": "Mean + stdev of yield" - }, - { - "field": "lower_yield", - "type": "quantitative", - "title": "Mean - stdev of yield" - }, - {"field": "variety", "type": "ordinal"} - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_ranged_dot_normalized.vl.json b/examples/specs/normalized/layer_ranged_dot_normalized.vl.json index fb8d329f88..e69de29bb2 100644 --- a/examples/specs/normalized/layer_ranged_dot_normalized.vl.json +++ b/examples/specs/normalized/layer_ranged_dot_normalized.vl.json @@ -1,68 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A ranged dot plot that uses 'layer' to convey changing life expectancy for the five most populous countries (between 1955 and 2000).", - "data": {"url": "data/countries.json"}, - "transform": [ - { - "filter": { - "field": "country", - "oneOf": ["China", "India", "United States", "Indonesia", "Brazil"] - } - }, - {"filter": {"field": "year", "oneOf": [1955, 2000]}} - ], - "layer": [ - { - "mark": "line", - "encoding": { - "x": { - "field": "life_expect", - "type": "quantitative", - "axis": {"title": "Life Expectancy (years)"} - }, - "y": { - "field": "country", - "type": "nominal", - "axis": { - "title": "Country", - "offset": 5, - "ticks": false, - "minExtent": 70, - "domain": false - } - }, - "detail": {"field": "country", "type": "nominal"}, - "color": {"value": "#db646f"} - } - }, - { - "mark": {"type": "point", "filled": true}, - "encoding": { - "x": { - "field": "life_expect", - "type": "quantitative", - "axis": {"title": "Life Expectancy (years)"} - }, - "y": { - "field": "country", - "type": "nominal", - "axis": { - "title": "Country", - "offset": 5, - "ticks": false, - "minExtent": 70, - "domain": false - } - }, - "color": { - "field": "year", - "type": "ordinal", - "scale": {"domain": [1955, 2000], "range": ["#e6959c", "#911a24"]}, - "legend": {"title": "Year"} - }, - "size": {"value": 100}, - "opacity": {"value": 1} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_scatter_errorband_1D_stdev_global_mean_normalized.vl.json b/examples/specs/normalized/layer_scatter_errorband_1D_stdev_global_mean_normalized.vl.json index a72b5590ea..e69de29bb2 100644 --- a/examples/specs/normalized/layer_scatter_errorband_1D_stdev_global_mean_normalized.vl.json +++ b/examples/specs/normalized/layer_scatter_errorband_1D_stdev_global_mean_normalized.vl.json @@ -1,81 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A scatterplot showing horsepower and miles per gallons for various cars.", - "data": {"url": "data/cars.json"}, - "layer": [ - { - "mark": "point", - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Miles_per_Gallon", "type": "quantitative"} - } - }, - { - "transform": [ - { - "aggregate": [ - { - "op": "stdev", - "field": "Miles_per_Gallon", - "as": "extent_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": [] - }, - { - "calculate": "datum[\"center_Miles_per_Gallon\"] + datum[\"extent_Miles_per_Gallon\"]", - "as": "upper_Miles_per_Gallon" - }, - { - "calculate": "datum[\"center_Miles_per_Gallon\"] - datum[\"extent_Miles_per_Gallon\"]", - "as": "lower_Miles_per_Gallon" - } - ], - "layer": [ - { - "mark": {"opacity": 0.2, "type": "rect", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon" - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "tooltip": [ - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean + stdev of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean - stdev of Miles_per_Gallon" - } - ] - } - } - ] - }, - { - "mark": "rule", - "encoding": { - "y": { - "field": "Miles_per_Gallon", - "type": "quantitative", - "aggregate": "mean" - } - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_scatter_errorband_1d_stdev_normalized.vl.json b/examples/specs/normalized/layer_scatter_errorband_1d_stdev_normalized.vl.json index f03bb5d4ed..e69de29bb2 100644 --- a/examples/specs/normalized/layer_scatter_errorband_1d_stdev_normalized.vl.json +++ b/examples/specs/normalized/layer_scatter_errorband_1d_stdev_normalized.vl.json @@ -1,70 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "layer": [ - { - "mark": "point", - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Miles_per_Gallon", "type": "quantitative"} - } - }, - { - "transform": [ - { - "aggregate": [ - { - "op": "stdev", - "field": "Miles_per_Gallon", - "as": "extent_Miles_per_Gallon" - }, - { - "op": "mean", - "field": "Miles_per_Gallon", - "as": "center_Miles_per_Gallon" - } - ], - "groupby": [] - }, - { - "calculate": "datum[\"center_Miles_per_Gallon\"] + datum[\"extent_Miles_per_Gallon\"]", - "as": "upper_Miles_per_Gallon" - }, - { - "calculate": "datum[\"center_Miles_per_Gallon\"] - datum[\"extent_Miles_per_Gallon\"]", - "as": "lower_Miles_per_Gallon" - } - ], - "layer": [ - { - "mark": {"opacity": 0.3, "type": "rect", "style": "errorband-band"}, - "encoding": { - "y": { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Miles per Gallon" - }, - "y2": {"field": "upper_Miles_per_Gallon", "type": "quantitative"}, - "tooltip": [ - { - "field": "center_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean of Miles_per_Gallon" - }, - { - "field": "upper_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean + stdev of Miles_per_Gallon" - }, - { - "field": "lower_Miles_per_Gallon", - "type": "quantitative", - "title": "Mean - stdev of Miles_per_Gallon" - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/layer_text_heatmap_normalized.vl.json b/examples/specs/normalized/layer_text_heatmap_normalized.vl.json index eb5251eb32..e69de29bb2 100644 --- a/examples/specs/normalized/layer_text_heatmap_normalized.vl.json +++ b/examples/specs/normalized/layer_text_heatmap_normalized.vl.json @@ -1,41 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "transform": [ - { - "aggregate": [{"op": "count", "as": "num_cars"}], - "groupby": ["Origin", "Cylinders"] - } - ], - "layer": [ - { - "mark": "rect", - "encoding": { - "y": {"field": "Origin", "type": "ordinal"}, - "x": {"field": "Cylinders", "type": "ordinal"}, - "color": { - "field": "num_cars", - "type": "quantitative", - "title": "Count of Records", - "legend": {"direction": "horizontal", "gradientLength": 120} - } - } - }, - { - "mark": "text", - "encoding": { - "y": {"field": "Origin", "type": "ordinal"}, - "x": {"field": "Cylinders", "type": "ordinal"}, - "text": {"field": "num_cars", "type": "quantitative"}, - "color": { - "condition": {"test": "datum['num_cars'] < 40", "value": "black"}, - "value": "white" - } - } - } - ], - "config": { - "scale": {"bandPaddingInner": 0, "bandPaddingOuter": 0}, - "text": {"baseline": "middle"} - } -} \ No newline at end of file diff --git a/examples/specs/normalized/line_overlay_normalized.vl.json b/examples/specs/normalized/line_overlay_normalized.vl.json index d0b14ed47e..e69de29bb2 100644 --- a/examples/specs/normalized/line_overlay_normalized.vl.json +++ b/examples/specs/normalized/line_overlay_normalized.vl.json @@ -1,23 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Stock prices of 5 Tech Companies over Time.", - "data": {"url": "data/stocks.csv"}, - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"timeUnit": "year", "field": "date", "type": "temporal"}, - "y": {"aggregate": "mean", "field": "price", "type": "quantitative"}, - "color": {"field": "symbol", "type": "nominal"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": {"timeUnit": "year", "field": "date", "type": "temporal"}, - "y": {"aggregate": "mean", "field": "price", "type": "quantitative"}, - "color": {"field": "symbol", "type": "nominal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/line_overlay_stroked_normalized.vl.json b/examples/specs/normalized/line_overlay_stroked_normalized.vl.json index e4fc0144b4..e69de29bb2 100644 --- a/examples/specs/normalized/line_overlay_stroked_normalized.vl.json +++ b/examples/specs/normalized/line_overlay_stroked_normalized.vl.json @@ -1,23 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Stock prices of 5 Tech Companies over Time.", - "data": {"url": "data/stocks.csv"}, - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"timeUnit": "year", "field": "date", "type": "temporal"}, - "y": {"aggregate": "mean", "field": "price", "type": "quantitative"}, - "color": {"field": "symbol", "type": "nominal"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": false, "fill": "white"}, - "encoding": { - "x": {"timeUnit": "year", "field": "date", "type": "temporal"}, - "y": {"aggregate": "mean", "field": "price", "type": "quantitative"}, - "color": {"field": "symbol", "type": "nominal"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/line_shape_overlay_normalized.vl.json b/examples/specs/normalized/line_shape_overlay_normalized.vl.json index 38777a851b..e69de29bb2 100644 --- a/examples/specs/normalized/line_shape_overlay_normalized.vl.json +++ b/examples/specs/normalized/line_shape_overlay_normalized.vl.json @@ -1,23 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Google's stock price over time.", - "data": {"url": "data/stocks.csv"}, - "transform": [{"filter": "datum.symbol==='GOOG'"}], - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": {"field": "date", "type": "temporal"}, - "y": {"field": "price", "type": "quantitative"}, - "shape": {"value": "square"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/line_skip_invalid_mid_overlay_normalized.vl.json b/examples/specs/normalized/line_skip_invalid_mid_overlay_normalized.vl.json index 6fa353b209..e69de29bb2 100644 --- a/examples/specs/normalized/line_skip_invalid_mid_overlay_normalized.vl.json +++ b/examples/specs/normalized/line_skip_invalid_mid_overlay_normalized.vl.json @@ -1,30 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - {"x": 1, "y": 10}, - {"x": 2, "y": 30}, - {"x": 3, "y": null}, - {"x": 4, "y": 15}, - {"x": 5, "y": null}, - {"x": 6, "y": 40}, - {"x": 7, "y": 20} - ] - }, - "layer": [ - { - "mark": "line", - "encoding": { - "x": {"field": "x", "type": "quantitative"}, - "y": {"field": "y", "type": "quantitative"} - } - }, - { - "mark": {"type": "point", "opacity": 1, "filled": true}, - "encoding": { - "x": {"field": "x", "type": "quantitative"}, - "y": {"field": "y", "type": "quantitative"} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/parallel_coordinate_normalized.vl.json b/examples/specs/normalized/parallel_coordinate_normalized.vl.json index 9b41655d2c..e69de29bb2 100644 --- a/examples/specs/normalized/parallel_coordinate_normalized.vl.json +++ b/examples/specs/normalized/parallel_coordinate_normalized.vl.json @@ -1,118 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Though Vega-Lite supports only one scale per axes, one can create a parallel coordinate plot by folding variables, using `joinaggregate` to normalize their values and using ticks and rules to manually create axes.", - "data": {"url": "data/iris.json"}, - "width": 600, - "height": 300, - "transform": [ - {"window": [{"op": "count", "as": "index"}]}, - {"fold": ["petalLength", "petalWidth", "sepalLength", "sepalWidth"]}, - { - "joinaggregate": [ - {"op": "min", "field": "value", "as": "min"}, - {"op": "max", "field": "value", "as": "max"} - ], - "groupby": ["key"] - }, - { - "calculate": "(datum.value - datum.min) / (datum.max-datum.min)", - "as": "norm_val" - }, - {"calculate": "(datum.min + datum.max) / 2", "as": "mid"} - ], - "layer": [ - { - "mark": {"type": "rule", "color": "#ccc"}, - "encoding": { - "detail": {"aggregate": "count", "type": "quantitative"}, - "x": {"type": "nominal", "field": "key"} - } - }, - { - "mark": "line", - "encoding": { - "color": {"type": "nominal", "field": "species"}, - "detail": {"type": "nominal", "field": "index"}, - "opacity": {"value": 0.3}, - "x": {"type": "nominal", "field": "key"}, - "y": {"type": "quantitative", "field": "norm_val", "axis": null}, - "tooltip": [ - {"type": "quantitative", "field": "petalLength"}, - {"type": "quantitative", "field": "petalWidth"}, - {"type": "quantitative", "field": "sepalLength"}, - {"type": "quantitative", "field": "sepalWidth"} - ] - } - }, - { - "layer": [ - { - "mark": {"type": "text", "style": "label"}, - "encoding": { - "x": {"type": "nominal", "field": "key"}, - "y": {"value": 0}, - "text": {"aggregate": "max", "field": "max", "type": "quantitative"} - } - }, - { - "mark": {"type": "tick", "style": "tick", "size": 8, "color": "#ccc"}, - "encoding": { - "x": {"type": "nominal", "field": "key"}, - "y": {"value": 0} - } - } - ] - }, - { - "layer": [ - { - "mark": {"type": "text", "style": "label"}, - "encoding": { - "x": {"type": "nominal", "field": "key"}, - "y": {"value": 150}, - "text": {"aggregate": "min", "field": "mid", "type": "quantitative"} - } - }, - { - "mark": {"type": "tick", "style": "tick", "size": 8, "color": "#ccc"}, - "encoding": { - "x": {"type": "nominal", "field": "key"}, - "y": {"value": 150} - } - } - ] - }, - { - "layer": [ - { - "mark": {"type": "text", "style": "label"}, - "encoding": { - "x": {"type": "nominal", "field": "key"}, - "y": {"value": 300}, - "text": {"aggregate": "min", "field": "min", "type": "quantitative"} - } - }, - { - "mark": {"type": "tick", "style": "tick", "size": 8, "color": "#ccc"}, - "encoding": { - "x": {"type": "nominal", "field": "key"}, - "y": {"value": 300} - } - } - ] - } - ], - "config": { - "axisX": { - "domain": false, - "labelAngle": 0, - "tickColor": "#ccc", - "title": null - }, - "view": {"stroke": null}, - "style": { - "label": {"baseline": "middle", "align": "right", "dx": -5}, - "tick": {"orient": "horizontal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/stacked_area_overlay_normalized.vl.json b/examples/specs/normalized/stacked_area_overlay_normalized.vl.json index 719b6a806a..e69de29bb2 100644 --- a/examples/specs/normalized/stacked_area_overlay_normalized.vl.json +++ b/examples/specs/normalized/stacked_area_overlay_normalized.vl.json @@ -1,41 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/population.json"}, - "transform": [ - {"filter": "datum.year == 2000"}, - {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} - ], - "layer": [ - { - "mark": {"type": "area", "opacity": 0.7}, - "encoding": { - "y": {"aggregate": "sum", "field": "people", "type": "quantitative"}, - "x": {"field": "age", "type": "ordinal"}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - }, - "opacity": {"value": 0.7} - } - }, - { - "mark": {"type": "line"}, - "encoding": { - "y": { - "aggregate": "sum", - "field": "people", - "type": "quantitative", - "stack": "zero" - }, - "x": {"field": "age", "type": "ordinal"}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - }, - "opacity": {"value": 0.7} - } - } - ] -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_anscombe_normalized.vl.json b/examples/specs/normalized/trellis_anscombe_normalized.vl.json index 4c135f48ca..e69de29bb2 100644 --- a/examples/specs/normalized/trellis_anscombe_normalized.vl.json +++ b/examples/specs/normalized/trellis_anscombe_normalized.vl.json @@ -1,14 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Anscombe's Quartet", - "data": {"url": "data/anscombe.json"}, - "facet": {"column": {"field": "Series", "type": "nominal"}}, - "spec": { - "mark": "circle", - "encoding": { - "x": {"field": "X", "type": "quantitative", "scale": {"zero": false}}, - "y": {"field": "Y", "type": "quantitative", "scale": {"zero": false}}, - "opacity": {"value": 1} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_area_normalized.vl.json b/examples/specs/normalized/trellis_area_normalized.vl.json index 25f6f34ad8..e69de29bb2 100644 --- a/examples/specs/normalized/trellis_area_normalized.vl.json +++ b/examples/specs/normalized/trellis_area_normalized.vl.json @@ -1,27 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Stock prices of four large companies as a small multiples of area charts.", - "transform": [{"filter": "datum.symbol !== 'GOOG'"}], - "data": {"url": "data/stocks.csv"}, - "facet": { - "row": {"field": "symbol", "type": "nominal", "header": {"title": "Symbol"}} - }, - "spec": { - "mark": "area", - "width": 300, - "height": 40, - "encoding": { - "x": { - "field": "date", - "type": "temporal", - "axis": {"title": "Time", "grid": false} - }, - "y": { - "field": "price", - "type": "quantitative", - "axis": {"title": "Price", "grid": false} - }, - "color": {"field": "symbol", "type": "nominal", "legend": null} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_area_sort_array_normalized.vl.json b/examples/specs/normalized/trellis_area_sort_array_normalized.vl.json index 9de89dad29..e69de29bb2 100644 --- a/examples/specs/normalized/trellis_area_sort_array_normalized.vl.json +++ b/examples/specs/normalized/trellis_area_sort_array_normalized.vl.json @@ -1,32 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Stock prices of four large companies as a small multiples of area charts.", - "transform": [{"filter": "datum.symbol !== 'GOOG'"}], - "data": {"url": "data/stocks.csv"}, - "facet": { - "row": { - "field": "symbol", - "type": "nominal", - "header": {"title": "Symbol"}, - "sort": ["MSFT", "AAPL", "IBM", "AMZN"] - } - }, - "spec": { - "mark": "area", - "width": 300, - "height": 40, - "encoding": { - "x": { - "field": "date", - "type": "temporal", - "axis": {"format": "%Y", "title": "Time", "grid": false} - }, - "y": { - "field": "price", - "type": "quantitative", - "axis": {"title": "Price", "grid": false} - }, - "color": {"field": "symbol", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_bar_histogram_label_rotated_normalized.vl.json b/examples/specs/normalized/trellis_bar_histogram_label_rotated_normalized.vl.json index 576c6d55a8..e69de29bb2 100644 --- a/examples/specs/normalized/trellis_bar_histogram_label_rotated_normalized.vl.json +++ b/examples/specs/normalized/trellis_bar_histogram_label_rotated_normalized.vl.json @@ -1,18 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "facet": { - "row": {"field": "Origin", "type": "nominal", "header": {"labelAngle": -90}} - }, - "spec": { - "mark": "bar", - "encoding": { - "x": { - "bin": {"maxbins": 15}, - "field": "Horsepower", - "type": "quantitative" - }, - "y": {"aggregate": "count", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_bar_histogram_normalized.vl.json b/examples/specs/normalized/trellis_bar_histogram_normalized.vl.json index cf38fb4c68..e69de29bb2 100644 --- a/examples/specs/normalized/trellis_bar_histogram_normalized.vl.json +++ b/examples/specs/normalized/trellis_bar_histogram_normalized.vl.json @@ -1,16 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "facet": {"row": {"field": "Origin", "type": "nominal"}}, - "spec": { - "mark": "bar", - "encoding": { - "x": { - "bin": {"maxbins": 15}, - "field": "Horsepower", - "type": "quantitative" - }, - "y": {"aggregate": "count", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_bar_normalized.vl.json b/examples/specs/normalized/trellis_bar_normalized.vl.json index 9736e9eee9..e69de29bb2 100644 --- a/examples/specs/normalized/trellis_bar_normalized.vl.json +++ b/examples/specs/normalized/trellis_bar_normalized.vl.json @@ -1,28 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A trellis bar chart showing the US population distribution of age groups and gender in 2000.", - "data": {"url": "data/population.json"}, - "transform": [ - {"filter": "datum.year == 2000"}, - {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} - ], - "facet": {"row": {"field": "gender", "type": "nominal"}}, - "spec": { - "mark": "bar", - "width": {"step": 17}, - "encoding": { - "y": { - "aggregate": "sum", - "field": "people", - "type": "quantitative", - "axis": {"title": "population"} - }, - "x": {"field": "age", "type": "ordinal"}, - "color": { - "field": "gender", - "type": "nominal", - "scale": {"range": ["#EA98D2", "#659CCA"]} - } - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_barley_independent_normalized.vl.json b/examples/specs/normalized/trellis_barley_independent_normalized.vl.json deleted file mode 100644 index 172220e325..0000000000 --- a/examples/specs/normalized/trellis_barley_independent_normalized.vl.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "name": "trellis_barley", - "description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.", - "data": {"url": "data/barley.json"}, - "columns": 2, - "resolve": {"axis": {"x": "independent", "y": "independent"}}, - "facet": { - "field": "site", - "type": "ordinal", - "sort": {"op": "median", "field": "yield"} - }, - "spec": { - "mark": "point", - "height": {"step": 12}, - "encoding": { - "x": { - "aggregate": "median", - "field": "yield", - "type": "quantitative", - "scale": {"zero": false} - }, - "y": { - "field": "variety", - "type": "ordinal", - "sort": {"encoding": "x", "order": "descending"} - }, - "color": {"field": "year", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_barley_layer_median_normalized.vl.json b/examples/specs/normalized/trellis_barley_layer_median_normalized.vl.json deleted file mode 100644 index 90fdecc142..0000000000 --- a/examples/specs/normalized/trellis_barley_layer_median_normalized.vl.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "name": "trellis_barley", - "description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.", - "data": {"url": "data/barley.json"}, - "facet": { - "row": { - "field": "site", - "type": "ordinal", - "sort": {"op": "median", "field": "yield"} - } - }, - "spec": { - "layer": [ - { - "height": {"step": 12}, - "mark": "point", - "encoding": { - "x": { - "aggregate": "median", - "field": "yield", - "type": "quantitative", - "scale": {"zero": false} - }, - "y": { - "field": "variety", - "type": "ordinal", - "sort": {"encoding": "x", "order": "descending"} - }, - "color": {"field": "year", "type": "nominal"} - } - }, - { - "mark": "rule", - "encoding": { - "x": { - "aggregate": "median", - "field": "yield", - "type": "quantitative", - "scale": {"zero": false} - } - } - } - ] - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_barley_normalized.vl.json b/examples/specs/normalized/trellis_barley_normalized.vl.json deleted file mode 100644 index 21ff0f4478..0000000000 --- a/examples/specs/normalized/trellis_barley_normalized.vl.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "name": "trellis_barley", - "description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.", - "data": {"url": "data/barley.json"}, - "columns": 2, - "facet": { - "field": "site", - "type": "ordinal", - "sort": {"op": "median", "field": "yield"} - }, - "spec": { - "mark": "point", - "height": {"step": 12}, - "encoding": { - "x": { - "aggregate": "median", - "field": "yield", - "type": "quantitative", - "scale": {"zero": false} - }, - "y": { - "field": "variety", - "type": "ordinal", - "sort": {"encoding": "x", "order": "descending"} - }, - "color": {"field": "year", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_column_year_normalized.vl.json b/examples/specs/normalized/trellis_column_year_normalized.vl.json deleted file mode 100644 index 6b6d64512c..0000000000 --- a/examples/specs/normalized/trellis_column_year_normalized.vl.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Stock price mean per quarter broken down by years.", - "data": {"url": "data/stocks.csv"}, - "facet": {"column": {"field": "date", "type": "ordinal", "timeUnit": "year"}}, - "spec": { - "mark": "line", - "encoding": { - "x": {"timeUnit": "quarter", "field": "date", "type": "ordinal"}, - "y": {"field": "price", "type": "quantitative", "aggregate": "mean"}, - "color": {"field": "symbol", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_line_quarter_normalized.vl.json b/examples/specs/normalized/trellis_line_quarter_normalized.vl.json deleted file mode 100644 index 36fbfb42b7..0000000000 --- a/examples/specs/normalized/trellis_line_quarter_normalized.vl.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Stock price mean per quarter broken down by years.", - "data": {"url": "data/stocks.csv"}, - "facet": {"column": {"field": "date", "type": "ordinal", "timeUnit": "year"}}, - "spec": { - "mark": "point", - "encoding": { - "x": {"timeUnit": "quarter", "field": "date", "type": "ordinal"}, - "y": {"field": "price", "type": "quantitative", "aggregate": "mean"}, - "color": {"field": "symbol", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_row_column_normalized.vl.json b/examples/specs/normalized/trellis_row_column_normalized.vl.json deleted file mode 100644 index 5be2b1fd16..0000000000 --- a/examples/specs/normalized/trellis_row_column_normalized.vl.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/cars.json"}, - "facet": { - "row": {"field": "Cylinders", "type": "ordinal"}, - "column": {"field": "Origin", "type": "ordinal"} - }, - "spec": { - "mark": "point", - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Miles_per_Gallon", "type": "quantitative"}, - "color": {"field": "Cylinders", "type": "nominal"}, - "shape": {"field": "Origin", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_scatter_binned_row_normalized.vl.json b/examples/specs/normalized/trellis_scatter_binned_row_normalized.vl.json deleted file mode 100644 index 7c7da1c054..0000000000 --- a/examples/specs/normalized/trellis_scatter_binned_row_normalized.vl.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "A trellis scatterplot showing Horsepower and Miles per gallons, faceted by binned values of Acceleration.", - "data": {"url": "data/cars.json"}, - "facet": { - "row": {"field": "Acceleration", "type": "quantitative", "bin": true} - }, - "spec": { - "mark": "point", - "encoding": { - "x": {"field": "Horsepower", "type": "quantitative"}, - "y": {"field": "Miles_per_Gallon", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_scatter_normalized.vl.json b/examples/specs/normalized/trellis_scatter_normalized.vl.json deleted file mode 100644 index 7f178d135c..0000000000 --- a/examples/specs/normalized/trellis_scatter_normalized.vl.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/movies.json"}, - "columns": 2, - "facet": {"field": "MPAA_Rating", "type": "ordinal"}, - "spec": { - "mark": "point", - "encoding": { - "x": {"field": "Worldwide_Gross", "type": "quantitative"}, - "y": {"field": "US_DVD_Sales", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_scatter_small_normalized.vl.json b/examples/specs/normalized/trellis_scatter_small_normalized.vl.json deleted file mode 100644 index 10845c9141..0000000000 --- a/examples/specs/normalized/trellis_scatter_small_normalized.vl.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/movies.json"}, - "facet": {"column": {"field": "MPAA_Rating", "type": "ordinal"}}, - "spec": { - "mark": "point", - "width": 75, - "height": 75, - "encoding": { - "x": {"field": "Worldwide_Gross", "type": "quantitative"}, - "y": {"field": "US_DVD_Sales", "type": "quantitative"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_selections_normalized.vl.json b/examples/specs/normalized/trellis_selections_normalized.vl.json deleted file mode 100644 index cf233e6c96..0000000000 --- a/examples/specs/normalized/trellis_selections_normalized.vl.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "description": "Anscombe's Quartet", - "data": {"url": "data/anscombe.json"}, - "facet": {"column": {"field": "Series", "type": "nominal"}}, - "spec": { - "mark": "circle", - "encoding": { - "x": {"field": "X", "type": "quantitative", "scale": {"zero": false}}, - "y": {"field": "Y", "type": "quantitative", "scale": {"zero": false}}, - "size": {"value": 100, "condition": {"selection": "brush", "value": 250}}, - "color": { - "value": "steelblue", - "condition": {"selection": "xenc", "value": "red"} - }, - "opacity": {"value": 1} - }, - "selection": { - "brush": { - "type": "interval", - "resolve": "intersect", - "encodings": ["x"], - "on": "[mousedown[event.shiftKey], mouseup] > mousemove", - "translate": "[mousedown[event.shiftKey], mouseup] > mousemove" - }, - "grid": { - "type": "interval", - "resolve": "global", - "bind": "scales", - "translate": "[mousedown[!event.shiftKey], mouseup] > mousemove" - }, - "xenc": { - "type": "single", - "resolve": "global", - "on": "mouseover", - "nearest": true, - "fields": ["X"], - "bind": {"input": "number"} - } - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/trellis_stacked_bar_normalized.vl.json b/examples/specs/normalized/trellis_stacked_bar_normalized.vl.json deleted file mode 100644 index 572fb80412..0000000000 --- a/examples/specs/normalized/trellis_stacked_bar_normalized.vl.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": {"url": "data/barley.json"}, - "facet": {"column": {"field": "year", "type": "ordinal"}}, - "spec": { - "mark": "bar", - "encoding": { - "x": {"field": "yield", "type": "quantitative", "aggregate": "sum"}, - "y": {"field": "variety", "type": "nominal"}, - "color": {"field": "site", "type": "nominal"} - } - } -} \ No newline at end of file diff --git a/examples/specs/normalized/waterfall_chart_normalized.vl.json b/examples/specs/normalized/waterfall_chart_normalized.vl.json deleted file mode 100644 index 0b7bfb9a0f..0000000000 --- a/examples/specs/normalized/waterfall_chart_normalized.vl.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v3.json", - "data": { - "values": [ - {"label": "Begin", "amount": 4000}, - {"label": "Jan", "amount": 1707}, - {"label": "Feb", "amount": -1425}, - {"label": "Mar", "amount": -1030}, - {"label": "Apr", "amount": 1812}, - {"label": "May", "amount": -1067}, - {"label": "Jun", "amount": -1481}, - {"label": "Jul", "amount": 1228}, - {"label": "Aug", "amount": 1176}, - {"label": "Sep", "amount": 1146}, - {"label": "Oct", "amount": 1205}, - {"label": "Nov", "amount": -1388}, - {"label": "Dec", "amount": 1492}, - {"label": "End", "amount": 0} - ] - }, - "width": 800, - "height": 450, - "transform": [ - {"window": [{"op": "sum", "field": "amount", "as": "sum"}]}, - {"window": [{"op": "lead", "field": "label", "as": "lead"}]}, - { - "calculate": "datum.lead === null ? datum.label : datum.lead", - "as": "lead" - }, - { - "calculate": "datum.label === 'End' ? 0 : datum.sum - datum.amount", - "as": "previous_sum" - }, - { - "calculate": "datum.label === 'End' ? datum.sum : datum.amount", - "as": "amount" - }, - { - "calculate": "(datum.label !== 'Begin' && datum.label !== 'End' && datum.amount > 0 ? '+' : '') + datum.amount", - "as": "text_amount" - }, - {"calculate": "(datum.sum + datum.previous_sum) / 2", "as": "center"}, - { - "calculate": "datum.sum < datum.previous_sum ? datum.sum : ''", - "as": "sum_dec" - }, - { - "calculate": "datum.sum > datum.previous_sum ? datum.sum : ''", - "as": "sum_inc" - } - ], - "layer": [ - { - "mark": {"type": "bar", "size": 45}, - "encoding": { - "x": { - "field": "label", - "type": "ordinal", - "sort": null, - "axis": {"labelAngle": 0, "title": "Months"} - }, - "y": { - "field": "previous_sum", - "type": "quantitative", - "title": "Amount" - }, - "y2": {"field": "sum"}, - "color": { - "condition": [ - { - "test": "datum.label === 'Begin' || datum.label === 'End'", - "value": "#f7e0b6" - }, - {"test": "datum.sum < datum.previous_sum", "value": "#f78a64"} - ], - "value": "#93c4aa" - } - } - }, - { - "mark": { - "type": "rule", - "color": "#404040", - "opacity": 1, - "strokeWidth": 2, - "xOffset": -22.5, - "x2Offset": 22.5 - }, - "encoding": { - "x": { - "field": "label", - "type": "ordinal", - "sort": null, - "axis": {"labelAngle": 0, "title": "Months"} - }, - "x2": {"field": "lead"}, - "y": {"field": "sum", "type": "quantitative"} - } - }, - { - "mark": {"type": "text", "dy": -4, "baseline": "bottom"}, - "encoding": { - "x": { - "field": "label", - "type": "ordinal", - "sort": null, - "axis": {"labelAngle": 0, "title": "Months"} - }, - "y": {"field": "sum_inc", "type": "quantitative"}, - "text": {"field": "sum_inc", "type": "nominal"} - } - }, - { - "mark": {"type": "text", "dy": 4, "baseline": "top"}, - "encoding": { - "x": { - "field": "label", - "type": "ordinal", - "sort": null, - "axis": {"labelAngle": 0, "title": "Months"} - }, - "y": {"field": "sum_dec", "type": "quantitative"}, - "text": {"field": "sum_dec", "type": "nominal"} - } - }, - { - "mark": {"type": "text", "fontWeight": "bold", "baseline": "middle"}, - "encoding": { - "x": { - "field": "label", - "type": "ordinal", - "sort": null, - "axis": {"labelAngle": 0, "title": "Months"} - }, - "y": {"field": "center", "type": "quantitative"}, - "text": {"field": "text_amount", "type": "nominal"}, - "color": { - "condition": [ - { - "test": "datum.label === 'Begin' || datum.label === 'End'", - "value": "#725a30" - } - ], - "value": "white" - } - } - } - ], - "config": {"text": {"fontWeight": "bold", "color": "#404040"}} -} \ No newline at end of file diff --git a/examples/specs/trellis_barley.vl.json b/examples/specs/trellis_barley.vl.json index 5e8599c1c0..8c8bd2678a 100644 --- a/examples/specs/trellis_barley.vl.json +++ b/examples/specs/trellis_barley.vl.json @@ -21,7 +21,12 @@ "y": { "field": "variety", "type": "ordinal", +<<<<<<< HEAD "sort": {"encoding": "x", "order": "descending"} +======= + "sort": "-x", + "scale": {"rangeStep": 12} +>>>>>>> c21f90e9e... feat: Add a short-form for sort by encoding (e.g., `sort: "x"`, `sort: "-x"`) }, "color": {"field": "year", "type": "nominal"} } diff --git a/examples/specs/trellis_barley_independent.vl.json b/examples/specs/trellis_barley_independent.vl.json index bbf56a0121..14a5952f6e 100644 --- a/examples/specs/trellis_barley_independent.vl.json +++ b/examples/specs/trellis_barley_independent.vl.json @@ -21,7 +21,12 @@ "y": { "field": "variety", "type": "ordinal", +<<<<<<< HEAD "sort": {"encoding": "x", "order": "descending"} +======= + "sort": "-x", + "scale": {"rangeStep": 12} +>>>>>>> c21f90e9e... feat: Add a short-form for sort by encoding (e.g., `sort: "x"`, `sort: "-x"`) }, "color": {"field": "year", "type": "nominal"} }, diff --git a/examples/specs/trellis_barley_layer_median.vl.json b/examples/specs/trellis_barley_layer_median.vl.json index d27973dcc4..523386daff 100644 --- a/examples/specs/trellis_barley_layer_median.vl.json +++ b/examples/specs/trellis_barley_layer_median.vl.json @@ -27,7 +27,12 @@ "y": { "field": "variety", "type": "ordinal", +<<<<<<< HEAD "sort": {"encoding": "x", "order": "descending"} +======= + "sort": "-x", + "scale": {"rangeStep": 12} +>>>>>>> c21f90e9e... feat: Add a short-form for sort by encoding (e.g., `sort: "x"`, `sort: "-x"`) }, "color": {"field": "year", "type": "nominal"} } diff --git a/site/docs/encoding/sort.md b/site/docs/encoding/sort.md index 683fe764ee..85b86145bd 100644 --- a/site/docs/encoding/sort.md +++ b/site/docs/encoding/sort.md @@ -61,14 +61,18 @@ To order the data by the values' natural order in Javascript (e.g.,`"a"` < `"b"` ### Sort by Another Encoding Channel -To sort data by another encoding channel, the `sort` property can be an object with the `encoding` property: +To sort data by another encoding channel, the `sort` property can be an encoding channel name to sort by (e.g., `"x"` or `"y"`) with an optional minus prefix for descending sort (e.g., `"-x"` to sort by x-field, descending). -{% include table.html props="encoding,order" source="SortByEncoding" %} - -For example, the following plot sorts the y-values by the x-values. +For example, the following plot sorts the y-values by the x-values (in descending order).
+This is equivalent to using an object with the `encoding` and optional `"order"` property: + +{% include table.html props="encoding,order" source="SortByEncoding" %} + +For example, `"sort": "-x"` is equivalent to `"sort": {"encoding": "x", "order": "descending"}`. + ### Sort by a Different Field {:#sort-field} diff --git a/src/channel.ts b/src/channel.ts index 2927dfdd98..09b346bd73 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -148,8 +148,8 @@ const CHANNEL_INDEX = { export const CHANNELS = keys(CHANNEL_INDEX); -const {order: _o, detail: _d, ...SINGLE_DEF_CHANNEL_INDEX} = CHANNEL_INDEX; -const {order: _o1, detail: _d1, row: _r, column: _c, facet: _f, ...SINGLE_DEF_UNIT_CHANNEL_INDEX} = CHANNEL_INDEX; +const {order: _o, detail: _d, tooltip: _tt1, ...SINGLE_DEF_CHANNEL_INDEX} = CHANNEL_INDEX; +const {row: _r, column: _c, facet: _f, ...SINGLE_DEF_UNIT_CHANNEL_INDEX} = SINGLE_DEF_CHANNEL_INDEX; /** * Channels that cannot have an array of channelDef. * model.fieldDef, getFieldDef only work for these channels. diff --git a/src/channeldef.ts b/src/channeldef.ts index 9c41793043..83de74e568 100644 --- a/src/channeldef.ts +++ b/src/channeldef.ts @@ -14,7 +14,7 @@ import * as log from './log'; import {LogicalOperand} from './logical'; import {Predicate} from './predicate'; import {Scale} from './scale'; -import {Sort, SortOrder} from './sort'; +import {isSortByChannel, Sort, SortOrder} from './sort'; import {isFacetFieldDef} from './spec/facet'; import {StackOffset} from './stack'; import { @@ -266,14 +266,14 @@ export interface SortableFieldDef< * * For discrete fields, `sort` can be one of the following: * - `"ascending"` or `"descending"` -- for sorting by the values' natural order in Javascript. - * - [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.) + * - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `"x"` or `"y"`) with an optional minus prefix for descending sort (e.g., `"-x"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `"sort": "-x"` is equivalent to `"sort": {"encoding": "x", "order": "descending"}`. * - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. * - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `"month"` and `"day"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `"Mon"`, `"Tue"`). * - `null` indicating no sort. * * __Default value:__ `"ascending"` * - * __Note:__ `null` is not supported for `row` and `column`. + * __Note:__ `null` and sorting by another channel is not supported for `row` and `column`. * * __See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation. */ @@ -745,7 +745,7 @@ export function normalize(channelDef: ChannelDef, channel: Channel): ChannelDef< return channelDef; } export function normalizeFieldDef(fieldDef: FieldDef, channel: Channel) { - const {aggregate, timeUnit, bin} = fieldDef; + const {aggregate, timeUnit, bin, field} = fieldDef; // Drop invalid aggregate if (aggregate && !isAggregateOp(aggregate) && !isArgmaxDef(aggregate) && !isArgminDef(aggregate)) { const {aggregate: _, ...fieldDefWithoutAggregate} = fieldDef; @@ -761,6 +761,13 @@ export function normalizeFieldDef(fieldDef: FieldDef, channel: Channel) }; } + if (field) { + fieldDef = { + ...fieldDef, + field: `${fieldDef.field}` + }; + } + // Normalize bin if (isBinning(bin)) { fieldDef = { @@ -810,10 +817,25 @@ export function normalizeFieldDef(fieldDef: FieldDef, channel: Channel) log.warn(warning); } } - return { - ...fieldDef, - ...(fieldDef.field !== undefined ? {field: `${fieldDef.field}`} : {}) - }; + + if (isSortableFieldDef(fieldDef) && isString(fieldDef.sort)) { + const {sort} = fieldDef; + if (isSortByChannel(sort)) { + return { + ...fieldDef, + sort: {encoding: sort} + }; + } + const sub = sort.substr(1); + if (sort.charAt(0) === '-' && isSortByChannel(sub)) { + return { + ...fieldDef, + sort: {encoding: sub, order: 'descending'} + }; + } + } + + return fieldDef; } export function normalizeBin(bin: BinParams | boolean | 'binned', channel: Channel) { diff --git a/src/compile/legend/properties.ts b/src/compile/legend/properties.ts index da1b7dbd68..6cdaf0aa07 100644 --- a/src/compile/legend/properties.ts +++ b/src/compile/legend/properties.ts @@ -43,6 +43,7 @@ export function defaultSymbolType( switch (mark) { case 'bar': case 'rect': + case 'image': case 'square': return 'square'; case 'line': diff --git a/src/sort.ts b/src/sort.ts index 79659ec8bc..e6631b94d5 100644 --- a/src/sort.ts +++ b/src/sort.ts @@ -1,8 +1,8 @@ import {AggregateOp} from 'vega'; import {isArray} from 'vega-util'; -import {SingleDefUnitChannel} from './channel'; import {FieldName} from './channeldef'; import {DateTime} from './datetime'; +import {Flag} from './util'; export type SortOrder = 'ascending' | 'descending'; @@ -60,7 +60,7 @@ export interface SortByEncoding { /** * The [encoding channel](https://vega.github.io/vega-lite/docs/encoding.html#channels) to sort by (e.g., `"x"`, `"y"`) */ - encoding: SingleDefUnitChannel; + encoding: SortByChannel; /** * The sort order. One of `"ascending"` (default), `"descending"`, or `null` (no not sort). @@ -70,7 +70,56 @@ export interface SortByEncoding { export type SortArray = number[] | string[] | boolean[] | DateTime[]; -export type Sort = SortArray | SortOrder | EncodingSortField | SortByEncoding | null; +export type SortByChannel = + | 'x' + | 'y' + | 'color' + | 'fill' + | 'stroke' + | 'strokeWidth' + | 'size' + | 'shape' + | 'fillOpacity' + | 'strokeOpacity' + | 'opacity' + | 'text'; + +const SORT_BY_CHANNEL_INDEX: Flag = { + x: 1, + y: 1, + color: 1, + fill: 1, + stroke: 1, + strokeWidth: 1, + size: 1, + shape: 1, + fillOpacity: 1, + strokeOpacity: 1, + opacity: 1, + text: 1 +}; + +export function isSortByChannel(c: string): c is SortByChannel { + return !!SORT_BY_CHANNEL_INDEX[c]; +} + +export type SortByChannelDesc = + | '-x' + | '-y' + | '-color' + | '-fill' + | '-stroke' + | '-strokeWidth' + | '-size' + | '-shape' + | '-fillOpacity' + | '-strokeOpacity' + | '-opacity' + | '-text'; + +export type AllSortString = SortOrder | SortByChannel | SortByChannelDesc; + +export type Sort = SortArray | AllSortString | EncodingSortField | SortByEncoding | null; export function isSortByEncoding(sort: Sort): sort is SortByEncoding { return !!sort && !!sort['encoding']; diff --git a/test/channel.test.ts b/test/channel.test.ts index e1a1889803..f06fd49a0b 100644 --- a/test/channel.test.ts +++ b/test/channel.test.ts @@ -18,7 +18,7 @@ describe('channel', () => { describe('SINGLE_DEF_CHANNELS', () => { it('should be CHANNELS without detail and order', () => { - expect(SINGLE_DEF_CHANNELS).toEqual(without(CHANNELS, ['detail', 'order'])); + expect(SINGLE_DEF_CHANNELS).toEqual(without(CHANNELS, ['detail', 'order', 'tooltip'])); }); }); diff --git a/test/compile/scale/domain.test.ts b/test/compile/scale/domain.test.ts index f043c84437..4e7d1dbdfe 100644 --- a/test/compile/scale/domain.test.ts +++ b/test/compile/scale/domain.test.ts @@ -389,6 +389,62 @@ describe('compile/scale', () => { ]); }); + it('should return the correct domain for month O when the field is sorted by another encoding', () => { + const model = parseUnitModel({ + mark: 'bar', + encoding: { + x: { + timeUnit: 'month', + field: 'date', + type: 'ordinal', + sort: 'y' + }, + y: { + aggregate: 'median', + field: 'precipitation', + type: 'quantitative' + } + } + }); + const _domain = testParseDomainForChannel(model, 'x'); + + expect(_domain).toEqual([ + { + data: 'raw', + field: 'month_date', + sort: {op: 'median', field: 'precipitation'} + } + ]); + }); + + it('should return the correct domain for month O when the field is sorted by another encoding (desc)', () => { + const model = parseUnitModel({ + mark: 'bar', + encoding: { + x: { + timeUnit: 'month', + field: 'date', + type: 'ordinal', + sort: '-y' + }, + y: { + aggregate: 'median', + field: 'precipitation', + type: 'quantitative' + } + } + }); + const _domain = testParseDomainForChannel(model, 'x'); + + expect(_domain).toEqual([ + { + data: 'raw', + field: 'month_date', + sort: {op: 'median', field: 'precipitation', order: 'descending'} + } + ]); + }); + it('should return the correct domain for month O when specify sort does not have op and the plot is stacked', () => { const sortDef: EncodingSortField = {field: 'precipitation', order: 'descending'}; const model = parseUnitModel({