diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index fca40a25b6..b7ee57aa85 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -513,15 +513,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -3383,15 +3383,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -4613,15 +4613,15 @@ "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "median": { "anyOf": [ @@ -15059,15 +15059,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -16214,15 +16214,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -17058,15 +17058,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -17640,6 +17640,16 @@ ], "type": "object" }, + "MarkInvalidDataMode": { + "enum": [ + "filter", + "break-paths-filter-domains", + "break-paths-show-domains", + "break-paths-show-path-domains", + "show" + ], + "type": "string" + }, "MarkPropDef<(Gradient|string|null)>": { "anyOf": [ { @@ -18596,15 +18606,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -20892,15 +20902,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ @@ -22102,13 +22112,17 @@ "description": "Default padding for continuous x/y scales.\n\n__Default:__ The bar width for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; `0` otherwise.", "minimum": 0 }, + "invalid": { + "$ref": "#/definitions/ScaleInvalidDataConfig", + "description": "An object that defines scale outputs per channel for invalid values (nulls and NaNs on a continuous scale).\n- The keys in this object are the scale channels.\n- The values is either `\"zero-or-min\"` (use zero if the scale includes zero or min value otherwise) or a value definition `{value: ...}`.\n\n_Example:_ Setting this `config.scale.invalid` property to `{color: {value: '#aaa'}}` will make the visualization color all invalid values with '#aaa'.\n\nSee [https://vega.github.io/vega-lite/docs/invalid-data.html](Invalid Data Docs) for more details." + }, "maxBandSize": { "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the axis's size (width or height) - 1.", "minimum": 0, "type": "number" }, "maxFontSize": { - "description": "The default max value for mapping quantitative fields to text's size/fontSize.\n\n__Default value:__ `40`", + "description": "The default max value for mapping quantitative fields to text's size/fontSize scale.\n\n__Default value:__ `40`", "minimum": 0, "type": "number" }, @@ -22134,7 +22148,7 @@ "type": "number" }, "minFontSize": { - "description": "The default min value for mapping quantitative fields to tick's size/fontSize scale.\n\n__Default value:__ `8`", + "description": "The default min value for mapping quantitative fields to text's size/fontSize scale.\n\n__Default value:__ `8`", "minimum": 0, "type": "number" }, @@ -22411,6 +22425,486 @@ ], "type": "object" }, + "ScaleInvalidDataConfig": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"angle\">" + }, + "color": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"color\">" + }, + "fill": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"fill\">" + }, + "fillOpacity": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"fillOpacity\">" + }, + "opacity": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"opacity\">" + }, + "radius": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"radius\">" + }, + "shape": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"shape\">" + }, + "size": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"size\">" + }, + "stroke": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"stroke\">" + }, + "strokeDash": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"strokeDash\">" + }, + "strokeOpacity": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"strokeOpacity\">" + }, + "strokeWidth": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"strokeWidth\">" + }, + "theta": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"theta\">" + }, + "x": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"x\">" + }, + "xOffset": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"xOffset\">" + }, + "y": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"y\">" + }, + "yOffset": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"yOffset\">" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAs<\"angle\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"angle\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"color\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"color\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"fill\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"fill\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"fillOpacity\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"fillOpacity\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"opacity\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"opacity\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"radius\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"radius\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"shape\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"shape\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"size\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"size\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"stroke\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"stroke\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"strokeDash\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"strokeDash\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"strokeOpacity\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"strokeOpacity\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"strokeWidth\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"strokeWidth\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"theta\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"theta\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"x\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"x\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"xOffset\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"xOffset\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"y\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"y\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAs<\"yOffset\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"yOffset\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, + "ScaleInvalidDataShowAsValue<\"angle\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"color\">": { + "additionalProperties": false, + "properties": { + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"fill\">": { + "additionalProperties": false, + "properties": { + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"fillOpacity\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"opacity\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"radius\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"shape\">": { + "additionalProperties": false, + "properties": { + "value": { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"size\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"stroke\">": { + "additionalProperties": false, + "properties": { + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"strokeDash\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"strokeOpacity\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"strokeWidth\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"theta\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"x\">": { + "additionalProperties": false, + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"xOffset\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "Offset for x-position.", + "type": "number" + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"y\">": { + "additionalProperties": false, + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "ScaleInvalidDataShowAsValue<\"yOffset\">": { + "additionalProperties": false, + "properties": { + "value": { + "description": "Offset for y-position.", + "type": "number" + } + }, + "type": "object" + }, "ScaleResolveMap": { "additionalProperties": false, "properties": { @@ -28111,15 +28605,15 @@ ] }, "invalid": { - "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", - "enum": [ - "filter", - null + "anyOf": [ + { + "$ref": "#/definitions/MarkInvalidDataMode" + }, + { + "type": "null" + } ], - "type": [ - "string", - "null" - ] + "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ diff --git a/examples/compiled/area_invalid_null.vg.json b/examples/compiled/area_invalid_null.vg.json index d57ccf4e83..bf8eeebdbb 100644 --- a/examples/compiled/area_invalid_null.vg.json +++ b/examples/compiled/area_invalid_null.vg.json @@ -61,7 +61,7 @@ "x": [ { "test": "!isValid(datum[\"x\"]) || !isFinite(+datum[\"x\"])", - "value": 0 + "signal": "scale('x', inrange(0, domain('x')) ? 0 : domain('x')[0])" }, {"scale": "x", "field": "x"} ], diff --git a/examples/compiled/bar_distinct.vg.json b/examples/compiled/bar_distinct.vg.json index 17721c5355..2cb76e2371 100644 --- a/examples/compiled/bar_distinct.vg.json +++ b/examples/compiled/bar_distinct.vg.json @@ -16,10 +16,6 @@ "ops": ["distinct"], "fields": ["Name"], "as": ["distinct_Name"] - }, - { - "type": "filter", - "expr": "isValid(datum[\"distinct_Name\"]) && isFinite(+datum[\"distinct_Name\"])" } ] } diff --git a/examples/compiled/bar_grouped_repeated.vg.json b/examples/compiled/bar_grouped_repeated.vg.json index 8174ba5b62..eda23bb99d 100644 --- a/examples/compiled/bar_grouped_repeated.vg.json +++ b/examples/compiled/bar_grouped_repeated.vg.json @@ -52,7 +52,8 @@ "y": [ { "test": "!isValid(datum[\"sum_Worldwide Gross\"]) || !isFinite(+datum[\"sum_Worldwide Gross\"])", - "field": {"group": "height"} + "scale": "y", + "value": 0 }, {"scale": "y", "field": "sum_Worldwide Gross"} ], @@ -81,7 +82,8 @@ "y": [ { "test": "!isValid(datum[\"sum_US Gross\"]) || !isFinite(+datum[\"sum_US Gross\"])", - "field": {"group": "height"} + "scale": "y", + "value": 0 }, {"scale": "y", "field": "sum_US Gross"} ], diff --git a/examples/compiled/bar_grouped_thin.vg.json b/examples/compiled/bar_grouped_thin.vg.json index 69c532b3bc..f8a193afd4 100644 --- a/examples/compiled/bar_grouped_thin.vg.json +++ b/examples/compiled/bar_grouped_thin.vg.json @@ -49,7 +49,8 @@ "y": [ { "test": "!isValid(datum[\"mean_Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"mean_Rotten Tomatoes Rating\"])", - "field": {"group": "height"} + "scale": "y", + "value": 0 }, {"scale": "y", "field": "mean_Rotten Tomatoes Rating"} ], diff --git a/examples/compiled/bar_grouped_thin_minBandSize.vg.json b/examples/compiled/bar_grouped_thin_minBandSize.vg.json index ce94c87630..0a23466f8e 100644 --- a/examples/compiled/bar_grouped_thin_minBandSize.vg.json +++ b/examples/compiled/bar_grouped_thin_minBandSize.vg.json @@ -49,7 +49,8 @@ "y": [ { "test": "!isValid(datum[\"mean_Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"mean_Rotten Tomatoes Rating\"])", - "field": {"group": "height"} + "scale": "y", + "value": 0 }, {"scale": "y", "field": "mean_Rotten Tomatoes Rating"} ], diff --git a/examples/compiled/bar_invalid_color_show.png b/examples/compiled/bar_invalid_color_show.png new file mode 100644 index 0000000000..15a45c2080 Binary files /dev/null and b/examples/compiled/bar_invalid_color_show.png differ diff --git a/examples/compiled/bar_invalid_color_show.svg b/examples/compiled/bar_invalid_color_show.svg new file mode 100644 index 0000000000..7034b097ee --- /dev/null +++ b/examples/compiled/bar_invalid_color_show.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/bar_invalid_color_show.vg.json b/examples/compiled/bar_invalid_color_show.vg.json new file mode 100644 index 0000000000..84ea16785d --- /dev/null +++ b/examples/compiled/bar_invalid_color_show.vg.json @@ -0,0 +1,159 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "width": 200, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "marks": [ + { + "name": "marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('x', inrange(0, domain('x')) ? 0 : domain('x')[0])" + }, + {"scale": "x", "field": "a"} + ], + "width": {"value": 5}, + "y": {"scale": "y", "field": "b_end"}, + "y2": {"scale": "y", "field": "b_start"} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "width"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "data_0", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + }, + { + "name": "color", + "type": "linear", + "domain": {"data": "data_0", "field": "c"}, + "range": "ramp", + "interpolate": "hcl", + "zero": false + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ], + "legends": [ + { + "fill": "color", + "gradientLength": {"signal": "clamp(height, 64, 200)"}, + "title": "c" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/bar_invalid_color_show_override.png b/examples/compiled/bar_invalid_color_show_override.png new file mode 100644 index 0000000000..a73e2f118e Binary files /dev/null and b/examples/compiled/bar_invalid_color_show_override.png differ diff --git a/examples/compiled/bar_invalid_color_show_override.svg b/examples/compiled/bar_invalid_color_show_override.svg new file mode 100644 index 0000000000..862b351951 --- /dev/null +++ b/examples/compiled/bar_invalid_color_show_override.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/bar_invalid_color_show_override.vg.json b/examples/compiled/bar_invalid_color_show_override.vg.json new file mode 100644 index 0000000000..adb1c1fdd2 --- /dev/null +++ b/examples/compiled/bar_invalid_color_show_override.vg.json @@ -0,0 +1,159 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "width": 200, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "marks": [ + { + "name": "marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('x', inrange(0, domain('x')) ? 0 : domain('x')[0])" + }, + {"scale": "x", "field": "a"} + ], + "width": {"value": 5}, + "y": {"scale": "y", "field": "b_end"}, + "y2": {"scale": "y", "field": "b_start"} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "width"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "data_0", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + }, + { + "name": "color", + "type": "linear", + "domain": {"data": "data_0", "field": "c"}, + "range": "ramp", + "interpolate": "hcl", + "zero": false + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ], + "legends": [ + { + "fill": "color", + "gradientLength": {"signal": "clamp(height, 64, 200)"}, + "title": "c" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/layer_null_data.png b/examples/compiled/layer_null_data.png new file mode 100644 index 0000000000..9d63aa7d93 Binary files /dev/null and b/examples/compiled/layer_null_data.png differ diff --git a/examples/compiled/layer_null_data.svg b/examples/compiled/layer_null_data.svg new file mode 100644 index 0000000000..7d12cb7653 --- /dev/null +++ b/examples/compiled/layer_null_data.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/layer_null_data.vg.json b/examples/compiled/layer_null_data.vg.json new file mode 100644 index 0000000000..ba3703026a --- /dev/null +++ b/examples/compiled/layer_null_data.vg.json @@ -0,0 +1,201 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "background": "white", + "padding": 5, + "width": 300, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "values": [ + {"a": "Jan 1, 2000", "b": 28}, + {"a": "Jan 2, 2000", "b": 55}, + {"a": "Jan 3, 2000", "b": null}, + {"a": "Jan 4, 2000", "b": 55}, + {"a": "Jan 5, 2000", "b": 43}, + {"a": "Jan 6, 2000", "b": null}, + {"a": "Jan 7, 2000", "b": 55}, + {"a": "Jan 8, 2000", "b": 43} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toDate(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_1", + "source": "data_0", + "transform": [ + { + "field": "a", + "type": "timeunit", + "units": ["year", "month", "date"], + "as": ["yearmonthdate_a", "yearmonthdate_a_end"] + } + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + {"type": "filter", "expr": "datum.b === null"}, + { + "field": "a", + "type": "timeunit", + "units": ["year", "month", "date"], + "as": ["yearmonthdate_a", "yearmonthdate_a_end"] + }, + { + "type": "formula", + "expr": "0.5 * timeOffset('date', datum['yearmonthdate_a'], -1) + 0.5 * datum['yearmonthdate_a']", + "as": "yearmonthdate_a_offsetted_rect_start" + }, + { + "type": "formula", + "expr": "0.5 * datum['yearmonthdate_a'] + 0.5 * datum['yearmonthdate_a_end']", + "as": "yearmonthdate_a_offsetted_rect_end" + }, + { + "type": "filter", + "expr": "(isDate(datum[\"yearmonthdate_a\"]) || (isValid(datum[\"yearmonthdate_a\"]) && isFinite(+datum[\"yearmonthdate_a\"])))" + } + ] + } + ], + "marks": [ + { + "name": "layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_1"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "description": { + "signal": "\"a (year-month-date): \" + (timeFormat(datum[\"yearmonthdate_a\"], '%d %b')) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "x", "field": "yearmonthdate_a"}, + "y": {"scale": "y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"yearmonthdate_a\"]) && isFinite(+datum[\"yearmonthdate_a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "layer_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 0.2}, + "fill": {"value": "red"}, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a (year-month-date): \" + (timeFormat(datum[\"yearmonthdate_a\"], timeUnitSpecifier([\"year\",\"month\",\"date\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})))" + }, + "x2": { + "scale": "x", + "field": "yearmonthdate_a_offsetted_rect_start", + "offset": { + "signal": "0.5 + (abs(scale(\"x\", datum[\"yearmonthdate_a_end\"]) - scale(\"x\", datum[\"yearmonthdate_a\"])) < 0.25 ? -0.5 * (0.25 - (abs(scale(\"x\", datum[\"yearmonthdate_a_end\"]) - scale(\"x\", datum[\"yearmonthdate_a\"])))) : 0.5)" + } + }, + "x": { + "scale": "x", + "field": "yearmonthdate_a_offsetted_rect_end", + "offset": { + "signal": "0.5 + (abs(scale(\"x\", datum[\"yearmonthdate_a_end\"]) - scale(\"x\", datum[\"yearmonthdate_a\"])) < 0.25 ? 0.5 * (0.25 - (abs(scale(\"x\", datum[\"yearmonthdate_a_end\"]) - scale(\"x\", datum[\"yearmonthdate_a\"])))) : -0.5)" + } + }, + "y": {"value": 0}, + "y2": {"field": {"group": "height"}} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "time", + "domain": { + "fields": [ + {"data": "data_1", "field": "yearmonthdate_a"}, + {"data": "data_2", "field": "yearmonthdate_a_offsetted_rect_start"}, + {"data": "data_2", "field": "yearmonthdate_a_offsetted_rect_end"} + ] + }, + "range": [0, {"signal": "width"}] + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "a (year-month-date)", + "format": "%d %b", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/compiled/line_invalid_null.vg.json b/examples/compiled/line_invalid_null.vg.json index a989f1dce8..2f728a52c4 100644 --- a/examples/compiled/line_invalid_null.vg.json +++ b/examples/compiled/line_invalid_null.vg.json @@ -44,14 +44,15 @@ "x": [ { "test": "!isValid(datum[\"x\"]) || !isFinite(+datum[\"x\"])", - "value": 0 + "signal": "scale('x', inrange(0, domain('x')) ? 0 : domain('x')[0])" }, {"scale": "x", "field": "x"} ], "y": [ { "test": "!isValid(datum[\"y\"]) || !isFinite(+datum[\"y\"])", - "field": {"group": "height"} + "scale": "y", + "value": 0 }, {"scale": "y", "field": "y"} ] diff --git a/examples/compiled/line_quarter_legend.vg.json b/examples/compiled/line_quarter_legend.vg.json index ef38f0be97..32a109b83f 100644 --- a/examples/compiled/line_quarter_legend.vg.json +++ b/examples/compiled/line_quarter_legend.vg.json @@ -67,7 +67,7 @@ "x": {"scale": "x", "field": "year_date"}, "y": {"scale": "y", "field": "mean_price"}, "defined": { - "signal": "isValid(datum[\"year_date\"]) && isFinite(+datum[\"year_date\"]) && isValid(datum[\"mean_price\"]) && isFinite(+datum[\"mean_price\"])" + "signal": "isValid(datum[\"year_date\"]) && isFinite(+datum[\"year_date\"]) && isValid(datum[\"mean_price\"]) && isFinite(+datum[\"mean_price\"]) && isValid(datum[\"quarter_date\"]) && isFinite(+datum[\"quarter_date\"])" } } } diff --git a/examples/compiled/point_invalid_color.vg.json b/examples/compiled/point_invalid_color.vg.json index 70020d6db6..5c03dd5ff7 100644 --- a/examples/compiled/point_invalid_color.vg.json +++ b/examples/compiled/point_invalid_color.vg.json @@ -32,6 +32,7 @@ "x": [ { "test": "!isValid(datum[\"IMDB Rating\"]) || !isFinite(+datum[\"IMDB Rating\"])", + "scale": "x", "value": 0 }, {"scale": "x", "field": "IMDB Rating"} @@ -39,7 +40,8 @@ "y": [ { "test": "!isValid(datum[\"Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"Rotten Tomatoes Rating\"])", - "field": {"group": "height"} + "scale": "y", + "value": 0 }, {"scale": "y", "field": "Rotten Tomatoes Rating"} ] diff --git a/examples/compiled/point_invalid_size_show.png b/examples/compiled/point_invalid_size_show.png new file mode 100644 index 0000000000..a399a9650d Binary files /dev/null and b/examples/compiled/point_invalid_size_show.png differ diff --git a/examples/compiled/point_invalid_size_show.svg b/examples/compiled/point_invalid_size_show.svg new file mode 100644 index 0000000000..2ae4ee19d6 --- /dev/null +++ b/examples/compiled/point_invalid_size_show.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/point_invalid_size_show.vg.json b/examples/compiled/point_invalid_size_show.vg.json new file mode 100644 index 0000000000..7453159e6f --- /dev/null +++ b/examples/compiled/point_invalid_size_show.vg.json @@ -0,0 +1,172 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "height": 100, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + } + ], + "signals": [{"name": "childWidth", "value": 100}], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "source_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_0_x", + "value": 0 + }, + {"scale": "concat_0_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_y", + "value": 0 + }, + {"scale": "concat_0_y", "field": "b"} + ], + "size": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "scale": "size", + "value": 0 + }, + {"scale": "size", "field": "c"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "gridScale": "concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + } + ], + "scales": [ + { + "name": "size", + "type": "linear", + "domain": {"data": "source_0", "field": "c"}, + "range": [4, 361], + "zero": true + }, + { + "name": "concat_0_x", + "type": "linear", + "domain": {"data": "source_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_y", + "type": "linear", + "domain": {"data": "source_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "size": "size", + "symbolType": "circle", + "title": "c", + "encode": { + "symbols": { + "update": { + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "opacity": {"value": 0.7} + } + } + } + } + ] +} diff --git a/examples/compiled/stacked_area_binned.vg.json b/examples/compiled/stacked_area_binned.vg.json index bccef5148e..039489e9b3 100644 --- a/examples/compiled/stacked_area_binned.vg.json +++ b/examples/compiled/stacked_area_binned.vg.json @@ -97,7 +97,7 @@ "y": {"scale": "y", "field": "__count_end"}, "y2": {"scale": "y", "field": "__count_start"}, "defined": { - "signal": "isValid(datum[\"bin_maxbins_10_IMDB Rating_mid\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating_mid\"]) && isValid(datum[\"__count\"]) && isFinite(+datum[\"__count\"])" + "signal": "isValid(datum[\"bin_maxbins_10_IMDB Rating_mid\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating_mid\"])" } } } diff --git a/examples/compiled/test_invalid_break_paths_filter_domains.png b/examples/compiled/test_invalid_break_paths_filter_domains.png new file mode 100644 index 0000000000..cc6e8e6051 Binary files /dev/null and b/examples/compiled/test_invalid_break_paths_filter_domains.png differ diff --git a/examples/compiled/test_invalid_break_paths_filter_domains.svg b/examples/compiled/test_invalid_break_paths_filter_domains.svg new file mode 100644 index 0000000000..c91dd809d5 --- /dev/null +++ b/examples/compiled/test_invalid_break_paths_filter_domains.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_break_paths_filter_domains.vg.json b/examples/compiled/test_invalid_break_paths_filter_domains.vg.json new file mode 100644 index 0000000000..bef469315b --- /dev/null +++ b/examples/compiled/test_invalid_break_paths_filter_domains.vg.json @@ -0,0 +1,969 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_5", + "source": "data_4", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_7", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_8", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_9", + "source": "data_8", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + } + ], + "signals": [ + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} + ], + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_3"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_4"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"}, + "defined": { + "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_6"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_7"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_6"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_8"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"}, + "defined": { + "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_2", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_2", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_5", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_6", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_7", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_7", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_6", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_9", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_9", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_break_paths_show_domains.png b/examples/compiled/test_invalid_break_paths_show_domains.png new file mode 100644 index 0000000000..a8d0e6bd55 Binary files /dev/null and b/examples/compiled/test_invalid_break_paths_show_domains.png differ diff --git a/examples/compiled/test_invalid_break_paths_show_domains.svg b/examples/compiled/test_invalid_break_paths_show_domains.svg new file mode 100644 index 0000000000..8bd25d26d9 --- /dev/null +++ b/examples/compiled/test_invalid_break_paths_show_domains.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_break_paths_show_domains.vg.json b/examples/compiled/test_invalid_break_paths_show_domains.vg.json new file mode 100644 index 0000000000..4fa60a64a7 --- /dev/null +++ b/examples/compiled/test_invalid_break_paths_show_domains.vg.json @@ -0,0 +1,961 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_4", + "source": "data_3", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_7", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_8", + "source": "data_7", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_9", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "signals": [ + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} + ], + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_5"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"}, + "defined": { + "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_6"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_8"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_6"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_9"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"}, + "defined": { + "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_5", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_7", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_7", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_9", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_9", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_break_paths_show_path_domains.png b/examples/compiled/test_invalid_break_paths_show_path_domains.png new file mode 100644 index 0000000000..41eb254fc8 Binary files /dev/null and b/examples/compiled/test_invalid_break_paths_show_path_domains.png differ diff --git a/examples/compiled/test_invalid_break_paths_show_path_domains.svg b/examples/compiled/test_invalid_break_paths_show_path_domains.svg new file mode 100644 index 0000000000..fd3f096e5f --- /dev/null +++ b/examples/compiled/test_invalid_break_paths_show_path_domains.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_break_paths_show_path_domains.vg.json b/examples/compiled/test_invalid_break_paths_show_path_domains.vg.json new file mode 100644 index 0000000000..8920562bae --- /dev/null +++ b/examples/compiled/test_invalid_break_paths_show_path_domains.vg.json @@ -0,0 +1,970 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_7", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "signals": [ + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} + ], + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_3"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_4"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"}, + "defined": { + "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_6"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_7"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"}, + "defined": { + "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_2", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_0", "field": "a"}, + {"data": "data_2", "field": "a"} + ] + }, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_0", "field": "b"}, + {"data": "data_2", "field": "b"} + ] + }, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_4", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_5", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": { + "fields": [ + {"data": "data_0", "field": "a"}, + {"data": "data_5", "field": "a"} + ], + "sort": true + }, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_0", "field": "b"}, + {"data": "data_5", "field": "b"} + ] + }, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_7", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_7", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_color_filter.png b/examples/compiled/test_invalid_color_filter.png new file mode 100644 index 0000000000..4843d35a5f Binary files /dev/null and b/examples/compiled/test_invalid_color_filter.png differ diff --git a/examples/compiled/test_invalid_color_filter.svg b/examples/compiled/test_invalid_color_filter.svg new file mode 100644 index 0000000000..75f6dbe4d0 --- /dev/null +++ b/examples/compiled/test_invalid_color_filter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_color_filter.vg.json b/examples/compiled/test_invalid_color_filter.vg.json new file mode 100644 index 0000000000..22fbdcb340 --- /dev/null +++ b/examples/compiled/test_invalid_color_filter.vg.json @@ -0,0 +1,1062 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_1", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + } + ], + "signals": [ + {"name": "childWidth", "value": 100}, + {"name": "concat_0_childHeight", "value": 100}, + {"name": "concat_1_childHeight", "value": 100} + ], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_2_layer_0_main", + "data": "data_1", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_0_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_3_main", + "data": "data_3", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_0_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "fill": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_2_layer_0_main", + "data": "data_4", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_1_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_3_main", + "data": "data_6", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_1_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "color", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_1", "field": "c"}, + {"data": "data_2", "field": "c"}, + {"data": "data_3", "field": "c"}, + {"data": "data_4", "field": "c"}, + {"data": "data_5", "field": "c"}, + {"data": "data_6", "field": "c"} + ] + }, + "range": "ramp", + "interpolate": "hcl", + "zero": false + }, + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "stroke": "color", + "gradientLength": {"signal": "clamp(concat_0_childHeight, 64, 200)"}, + "title": "c", + "encode": {"gradient": {"update": {"opacity": {"value": 0.7}}}}, + "fill": "color" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.png b/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.png new file mode 100644 index 0000000000..44e481ce63 Binary files /dev/null and b/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.png differ diff --git a/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.svg b/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.svg new file mode 100644 index 0000000000..bb48b40d80 --- /dev/null +++ b/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.vg.json b/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.vg.json new file mode 100644 index 0000000000..9947ced8b4 --- /dev/null +++ b/examples/compiled/test_invalid_color_filter_but_include_in_scale_invalid.vg.json @@ -0,0 +1,1122 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_1", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + } + ], + "signals": [ + {"name": "childWidth", "value": 100}, + {"name": "concat_0_childHeight", "value": 100}, + {"name": "concat_1_childHeight", "value": 100} + ], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_2_layer_0_main", + "data": "data_1", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_0_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_3_main", + "data": "data_3", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_0_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_2_layer_0_main", + "data": "data_4", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_1_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_3_main", + "data": "data_6", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_1_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "red" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "color", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_1", "field": "c"}, + {"data": "data_2", "field": "c"}, + {"data": "data_3", "field": "c"}, + {"data": "data_4", "field": "c"}, + {"data": "data_5", "field": "c"}, + {"data": "data_6", "field": "c"} + ] + }, + "range": "ramp", + "interpolate": "hcl", + "zero": false + }, + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "stroke": "color", + "gradientLength": {"signal": "clamp(concat_0_childHeight, 64, 200)"}, + "title": "c", + "encode": {"gradient": {"update": {"opacity": {"value": 0.7}}}}, + "fill": "color" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_color_show.png b/examples/compiled/test_invalid_color_show.png new file mode 100644 index 0000000000..ccd0363a01 Binary files /dev/null and b/examples/compiled/test_invalid_color_show.png differ diff --git a/examples/compiled/test_invalid_color_show.svg b/examples/compiled/test_invalid_color_show.svg new file mode 100644 index 0000000000..0da6eb7437 --- /dev/null +++ b/examples/compiled/test_invalid_color_show.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_color_show.vg.json b/examples/compiled/test_invalid_color_show.vg.json new file mode 100644 index 0000000000..0c326eb84a --- /dev/null +++ b/examples/compiled/test_invalid_color_show.vg.json @@ -0,0 +1,1158 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "signals": [ + {"name": "childWidth", "value": 100}, + {"name": "concat_0_childHeight", "value": 100}, + {"name": "concat_1_childHeight", "value": 100} + ], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_0_concat_0_x", + "value": 0 + }, + {"scale": "concat_0_concat_0_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_0_y", + "value": 0 + }, + {"scale": "concat_0_concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_1_x', inrange(0, domain('concat_0_concat_1_x')) ? 0 : domain('concat_0_concat_1_x')[0])" + }, + {"scale": "concat_0_concat_1_x", "field": "a"} + ], + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_2_layer_0_main", + "data": "data_0", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_0_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", + "value": 0 + }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + } + ] + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", + "value": 0 + }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_3_main", + "data": "data_3", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_0_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_3_x', inrange(0, domain('concat_0_concat_3_x')) ? 0 : domain('concat_0_concat_3_x')[0])" + }, + {"scale": "concat_0_concat_3_x", "field": "a"} + ], + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_0_y", + "value": 0 + }, + {"scale": "concat_1_concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_2_layer_0_main", + "data": "data_0", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_1_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + } + ] + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_3_main", + "data": "data_5", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_1_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "color", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_0", "field": "c"}, + {"data": "data_2", "field": "c"}, + {"data": "data_3", "field": "c"}, + {"data": "data_4", "field": "c"}, + {"data": "data_5", "field": "c"} + ] + }, + "range": "ramp", + "interpolate": "hcl", + "zero": false + }, + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "stroke": "color", + "gradientLength": {"signal": "clamp(concat_0_childHeight, 64, 200)"}, + "title": "c", + "encode": {"gradient": {"update": {"opacity": {"value": 0.7}}}}, + "fill": "color" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_color_size_config_scale.png b/examples/compiled/test_invalid_color_size_config_scale.png new file mode 100644 index 0000000000..1208bdd247 Binary files /dev/null and b/examples/compiled/test_invalid_color_size_config_scale.png differ diff --git a/examples/compiled/test_invalid_color_size_config_scale.svg b/examples/compiled/test_invalid_color_size_config_scale.svg new file mode 100644 index 0000000000..641c8d1c4d --- /dev/null +++ b/examples/compiled/test_invalid_color_size_config_scale.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_color_size_config_scale.vg.json b/examples/compiled/test_invalid_color_size_config_scale.vg.json new file mode 100644 index 0000000000..66bc925dcd --- /dev/null +++ b/examples/compiled/test_invalid_color_size_config_scale.vg.json @@ -0,0 +1,280 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "height": 100, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + } + ], + "signals": [{"name": "childWidth", "value": 100}], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Color", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": "#aaa" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "gridScale": "concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Size", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_x", "field": "a"}, + "y": {"scale": "concat_1_y", "field": "b"}, + "size": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 4 + }, + {"scale": "size", "field": "c"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_x", + "orient": "bottom", + "gridScale": "concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_y", + "orient": "left", + "gridScale": "concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + } + ], + "scales": [ + { + "name": "color", + "type": "linear", + "domain": {"data": "data_0", "field": "c"}, + "range": "ramp", + "interpolate": "hcl", + "zero": false + }, + { + "name": "size", + "type": "linear", + "domain": {"data": "data_0", "field": "c"}, + "range": [4, 361], + "zero": true + }, + { + "name": "concat_0_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_1_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "stroke": "color", + "gradientLength": {"signal": "clamp(height, 64, 200)"}, + "title": "c", + "encode": {"gradient": {"update": {"opacity": {"value": 0.7}}}}, + "symbolType": "circle", + "size": "size" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_color_size_mark_filter_only.png b/examples/compiled/test_invalid_color_size_mark_filter_only.png new file mode 100644 index 0000000000..a85c93a053 Binary files /dev/null and b/examples/compiled/test_invalid_color_size_mark_filter_only.png differ diff --git a/examples/compiled/test_invalid_color_size_mark_filter_only.svg b/examples/compiled/test_invalid_color_size_mark_filter_only.svg new file mode 100644 index 0000000000..47e5a6ce4e --- /dev/null +++ b/examples/compiled/test_invalid_color_size_mark_filter_only.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_color_size_mark_filter_only.vg.json b/examples/compiled/test_invalid_color_size_mark_filter_only.vg.json new file mode 100644 index 0000000000..01d38a2c2c --- /dev/null +++ b/examples/compiled/test_invalid_color_size_mark_filter_only.vg.json @@ -0,0 +1,268 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "height": 100, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + } + ], + "signals": [{"name": "childWidth", "value": 100}], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Color", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"scale": "color", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "gridScale": "concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Size", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_x", "field": "a"}, + "y": {"scale": "concat_1_y", "field": "b"}, + "size": {"scale": "size", "field": "c"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_x", + "orient": "bottom", + "gridScale": "concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_y", + "orient": "left", + "gridScale": "concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + } + ], + "scales": [ + { + "name": "color", + "type": "linear", + "domain": {"data": "data_0", "field": "c"}, + "range": "ramp", + "interpolate": "hcl", + "zero": false + }, + { + "name": "size", + "type": "linear", + "domain": {"data": "data_0", "field": "c"}, + "range": [4, 361], + "zero": true + }, + { + "name": "concat_0_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_1_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "stroke": "color", + "gradientLength": {"signal": "clamp(height, 64, 200)"}, + "title": "c", + "encode": {"gradient": {"update": {"opacity": {"value": 0.7}}}}, + "symbolType": "circle", + "size": "size" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_color_size_mark_show_only.png b/examples/compiled/test_invalid_color_size_mark_show_only.png new file mode 100644 index 0000000000..26589d8c9f Binary files /dev/null and b/examples/compiled/test_invalid_color_size_mark_show_only.png differ diff --git a/examples/compiled/test_invalid_color_size_mark_show_only.svg b/examples/compiled/test_invalid_color_size_mark_show_only.svg new file mode 100644 index 0000000000..fbe2695055 --- /dev/null +++ b/examples/compiled/test_invalid_color_size_mark_show_only.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_color_size_mark_show_only.vg.json b/examples/compiled/test_invalid_color_size_mark_show_only.vg.json new file mode 100644 index 0000000000..6c756d6227 --- /dev/null +++ b/examples/compiled/test_invalid_color_size_mark_show_only.vg.json @@ -0,0 +1,299 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "height": 100, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + } + ], + "signals": [{"name": "childWidth", "value": 100}], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Color", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "source_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('color', inrange(0, domain('color')) ? 0 : domain('color')[0])" + }, + {"scale": "color", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_0_x", + "value": 0 + }, + {"scale": "concat_0_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_y", + "value": 0 + }, + {"scale": "concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "gridScale": "concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Size", "frame": "group"}, + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "height"} + } + }, + "marks": [ + { + "name": "concat_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "source_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_1_x", + "value": 0 + }, + {"scale": "concat_1_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_y", + "value": 0 + }, + {"scale": "concat_1_y", "field": "b"} + ], + "size": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "scale": "size", + "value": 0 + }, + {"scale": "size", "field": "c"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_x", + "orient": "bottom", + "gridScale": "concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_y", + "orient": "left", + "gridScale": "concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] + } + ], + "scales": [ + { + "name": "color", + "type": "linear", + "domain": {"data": "source_0", "field": "c"}, + "range": "ramp", + "interpolate": "hcl", + "zero": false + }, + { + "name": "size", + "type": "linear", + "domain": {"data": "source_0", "field": "c"}, + "range": [4, 361], + "zero": true + }, + { + "name": "concat_0_x", + "type": "linear", + "domain": {"data": "source_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_y", + "type": "linear", + "domain": {"data": "source_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_x", + "type": "linear", + "domain": {"data": "source_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_1_y", + "type": "linear", + "domain": {"data": "source_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "stroke": "color", + "gradientLength": {"signal": "clamp(height, 64, 200)"}, + "title": "c", + "encode": {"gradient": {"update": {"opacity": {"value": 0.7}}}}, + "symbolType": "circle", + "size": "size" + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_default.png b/examples/compiled/test_invalid_default.png index 0dbec24637..41eb254fc8 100644 Binary files a/examples/compiled/test_invalid_default.png and b/examples/compiled/test_invalid_default.png differ diff --git a/examples/compiled/test_invalid_default.svg b/examples/compiled/test_invalid_default.svg index 63d8efdae2..fd3f096e5f 100644 --- a/examples/compiled/test_invalid_default.svg +++ b/examples/compiled/test_invalid_default.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/examples/compiled/test_invalid_default.vg.json b/examples/compiled/test_invalid_default.vg.json index b19317c8a7..8920562bae 100644 --- a/examples/compiled/test_invalid_default.vg.json +++ b/examples/compiled/test_invalid_default.vg.json @@ -7,10 +7,10 @@ { "name": "source_0", "values": [ - {"a": null, "b": 1000}, + {"a": null, "b": 100}, {"a": -10, "b": null}, - {"a": -5, "b": 25}, - {"a": -1, "b": 20}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, {"a": 0, "b": null}, {"a": 1, "b": 30}, {"a": 5, "b": 40}, @@ -126,22 +126,17 @@ } ], "signals": [ - {"name": "childWidth", "value": 100}, - {"name": "concat_0_childHeight", "value": 100}, - {"name": "concat_1_childHeight", "value": 100} + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} ], - "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", "name": "concat_0_group", "title": {"text": "Quantitative X", "anchor": "start"}, - "layout": { - "padding": 20, - "columns": 1, - "bounds": "full", - "align": "each" - }, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", @@ -149,8 +144,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -164,6 +159,9 @@ "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -180,7 +178,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_0_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -194,7 +192,7 @@ "orient": "left", "gridScale": "concat_0_concat_0_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -210,7 +208,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -219,7 +217,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -230,8 +228,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -243,6 +241,9 @@ "encode": { "update": { "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -261,7 +262,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_1_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -275,7 +276,7 @@ "orient": "left", "gridScale": "concat_0_concat_1_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -291,7 +292,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -300,7 +301,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -311,13 +312,13 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ { - "name": "concat_0_concat_2_marks", + "name": "concat_0_concat_2_layer_0_marks", "type": "line", "style": ["line"], "sort": {"field": "x"}, @@ -325,6 +326,9 @@ "encode": { "update": { "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, @@ -335,6 +339,27 @@ } } } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } } ], "axes": [ @@ -343,7 +368,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_2_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -357,7 +382,7 @@ "orient": "left", "gridScale": "concat_0_concat_2_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -373,7 +398,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -382,7 +407,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -393,8 +418,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -408,6 +433,9 @@ "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, @@ -427,7 +455,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_3_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -441,7 +469,7 @@ "orient": "left", "gridScale": "concat_0_concat_3_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -457,7 +485,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -466,7 +494,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -477,12 +505,7 @@ "type": "group", "name": "concat_1_group", "title": {"text": "Ordinal X", "anchor": "start"}, - "layout": { - "padding": 20, - "columns": 1, - "bounds": "full", - "align": "each" - }, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", @@ -490,8 +513,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -505,6 +528,9 @@ "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -521,7 +547,7 @@ "orient": "left", "gridScale": "concat_1_concat_0_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -546,7 +572,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -557,8 +583,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -570,6 +596,9 @@ "encode": { "update": { "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -590,7 +619,7 @@ "orient": "left", "gridScale": "concat_1_concat_1_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -615,7 +644,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -626,13 +655,13 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ { - "name": "concat_1_concat_2_marks", + "name": "concat_1_concat_2_layer_0_marks", "type": "line", "style": ["line"], "sort": {"field": "x"}, @@ -640,6 +669,9 @@ "encode": { "update": { "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, @@ -650,6 +682,27 @@ } } } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } } ], "axes": [ @@ -658,7 +711,7 @@ "orient": "left", "gridScale": "concat_1_concat_2_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -683,7 +736,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -694,8 +747,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -709,6 +762,9 @@ "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, @@ -728,7 +784,7 @@ "orient": "left", "gridScale": "concat_1_concat_3_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -753,7 +809,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -766,7 +822,7 @@ "name": "concat_0_concat_0_x", "type": "linear", "domain": {"data": "data_2", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": true }, @@ -774,7 +830,7 @@ "name": "concat_0_concat_0_y", "type": "linear", "domain": {"data": "data_2", "field": "b"}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -782,7 +838,7 @@ "name": "concat_0_concat_1_x", "type": "linear", "domain": {"data": "data_3", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false, "padding": 5 @@ -791,23 +847,33 @@ "name": "concat_0_concat_1_y", "type": "linear", "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_0_concat_2_x", "type": "linear", - "domain": {"data": "data_0", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "domain": { + "fields": [ + {"data": "data_0", "field": "a"}, + {"data": "data_2", "field": "a"} + ] + }, + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false }, { "name": "concat_0_concat_2_y", "type": "linear", - "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "domain": { + "fields": [ + {"data": "data_0", "field": "b"}, + {"data": "data_2", "field": "b"} + ] + }, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -815,7 +881,7 @@ "name": "concat_0_concat_3_x", "type": "linear", "domain": {"data": "data_4", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false }, @@ -823,7 +889,7 @@ "name": "concat_0_concat_3_y", "type": "linear", "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -831,14 +897,14 @@ "name": "concat_1_concat_0_x", "type": "point", "domain": {"data": "data_5", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_0_y", "type": "linear", "domain": {"data": "data_5", "field": "b"}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -846,7 +912,7 @@ "name": "concat_1_concat_1_x", "type": "band", "domain": {"data": "data_6", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "paddingInner": 0.1, "paddingOuter": 0.05 }, @@ -854,22 +920,33 @@ "name": "concat_1_concat_1_y", "type": "linear", "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_1_concat_2_x", "type": "point", - "domain": {"data": "data_0", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "domain": { + "fields": [ + {"data": "data_0", "field": "a"}, + {"data": "data_5", "field": "a"} + ], + "sort": true + }, + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_2_y", "type": "linear", - "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "domain": { + "fields": [ + {"data": "data_0", "field": "b"}, + {"data": "data_5", "field": "b"} + ] + }, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -877,16 +954,17 @@ "name": "concat_1_concat_3_x", "type": "point", "domain": {"data": "data_7", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_3_y", "type": "linear", "domain": {"data": "data_7", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true } - ] + ], + "config": {"mark": {"tooltip": true}} } diff --git a/examples/compiled/test_invalid_filter.png b/examples/compiled/test_invalid_filter.png index 0dbec24637..492012eb23 100644 Binary files a/examples/compiled/test_invalid_filter.png and b/examples/compiled/test_invalid_filter.png differ diff --git a/examples/compiled/test_invalid_filter.svg b/examples/compiled/test_invalid_filter.svg index 63d8efdae2..92ac7c6825 100644 --- a/examples/compiled/test_invalid_filter.svg +++ b/examples/compiled/test_invalid_filter.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/examples/compiled/test_invalid_filter.vg.json b/examples/compiled/test_invalid_filter.vg.json index b19317c8a7..0b5c1a789e 100644 --- a/examples/compiled/test_invalid_filter.vg.json +++ b/examples/compiled/test_invalid_filter.vg.json @@ -7,10 +7,10 @@ { "name": "source_0", "values": [ - {"a": null, "b": 1000}, + {"a": null, "b": 100}, {"a": -10, "b": null}, - {"a": -5, "b": 25}, - {"a": -1, "b": 20}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, {"a": 0, "b": null}, {"a": 1, "b": 30}, {"a": 5, "b": 40}, @@ -25,7 +25,7 @@ ] }, { - "name": "data_2", + "name": "data_1", "source": "data_0", "transform": [ { @@ -35,7 +35,7 @@ ] }, { - "name": "data_3", + "name": "data_2", "source": "data_0", "transform": [ { @@ -53,7 +53,7 @@ ] }, { - "name": "data_4", + "name": "data_3", "source": "data_0", "transform": [ { @@ -71,11 +71,15 @@ "sort": {"field": [], "order": []}, "as": ["b_start", "b_end"], "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" } ] }, { - "name": "data_5", + "name": "data_4", "source": "data_0", "transform": [ { @@ -85,7 +89,7 @@ ] }, { - "name": "data_6", + "name": "data_5", "source": "data_0", "transform": [ { @@ -103,7 +107,7 @@ ] }, { - "name": "data_7", + "name": "data_6", "source": "data_0", "transform": [ { @@ -121,27 +125,26 @@ "sort": {"field": [], "order": []}, "as": ["b_start", "b_end"], "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" } ] } ], "signals": [ - {"name": "childWidth", "value": 100}, - {"name": "concat_0_childHeight", "value": 100}, - {"name": "concat_1_childHeight", "value": 100} + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} ], - "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", "name": "concat_0_group", "title": {"text": "Quantitative X", "anchor": "start"}, - "layout": { - "padding": 20, - "columns": 1, - "bounds": "full", - "align": "each" - }, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", @@ -149,8 +152,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -158,12 +161,15 @@ "name": "concat_0_concat_0_marks", "type": "symbol", "style": ["point"], - "from": {"data": "data_2"}, + "from": {"data": "data_1"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -180,7 +186,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_0_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -194,7 +200,7 @@ "orient": "left", "gridScale": "concat_0_concat_0_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -210,7 +216,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -219,7 +225,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -230,8 +236,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -239,10 +245,13 @@ "name": "concat_0_concat_1_marks", "type": "rect", "style": ["bar"], - "from": {"data": "data_3"}, + "from": {"data": "data_2"}, "encode": { "update": { "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -261,7 +270,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_1_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -275,7 +284,7 @@ "orient": "left", "gridScale": "concat_0_concat_1_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -291,7 +300,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -300,7 +309,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -311,28 +320,49 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ { - "name": "concat_0_concat_2_marks", + "name": "concat_0_concat_2_layer_0_marks", "type": "line", "style": ["line"], "sort": {"field": "x"}, - "from": {"data": "data_0"}, + "from": {"data": "data_1"}, "encode": { "update": { "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, "x": {"scale": "concat_0_concat_2_x", "field": "a"}, - "y": {"scale": "concat_0_concat_2_y", "field": "b"}, - "defined": { - "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" - } + "y": {"scale": "concat_0_concat_2_y", "field": "b"} } } } @@ -343,7 +373,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_2_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -357,7 +387,7 @@ "orient": "left", "gridScale": "concat_0_concat_2_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -373,7 +403,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -382,7 +412,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -393,8 +423,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -403,20 +433,20 @@ "type": "area", "style": ["area"], "sort": {"field": "x"}, - "from": {"data": "data_4"}, + "from": {"data": "data_3"}, "encode": { "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, "x": {"scale": "concat_0_concat_3_x", "field": "a"}, "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, - "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"}, - "defined": { - "signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" - } + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} } } } @@ -427,7 +457,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_3_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -441,7 +471,7 @@ "orient": "left", "gridScale": "concat_0_concat_3_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -457,7 +487,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -466,7 +496,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -477,12 +507,7 @@ "type": "group", "name": "concat_1_group", "title": {"text": "Ordinal X", "anchor": "start"}, - "layout": { - "padding": 20, - "columns": 1, - "bounds": "full", - "align": "each" - }, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", @@ -490,8 +515,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -499,12 +524,15 @@ "name": "concat_1_concat_0_marks", "type": "symbol", "style": ["point"], - "from": {"data": "data_5"}, + "from": {"data": "data_4"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -521,7 +549,7 @@ "orient": "left", "gridScale": "concat_1_concat_0_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -546,7 +574,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -557,8 +585,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -566,10 +594,13 @@ "name": "concat_1_concat_1_marks", "type": "rect", "style": ["bar"], - "from": {"data": "data_6"}, + "from": {"data": "data_5"}, "encode": { "update": { "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -590,7 +621,7 @@ "orient": "left", "gridScale": "concat_1_concat_1_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -615,7 +646,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -626,28 +657,49 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ { - "name": "concat_1_concat_2_marks", + "name": "concat_1_concat_2_layer_0_marks", "type": "line", "style": ["line"], "sort": {"field": "x"}, - "from": {"data": "data_0"}, + "from": {"data": "data_4"}, "encode": { "update": { "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, "x": {"scale": "concat_1_concat_2_x", "field": "a"}, - "y": {"scale": "concat_1_concat_2_y", "field": "b"}, - "defined": { - "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" - } + "y": {"scale": "concat_1_concat_2_y", "field": "b"} } } } @@ -658,7 +710,7 @@ "orient": "left", "gridScale": "concat_1_concat_2_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -683,7 +735,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -694,8 +746,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -704,20 +756,20 @@ "type": "area", "style": ["area"], "sort": {"field": "x"}, - "from": {"data": "data_7"}, + "from": {"data": "data_6"}, "encode": { "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, "x": {"scale": "concat_1_concat_3_x", "field": "a"}, "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, - "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"}, - "defined": { - "signal": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" - } + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} } } } @@ -728,7 +780,7 @@ "orient": "left", "gridScale": "concat_1_concat_3_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -753,7 +805,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -765,24 +817,24 @@ { "name": "concat_0_concat_0_x", "type": "linear", - "domain": {"data": "data_2", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": true }, { "name": "concat_0_concat_0_y", "type": "linear", - "domain": {"data": "data_2", "field": "b"}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_0_concat_1_x", "type": "linear", - "domain": {"data": "data_3", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false, "padding": 5 @@ -790,103 +842,104 @@ { "name": "concat_0_concat_1_y", "type": "linear", - "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_0_concat_2_x", "type": "linear", - "domain": {"data": "data_0", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false }, { "name": "concat_0_concat_2_y", "type": "linear", - "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_0_concat_3_x", "type": "linear", - "domain": {"data": "data_4", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false }, { "name": "concat_0_concat_3_y", "type": "linear", - "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_1_concat_0_x", "type": "point", - "domain": {"data": "data_5", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_0_y", "type": "linear", - "domain": {"data": "data_5", "field": "b"}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_1_concat_1_x", "type": "band", - "domain": {"data": "data_6", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], "paddingInner": 0.1, "paddingOuter": 0.05 }, { "name": "concat_1_concat_1_y", "type": "linear", - "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_1_concat_2_x", "type": "point", - "domain": {"data": "data_0", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_2_y", "type": "linear", - "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "concat_1_concat_3_x", "type": "point", - "domain": {"data": "data_7", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_3_y", "type": "linear", - "domain": {"data": "data_7", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true } - ] + ], + "config": {"mark": {"tooltip": true}} } diff --git a/examples/compiled/test_invalid_null.png b/examples/compiled/test_invalid_null.png index 8ff7b7c3c9..a1a5de1321 100644 Binary files a/examples/compiled/test_invalid_null.png and b/examples/compiled/test_invalid_null.png differ diff --git a/examples/compiled/test_invalid_null.svg b/examples/compiled/test_invalid_null.svg index 3c52e46b56..f4635611ae 100644 --- a/examples/compiled/test_invalid_null.svg +++ b/examples/compiled/test_invalid_null.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/examples/compiled/test_invalid_null.vg.json b/examples/compiled/test_invalid_null.vg.json index 0ea097f958..d4134b54da 100644 --- a/examples/compiled/test_invalid_null.vg.json +++ b/examples/compiled/test_invalid_null.vg.json @@ -7,10 +7,10 @@ { "name": "source_0", "values": [ - {"a": null, "b": 1000}, + {"a": null, "b": 100}, {"a": -10, "b": null}, - {"a": -5, "b": 25}, - {"a": -1, "b": 20}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, {"a": 0, "b": null}, {"a": 1, "b": 30}, {"a": 5, "b": 40}, @@ -98,22 +98,17 @@ } ], "signals": [ - {"name": "childWidth", "value": 100}, - {"name": "concat_0_childHeight", "value": 100}, - {"name": "concat_1_childHeight", "value": 100} + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} ], - "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", "name": "concat_0_group", "title": {"text": "Quantitative X", "anchor": "start"}, - "layout": { - "padding": 20, - "columns": 1, - "bounds": "full", - "align": "each" - }, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", @@ -121,8 +116,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -136,6 +131,9 @@ "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -143,6 +141,7 @@ "x": [ { "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_0_concat_0_x", "value": 0 }, {"scale": "concat_0_concat_0_x", "field": "a"} @@ -150,7 +149,8 @@ "y": [ { "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", - "field": {"group": "height"} + "scale": "concat_0_concat_0_y", + "value": 0 }, {"scale": "concat_0_concat_0_y", "field": "b"} ] @@ -164,7 +164,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_0_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -178,7 +178,7 @@ "orient": "left", "gridScale": "concat_0_concat_0_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -194,7 +194,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -203,7 +203,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -214,8 +214,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -227,6 +227,9 @@ "encode": { "update": { "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -234,7 +237,7 @@ "xc": [ { "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", - "value": 0 + "signal": "scale('concat_0_concat_1_x', inrange(0, domain('concat_0_concat_1_x')) ? 0 : domain('concat_0_concat_1_x')[0])" }, {"scale": "concat_0_concat_1_x", "field": "a"} ], @@ -251,7 +254,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_1_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -265,7 +268,7 @@ "orient": "left", "gridScale": "concat_0_concat_1_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -281,7 +284,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -290,7 +293,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -301,13 +304,13 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ { - "name": "concat_0_concat_2_marks", + "name": "concat_0_concat_2_layer_0_marks", "type": "line", "style": ["line"], "sort": {"field": "x"}, @@ -315,20 +318,58 @@ "encode": { "update": { "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, "x": [ { "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", "value": 0 }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, {"scale": "concat_0_concat_2_x", "field": "a"} ], "y": [ { "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", - "field": {"group": "height"} + "scale": "concat_0_concat_2_y", + "value": 0 }, {"scale": "concat_0_concat_2_y", "field": "b"} ] @@ -342,7 +383,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_2_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -356,7 +397,7 @@ "orient": "left", "gridScale": "concat_0_concat_2_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -372,7 +413,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -381,7 +422,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -392,8 +433,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_0_childHeight"} + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -407,13 +448,16 @@ "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, "x": [ { "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", - "value": 0 + "signal": "scale('concat_0_concat_3_x', inrange(0, domain('concat_0_concat_3_x')) ? 0 : domain('concat_0_concat_3_x')[0])" }, {"scale": "concat_0_concat_3_x", "field": "a"} ], @@ -429,7 +473,7 @@ "orient": "bottom", "gridScale": "concat_0_concat_3_y", "grid": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "domain": false, "labels": false, "aria": false, @@ -443,7 +487,7 @@ "orient": "left", "gridScale": "concat_0_concat_3_x", "grid": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -459,7 +503,7 @@ "title": "a", "labelFlush": true, "labelOverlap": true, - "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, "zindex": 0 }, { @@ -468,7 +512,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -479,12 +523,7 @@ "type": "group", "name": "concat_1_group", "title": {"text": "Ordinal X", "anchor": "start"}, - "layout": { - "padding": 20, - "columns": 1, - "bounds": "full", - "align": "each" - }, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", @@ -492,8 +531,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -507,6 +546,9 @@ "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -515,7 +557,8 @@ "y": [ { "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", - "field": {"group": "height"} + "scale": "concat_1_concat_0_y", + "value": 0 }, {"scale": "concat_1_concat_0_y", "field": "b"} ] @@ -529,7 +572,7 @@ "orient": "left", "gridScale": "concat_1_concat_0_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -554,7 +597,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -565,8 +608,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -578,6 +621,9 @@ "encode": { "update": { "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" @@ -598,7 +644,7 @@ "orient": "left", "gridScale": "concat_1_concat_1_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -623,7 +669,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -634,13 +680,13 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ { - "name": "concat_1_concat_2_marks", + "name": "concat_1_concat_2_layer_0_marks", "type": "line", "style": ["line"], "sort": {"field": "x"}, @@ -648,6 +694,37 @@ "encode": { "update": { "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, @@ -655,7 +732,8 @@ "y": [ { "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", - "field": {"group": "height"} + "scale": "concat_1_concat_2_y", + "value": 0 }, {"scale": "concat_1_concat_2_y", "field": "b"} ] @@ -669,7 +747,7 @@ "orient": "left", "gridScale": "concat_1_concat_2_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -694,7 +772,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -705,8 +783,8 @@ "style": "cell", "encode": { "update": { - "width": {"signal": "childWidth"}, - "height": {"signal": "concat_1_childHeight"} + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} } }, "marks": [ @@ -720,6 +798,9 @@ "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" }, @@ -736,7 +817,7 @@ "orient": "left", "gridScale": "concat_1_concat_3_x", "grid": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, @@ -761,7 +842,7 @@ "grid": false, "title": "b", "labelOverlap": true, - "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] @@ -774,7 +855,7 @@ "name": "concat_0_concat_0_x", "type": "linear", "domain": {"data": "data_0", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": true }, @@ -782,7 +863,7 @@ "name": "concat_0_concat_0_y", "type": "linear", "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -790,7 +871,7 @@ "name": "concat_0_concat_1_x", "type": "linear", "domain": {"data": "data_2", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false, "padding": 5 @@ -799,7 +880,7 @@ "name": "concat_0_concat_1_y", "type": "linear", "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -807,7 +888,7 @@ "name": "concat_0_concat_2_x", "type": "linear", "domain": {"data": "data_0", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false }, @@ -815,7 +896,7 @@ "name": "concat_0_concat_2_y", "type": "linear", "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -823,7 +904,7 @@ "name": "concat_0_concat_3_x", "type": "linear", "domain": {"data": "data_3", "field": "a"}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_0_childWidth"}], "nice": true, "zero": false }, @@ -831,7 +912,7 @@ "name": "concat_0_concat_3_y", "type": "linear", "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_0_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -839,14 +920,14 @@ "name": "concat_1_concat_0_x", "type": "point", "domain": {"data": "data_0", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_0_y", "type": "linear", "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -854,7 +935,7 @@ "name": "concat_1_concat_1_x", "type": "band", "domain": {"data": "data_4", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "paddingInner": 0.1, "paddingOuter": 0.05 }, @@ -862,7 +943,7 @@ "name": "concat_1_concat_1_y", "type": "linear", "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -870,14 +951,14 @@ "name": "concat_1_concat_2_x", "type": "point", "domain": {"data": "data_0", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_2_y", "type": "linear", "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, @@ -885,16 +966,17 @@ "name": "concat_1_concat_3_x", "type": "point", "domain": {"data": "data_5", "field": "a", "sort": true}, - "range": [0, {"signal": "childWidth"}], + "range": [0, {"signal": "concat_1_childWidth"}], "padding": 0.5 }, { "name": "concat_1_concat_3_y", "type": "linear", "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, - "range": [{"signal": "concat_1_childHeight"}, 0], + "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true } - ] + ], + "config": {"mark": {"tooltip": true}} } diff --git a/examples/compiled/test_invalid_opacity_filter.png b/examples/compiled/test_invalid_opacity_filter.png new file mode 100644 index 0000000000..b7023bce36 Binary files /dev/null and b/examples/compiled/test_invalid_opacity_filter.png differ diff --git a/examples/compiled/test_invalid_opacity_filter.svg b/examples/compiled/test_invalid_opacity_filter.svg new file mode 100644 index 0000000000..5bd38d9893 --- /dev/null +++ b/examples/compiled/test_invalid_opacity_filter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_opacity_filter.vg.json b/examples/compiled/test_invalid_opacity_filter.vg.json new file mode 100644 index 0000000000..688632fa11 --- /dev/null +++ b/examples/compiled/test_invalid_opacity_filter.vg.json @@ -0,0 +1,1073 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_1", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"]) && isValid(datum[\"c\"]) && isFinite(+datum[\"c\"])" + } + ] + } + ], + "signals": [ + {"name": "childWidth", "value": 100}, + {"name": "concat_0_childHeight", "value": 100}, + {"name": "concat_1_childHeight", "value": 100} + ], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"scale": "opacity", "field": "c"}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "opacity": {"scale": "opacity", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_2_layer_0_main", + "data": "data_1", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_0_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "opacity": {"scale": "opacity", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"scale": "opacity", "field": "c"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_3_main", + "data": "data_3", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_0_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "opacity": {"scale": "opacity", "field": "c"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"scale": "opacity", "field": "c"}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "opacity": {"scale": "opacity", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_2_layer_0_main", + "data": "data_4", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_1_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "opacity": {"scale": "opacity", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": {"scale": "opacity", "field": "c"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_3_main", + "data": "data_6", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_1_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "opacity": {"scale": "opacity", "field": "c"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "opacity", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_1", "field": "c"}, + {"data": "data_2", "field": "c"}, + {"data": "data_3", "field": "c"}, + {"data": "data_4", "field": "c"}, + {"data": "data_5", "field": "c"}, + {"data": "data_6", "field": "c"} + ] + }, + "range": [0.3, 0.8], + "zero": false + }, + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "opacity": "opacity", + "symbolType": "circle", + "title": "c", + "encode": { + "symbols": { + "update": { + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"} + } + } + } + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.png b/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.png new file mode 100644 index 0000000000..05a2fc7335 Binary files /dev/null and b/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.png differ diff --git a/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.svg b/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.svg new file mode 100644 index 0000000000..67540caf76 --- /dev/null +++ b/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.vg.json b/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.vg.json new file mode 100644 index 0000000000..da3940ae50 --- /dev/null +++ b/examples/compiled/test_invalid_opacity_filter_but_include_in_scale_invalid.vg.json @@ -0,0 +1,1133 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_1", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + }, + { + "name": "data_6", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + } + ], + "signals": [ + {"name": "childWidth", "value": 100}, + {"name": "concat_0_childHeight", "value": 100}, + {"name": "concat_1_childHeight", "value": 100} + ], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_0_x", "field": "a"}, + "y": {"scale": "concat_0_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": {"scale": "concat_0_concat_1_x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_2_layer_0_main", + "data": "data_1", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_0_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_2_x", "field": "a"}, + "y": {"scale": "concat_0_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_3_main", + "data": "data_3", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_0_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_0_concat_3_x", "field": "a"}, + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": {"scale": "concat_1_concat_0_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_5"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_2_layer_0_main", + "data": "data_4", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_1_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ] + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": {"scale": "concat_1_concat_2_y", "field": "b"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_3_main", + "data": "data_6", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_1_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "value": 0.1 + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "opacity", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_1", "field": "c"}, + {"data": "data_2", "field": "c"}, + {"data": "data_3", "field": "c"}, + {"data": "data_4", "field": "c"}, + {"data": "data_5", "field": "c"}, + {"data": "data_6", "field": "c"} + ] + }, + "range": [0.3, 0.8], + "zero": false + }, + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_1", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_1", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_4", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_6", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_6", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "opacity": "opacity", + "symbolType": "circle", + "title": "c", + "encode": { + "symbols": { + "update": { + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"} + } + } + } + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_opacity_show.png b/examples/compiled/test_invalid_opacity_show.png new file mode 100644 index 0000000000..2b8cdfef24 Binary files /dev/null and b/examples/compiled/test_invalid_opacity_show.png differ diff --git a/examples/compiled/test_invalid_opacity_show.svg b/examples/compiled/test_invalid_opacity_show.svg new file mode 100644 index 0000000000..3330670d5f --- /dev/null +++ b/examples/compiled/test_invalid_opacity_show.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_opacity_show.vg.json b/examples/compiled/test_invalid_opacity_show.vg.json new file mode 100644 index 0000000000..00ad629972 --- /dev/null +++ b/examples/compiled/test_invalid_opacity_show.vg.json @@ -0,0 +1,1169 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": ["c"], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": ["c"], "order": ["descending"]}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "signals": [ + {"name": "childWidth", "value": 100}, + {"name": "concat_0_childHeight", "value": 100}, + {"name": "concat_1_childHeight", "value": 100} + ], + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_0_concat_0_x", + "value": 0 + }, + {"scale": "concat_0_concat_0_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_0_y", + "value": 0 + }, + {"scale": "concat_0_concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "xc": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_1_x', inrange(0, domain('concat_0_concat_1_x')) ? 0 : domain('concat_0_concat_1_x')[0])" + }, + {"scale": "concat_0_concat_1_x", "field": "a"} + ], + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_2_layer_0_main", + "data": "data_0", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_0_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", + "value": 0 + }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + } + ] + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", + "value": 0 + }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_0_childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_0_concat_3_main", + "data": "data_3", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_0_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_3_x', inrange(0, domain('concat_0_concat_3_x')) ? 0 : domain('concat_0_concat_3_x')[0])" + }, + {"scale": "concat_0_concat_3_x", "field": "a"} + ], + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": { + "padding": 20, + "columns": 1, + "bounds": "full", + "align": "each" + }, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_0_y", + "value": 0 + }, + {"scale": "concat_1_concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_2_layer_0_main", + "data": "data_0", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": { + "data": "faceted_path_concat_1_concat_2_layer_0_main" + }, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + } + ] + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "childWidth"}, + "height": {"signal": "concat_1_childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_pathgroup", + "type": "group", + "from": { + "facet": { + "name": "faceted_path_concat_1_concat_3_main", + "data": "data_5", + "groupby": ["c"] + } + }, + "encode": { + "update": { + "width": {"field": {"group": "width"}}, + "height": {"field": {"group": "height"}} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "faceted_path_concat_1_concat_3_main"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "opacity": [ + { + "test": "!isValid(datum[\"c\"]) || !isFinite(+datum[\"c\"])", + "signal": "scale('opacity', inrange(0, domain('opacity')) ? 0 : domain('opacity')[0])" + }, + {"scale": "opacity", "field": "c"} + ], + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\"), \"c\": format(datum[\"c\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (format(datum[\"c\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ] + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_1_childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "opacity", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_0", "field": "c"}, + {"data": "data_2", "field": "c"}, + {"data": "data_3", "field": "c"}, + {"data": "data_4", "field": "c"}, + {"data": "data_5", "field": "c"} + ] + }, + "range": [0.3, 0.8], + "zero": false + }, + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_0_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "concat_1_childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "legends": [ + { + "opacity": "opacity", + "symbolType": "circle", + "title": "c", + "encode": { + "symbols": { + "update": { + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"} + } + } + } + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/test_invalid_show.png b/examples/compiled/test_invalid_show.png new file mode 100644 index 0000000000..a1a5de1321 Binary files /dev/null and b/examples/compiled/test_invalid_show.png differ diff --git a/examples/compiled/test_invalid_show.svg b/examples/compiled/test_invalid_show.svg new file mode 100644 index 0000000000..f4635611ae --- /dev/null +++ b/examples/compiled/test_invalid_show.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/test_invalid_show.vg.json b/examples/compiled/test_invalid_show.vg.json new file mode 100644 index 0000000000..d4134b54da --- /dev/null +++ b/examples/compiled/test_invalid_show.vg.json @@ -0,0 +1,982 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Testing invalid", + "background": "white", + "padding": 5, + "data": [ + { + "name": "source_0", + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"} + ] + }, + { + "name": "data_2", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_3", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_4", + "source": "data_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + }, + { + "name": "data_5", + "source": "data_0", + "transform": [ + { + "type": "impute", + "field": "b", + "groupby": [], + "key": "a", + "method": "value", + "value": 0 + }, + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + } + ] + } + ], + "signals": [ + {"name": "childHeight", "value": 100}, + {"name": "concat_0_childWidth", "value": 100}, + {"name": "concat_1_childWidth", "value": 100} + ], + "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_group", + "title": {"text": "Quantitative X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_0_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "scale": "concat_0_concat_0_x", + "value": 0 + }, + {"scale": "concat_0_concat_0_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_0_y", + "value": 0 + }, + {"scale": "concat_0_concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "gridScale": "concat_0_concat_0_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "gridScale": "concat_0_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_2"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "xc": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_1_x', inrange(0, domain('concat_0_concat_1_x')) ? 0 : domain('concat_0_concat_1_x')[0])" + }, + {"scale": "concat_0_concat_1_x", "field": "a"} + ], + "width": {"value": 5}, + "y": {"scale": "concat_0_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "gridScale": "concat_0_concat_1_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "gridScale": "concat_0_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", + "value": 0 + }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + }, + { + "name": "concat_0_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_2_x', inrange(0, domain('concat_0_concat_2_x')) ? 0 : domain('concat_0_concat_2_x')[0])" + }, + {"scale": "concat_0_concat_2_x", "field": "a"} + ], + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_0_concat_2_y", + "value": 0 + }, + {"scale": "concat_0_concat_2_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "gridScale": "concat_0_concat_2_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "gridScale": "concat_0_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_0_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_0_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_0_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_3"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": format(datum[\"a\"], \"\"), \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": [ + { + "test": "!isValid(datum[\"a\"]) || !isFinite(+datum[\"a\"])", + "signal": "scale('concat_0_concat_3_x', inrange(0, domain('concat_0_concat_3_x')) ? 0 : domain('concat_0_concat_3_x')[0])" + }, + {"scale": "concat_0_concat_3_x", "field": "a"} + ], + "y": {"scale": "concat_0_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_0_concat_3_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "gridScale": "concat_0_concat_3_y", + "grid": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "gridScale": "concat_0_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(concat_0_childWidth/40)"}, + "zindex": 0 + }, + { + "scale": "concat_0_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + }, + { + "type": "group", + "name": "concat_1_group", + "title": {"text": "Ordinal X", "anchor": "start"}, + "layout": {"padding": 20, "bounds": "full", "align": "each"}, + "marks": [ + { + "type": "group", + "name": "concat_1_concat_0_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_0_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 0.7}, + "fill": {"value": "transparent"}, + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_0_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_0_y", + "value": 0 + }, + {"scale": "concat_1_concat_0_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "gridScale": "concat_1_concat_0_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_0_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_1_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_1_marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_4"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_1_x", "field": "a"}, + "width": { + "signal": "max(0.25, bandwidth('concat_1_concat_1_x'))" + }, + "y": {"scale": "concat_1_concat_1_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_1_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "gridScale": "concat_1_concat_1_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_1_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_2_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_2_layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + }, + { + "name": "concat_1_concat_2_layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_2_x", "field": "a"}, + "y": [ + { + "test": "!isValid(datum[\"b\"]) || !isFinite(+datum[\"b\"])", + "scale": "concat_1_concat_2_y", + "value": 0 + }, + {"scale": "concat_1_concat_2_y", "field": "b"} + ] + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "gridScale": "concat_1_concat_2_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_2_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + }, + { + "type": "group", + "name": "concat_1_concat_3_group", + "style": "cell", + "encode": { + "update": { + "width": {"signal": "concat_1_childWidth"}, + "height": {"signal": "childHeight"} + } + }, + "marks": [ + { + "name": "concat_1_concat_3_marks", + "type": "area", + "style": ["area"], + "sort": {"field": "x"}, + "from": {"data": "data_5"}, + "encode": { + "update": { + "orient": {"value": "vertical"}, + "fill": {"value": "#4c78a8"}, + "tooltip": { + "signal": "{\"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"], \"b\": format(datum[\"b\"], \"\")}" + }, + "description": { + "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "concat_1_concat_3_x", "field": "a"}, + "y": {"scale": "concat_1_concat_3_y", "field": "b_end"}, + "y2": {"scale": "concat_1_concat_3_y", "field": "b_start"} + } + } + } + ], + "axes": [ + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "gridScale": "concat_1_concat_3_x", + "grid": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_x", + "orient": "bottom", + "grid": false, + "title": "a", + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "zindex": 0 + }, + { + "scale": "concat_1_concat_3_y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(childHeight/40)"}, + "zindex": 0 + } + ] + } + ] + } + ], + "scales": [ + { + "name": "concat_0_concat_0_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_1_x", + "type": "linear", + "domain": {"data": "data_2", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "concat_0_concat_1_y", + "type": "linear", + "domain": {"data": "data_2", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_2_x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_0_concat_3_x", + "type": "linear", + "domain": {"data": "data_3", "field": "a"}, + "range": [0, {"signal": "concat_0_childWidth"}], + "nice": true, + "zero": false + }, + { + "name": "concat_0_concat_3_y", + "type": "linear", + "domain": {"data": "data_3", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_0_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_0_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_1_x", + "type": "band", + "domain": {"data": "data_4", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "concat_1_concat_1_y", + "type": "linear", + "domain": {"data": "data_4", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_2_x", + "type": "point", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_2_y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + }, + { + "name": "concat_1_concat_3_x", + "type": "point", + "domain": {"data": "data_5", "field": "a", "sort": true}, + "range": [0, {"signal": "concat_1_childWidth"}], + "padding": 0.5 + }, + { + "name": "concat_1_concat_3_y", + "type": "linear", + "domain": {"data": "data_5", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "childHeight"}, 0], + "nice": true, + "zero": true + } + ], + "config": {"mark": {"tooltip": true}} +} diff --git a/examples/compiled/trail_comet.vg.json b/examples/compiled/trail_comet.vg.json index c98611f715..a003de90f3 100644 --- a/examples/compiled/trail_comet.vg.json +++ b/examples/compiled/trail_comet.vg.json @@ -159,7 +159,10 @@ }, "x": {"scale": "x", "field": "year"}, "y": {"scale": "y", "field": "variety"}, - "size": {"scale": "size", "field": "yield"} + "size": {"scale": "size", "field": "yield"}, + "defined": { + "signal": "isValid(datum[\"delta\"]) && isFinite(+datum[\"delta\"]) && isValid(datum[\"yield\"]) && isFinite(+datum[\"yield\"])" + } } } } diff --git a/examples/compiled/trellis_area_seattle.vg.json b/examples/compiled/trellis_area_seattle.vg.json index a4b1619cbb..b8f0d14013 100644 --- a/examples/compiled/trellis_area_seattle.vg.json +++ b/examples/compiled/trellis_area_seattle.vg.json @@ -170,7 +170,9 @@ }, "x": {"scale": "x", "field": "monthdate_date"}, "y": {"scale": "y", "field": "mean_temperature"}, - "y2": {"field": {"group": "height"}}, + "y2": { + "signal": "scale('y', inrange(0, domain('y')) ? 0 : domain('y')[0])" + }, "defined": { "signal": "isValid(datum[\"monthdate_date\"]) && isFinite(+datum[\"monthdate_date\"]) && isValid(datum[\"mean_temperature\"]) && isFinite(+datum[\"mean_temperature\"])" } diff --git a/examples/compiled/window_impute_null.png b/examples/compiled/window_impute_null.png new file mode 100644 index 0000000000..b452c85025 Binary files /dev/null and b/examples/compiled/window_impute_null.png differ diff --git a/examples/compiled/window_impute_null.svg b/examples/compiled/window_impute_null.svg new file mode 100644 index 0000000000..be0e300c8c --- /dev/null +++ b/examples/compiled/window_impute_null.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/compiled/window_impute_null.vg.json b/examples/compiled/window_impute_null.vg.json new file mode 100644 index 0000000000..922f6c5453 --- /dev/null +++ b/examples/compiled/window_impute_null.vg.json @@ -0,0 +1,182 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Using window transform to impute missing values in a line chart by averaging the previous and next values.", + "background": "white", + "padding": 5, + "width": 300, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "values": [ + {"a": "Jan 1, 2000", "b": 28}, + {"a": "Jan 2, 2000", "b": 55}, + {"a": "Jan 3, 2000", "b": null}, + {"a": "Jan 4, 2000", "b": 65}, + {"a": "Jan 5, 2000", "b": 43}, + {"a": "Jan 6, 2000", "b": null}, + {"a": "Jan 7, 2000", "b": 55}, + {"a": "Jan 8, 2000", "b": 43} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toDate(datum[\"a\"])", "as": "a"}, + { + "type": "window", + "params": [null, null], + "as": ["prev", "next"], + "ops": ["lag", "lead"], + "fields": ["b", "b"], + "sort": {"field": [], "order": []} + }, + { + "type": "formula", + "expr": "datum.b === null ? (datum.prev + datum.next)/2 : datum.b", + "as": "b" + }, + { + "field": "a", + "type": "timeunit", + "units": ["year", "month", "date"], + "as": ["yearmonthdate_a", "yearmonthdate_a_end"] + } + ] + }, + { + "name": "data_1", + "source": "data_0", + "transform": [ + { + "type": "filter", + "expr": "(isDate(datum[\"yearmonthdate_a\"]) || (isValid(datum[\"yearmonthdate_a\"]) && isFinite(+datum[\"yearmonthdate_a\"]))) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + } + ], + "marks": [ + { + "name": "layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "x"}, + "from": {"data": "data_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "description": { + "signal": "\"a (year-month-date): \" + (timeFormat(datum[\"yearmonthdate_a\"], '%d %b')) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "x", "field": "yearmonthdate_a"}, + "y": {"scale": "y", "field": "b"}, + "defined": { + "signal": "isValid(datum[\"yearmonthdate_a\"]) && isFinite(+datum[\"yearmonthdate_a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + } + } + }, + { + "name": "layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_1"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "fill": {"value": "#4c78a8"}, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"a (year-month-date): \" + (timeFormat(datum[\"yearmonthdate_a\"], '%d %b')) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "x": {"scale": "x", "field": "yearmonthdate_a"}, + "y": {"scale": "y", "field": "b"} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "time", + "domain": { + "fields": [ + {"data": "data_0", "field": "yearmonthdate_a"}, + {"data": "data_1", "field": "yearmonthdate_a"} + ] + }, + "range": [0, {"signal": "width"}] + }, + { + "name": "y", + "type": "linear", + "domain": { + "fields": [ + {"data": "data_0", "field": "b"}, + {"data": "data_1", "field": "b"} + ] + }, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "a (year-month-date)", + "format": "%d %b", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/specs/bar_invalid_color_show.vl.json b/examples/specs/bar_invalid_color_show.vl.json new file mode 100644 index 0000000000..0db82ee42f --- /dev/null +++ b/examples/specs/bar_invalid_color_show.vl.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "show", "tooltip": true} + }, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } +} diff --git a/examples/specs/bar_invalid_color_show_override.vl.json b/examples/specs/bar_invalid_color_show_override.vl.json new file mode 100644 index 0000000000..83f8874078 --- /dev/null +++ b/examples/specs/bar_invalid_color_show_override.vl.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "show", "tooltip": true}, + "scale": {"invalid": {"color": {"value": "red"}}} + }, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } +} diff --git a/examples/specs/layer_null_data.vl.json b/examples/specs/layer_null_data.vl.json new file mode 100644 index 0000000000..a095651c3f --- /dev/null +++ b/examples/specs/layer_null_data.vl.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "width": 300, + "data": { + "values": [ + {"a": "Jan 1, 2000", "b": 28}, + {"a": "Jan 2, 2000", "b": 55}, + {"a": "Jan 3, 2000", "b": null}, + {"a": "Jan 4, 2000", "b": 55}, + {"a": "Jan 5, 2000", "b": 43}, + {"a": "Jan 6, 2000", "b": null}, + {"a": "Jan 7, 2000", "b": 55}, + {"a": "Jan 8, 2000", "b": 43} + ] + }, + "layer": [{ + "mark": "line", + "encoding": { + "x": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal", "axis": {"format": "%d %b"}}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "transform": [{"filter": "datum.b === null"}], + "mark": {"type": "bar", "color": "red", "opacity": 0.2}, + "encoding": { + "x": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal", "bandPosition": 0} + } + }] +} diff --git a/examples/specs/normalized/test_invalid_break_paths_filter_domains_normalized.vl.json b/examples/specs/normalized/test_invalid_break_paths_filter_domains_normalized.vl.json new file mode 100644 index 0000000000..542bbe9ea1 --- /dev/null +++ b/examples/specs/normalized/test_invalid_break_paths_filter_domains_normalized.vl.json @@ -0,0 +1,125 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": { + "mark": {"invalid": "break-paths-filter-domains", "tooltip": true} + }, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_break_paths_show_domains_normalized.vl.json b/examples/specs/normalized/test_invalid_break_paths_show_domains_normalized.vl.json new file mode 100644 index 0000000000..2d51b7b913 --- /dev/null +++ b/examples/specs/normalized/test_invalid_break_paths_show_domains_normalized.vl.json @@ -0,0 +1,123 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": {"mark": {"invalid": "break-paths-show-domains", "tooltip": true}}, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_break_paths_show_path_domains_normalized.vl.json b/examples/specs/normalized/test_invalid_break_paths_show_path_domains_normalized.vl.json new file mode 100644 index 0000000000..ad839271ab --- /dev/null +++ b/examples/specs/normalized/test_invalid_break_paths_show_path_domains_normalized.vl.json @@ -0,0 +1,125 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": { + "mark": {"invalid": "break-paths-show-path-domains", "tooltip": true} + }, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_color_filter_but_include_in_scale_invalid_normalized.vl.json b/examples/specs/normalized/test_invalid_color_filter_but_include_in_scale_invalid_normalized.vl.json new file mode 100644 index 0000000000..96307c713e --- /dev/null +++ b/examples/specs/normalized/test_invalid_color_filter_but_include_in_scale_invalid_normalized.vl.json @@ -0,0 +1,137 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true}, + "scale": {"invalid": {"color": {"value": "red"}}} + }, + "hconcat": [ + { + "title": "Quantitative X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_color_filter_normalized.vl.json b/examples/specs/normalized/test_invalid_color_filter_normalized.vl.json new file mode 100644 index 0000000000..0f8be2c736 --- /dev/null +++ b/examples/specs/normalized/test_invalid_color_filter_normalized.vl.json @@ -0,0 +1,134 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": {"mark": {"invalid": "filter", "tooltip": true}}, + "hconcat": [ + { + "title": "Quantitative X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_color_show_normalized.vl.json b/examples/specs/normalized/test_invalid_color_show_normalized.vl.json new file mode 100644 index 0000000000..7a0404e09b --- /dev/null +++ b/examples/specs/normalized/test_invalid_color_show_normalized.vl.json @@ -0,0 +1,134 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": {"mark": {"invalid": "show", "tooltip": true}}, + "hconcat": [ + { + "title": "Quantitative X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_default_normalized.vl.json b/examples/specs/normalized/test_invalid_default_normalized.vl.json new file mode 100644 index 0000000000..2de1cae60e --- /dev/null +++ b/examples/specs/normalized/test_invalid_default_normalized.vl.json @@ -0,0 +1,123 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": {"mark": {"tooltip": true}}, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_filter_normalized.vl.json b/examples/specs/normalized/test_invalid_filter_normalized.vl.json new file mode 100644 index 0000000000..ace0547c2a --- /dev/null +++ b/examples/specs/normalized/test_invalid_filter_normalized.vl.json @@ -0,0 +1,123 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": {"mark": {"invalid": "filter", "tooltip": true}}, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_null_normalized.vl.json b/examples/specs/normalized/test_invalid_null_normalized.vl.json new file mode 100644 index 0000000000..b652b812af --- /dev/null +++ b/examples/specs/normalized/test_invalid_null_normalized.vl.json @@ -0,0 +1,123 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": {"mark": {"invalid": null, "tooltip": true}}, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_opacity_filter_but_include_in_scale_invalid_normalized.vl.json b/examples/specs/normalized/test_invalid_opacity_filter_but_include_in_scale_invalid_normalized.vl.json new file mode 100644 index 0000000000..28f6354c2c --- /dev/null +++ b/examples/specs/normalized/test_invalid_opacity_filter_but_include_in_scale_invalid_normalized.vl.json @@ -0,0 +1,137 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true}, + "scale": {"invalid": {"opacity": {"value": 0.1}}} + }, + "hconcat": [ + { + "title": "Quantitative X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_opacity_filter_normalized.vl.json b/examples/specs/normalized/test_invalid_opacity_filter_normalized.vl.json new file mode 100644 index 0000000000..6c72e57832 --- /dev/null +++ b/examples/specs/normalized/test_invalid_opacity_filter_normalized.vl.json @@ -0,0 +1,134 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": {"mark": {"invalid": "filter", "tooltip": true}}, + "hconcat": [ + { + "title": "Quantitative X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_opacity_show_normalized.vl.json b/examples/specs/normalized/test_invalid_opacity_show_normalized.vl.json new file mode 100644 index 0000000000..07d0725c4b --- /dev/null +++ b/examples/specs/normalized/test_invalid_opacity_show_normalized.vl.json @@ -0,0 +1,134 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": {"mark": {"invalid": "show", "tooltip": true}}, + "hconcat": [ + { + "title": "Quantitative X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "vconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/test_invalid_show_normalized.vl.json b/examples/specs/normalized/test_invalid_show_normalized.vl.json new file mode 100644 index 0000000000..cf661abf9c --- /dev/null +++ b/examples/specs/normalized/test_invalid_show_normalized.vl.json @@ -0,0 +1,123 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": {"mark": {"invalid": "show", "tooltip": true}}, + "vconcat": [ + { + "title": "Quantitative X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "title": "Ordinal X", + "hconcat": [ + { + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "width": 100, + "height": 100, + "layer": [ + { + "mark": "line", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + }, + { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/specs/normalized/window_impute_null_normalized.vl.json b/examples/specs/normalized/window_impute_null_normalized.vl.json new file mode 100644 index 0000000000..da3c95fced --- /dev/null +++ b/examples/specs/normalized/window_impute_null_normalized.vl.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Using window transform to impute missing values in a line chart by averaging the previous and next values.", + "width": 300, + "data": { + "values": [ + {"a": "Jan 1, 2000", "b": 28}, + {"a": "Jan 2, 2000", "b": 55}, + {"a": "Jan 3, 2000", "b": null}, + {"a": "Jan 4, 2000", "b": 65}, + {"a": "Jan 5, 2000", "b": 43}, + {"a": "Jan 6, 2000", "b": null}, + {"a": "Jan 7, 2000", "b": 55}, + {"a": "Jan 8, 2000", "b": 43} + ] + }, + "transform": [ + { + "window": [ + {"op": "lag", "field": "b", "as": "prev"}, + {"op": "lead", "field": "b", "as": "next"} + ] + }, + { + "calculate": "datum.b === null ? (datum.prev + datum.next)/2 : datum.b", + "as": "b" + } + ], + "layer": [ + { + "mark": "line", + "encoding": { + "x": { + "timeUnit": {"unit": "yearmonthdate"}, + "field": "a", + "type": "temporal", + "axis": {"format": "%d %b"} + }, + "y": {"field": "b", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true}, + "encoding": { + "x": { + "timeUnit": {"unit": "yearmonthdate"}, + "field": "a", + "type": "temporal", + "axis": {"format": "%d %b"} + }, + "y": {"field": "b", "type": "quantitative"} + } + } + ] +} \ No newline at end of file diff --git a/examples/specs/point_invalid_size_show.vl.json b/examples/specs/point_invalid_size_show.vl.json new file mode 100644 index 0000000000..14d656d08a --- /dev/null +++ b/examples/specs/point_invalid_size_show.vl.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "show"} + }, + "concat": [{ + "title": "Quantitative X", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "size": {"field": "c", "type": "quantitative"} + } + }] +} diff --git a/examples/specs/test_invalid_break_paths_filter_domains.vl.json b/examples/specs/test_invalid_break_paths_filter_domains.vl.json new file mode 100644 index 0000000000..f227bb9bb2 --- /dev/null +++ b/examples/specs/test_invalid_break_paths_filter_domains.vl.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": { + "mark": {"invalid": "break-paths-filter-domains", "tooltip": true} + }, + "vconcat": [{ + "title": "Quantitative X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_break_paths_show_domains.vl.json b/examples/specs/test_invalid_break_paths_show_domains.vl.json new file mode 100644 index 0000000000..5c8fae98dd --- /dev/null +++ b/examples/specs/test_invalid_break_paths_show_domains.vl.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": { + "mark": {"invalid": "break-paths-show-domains", "tooltip": true} + }, + "vconcat": [{ + "title": "Quantitative X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_break_paths_show_path_domains.vl.json b/examples/specs/test_invalid_break_paths_show_path_domains.vl.json new file mode 100644 index 0000000000..27f77a7c34 --- /dev/null +++ b/examples/specs/test_invalid_break_paths_show_path_domains.vl.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": { + "mark": {"invalid": "break-paths-show-path-domains", "tooltip": true} + }, + "vconcat": [{ + "title": "Quantitative X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_color_filter.vl.json b/examples/specs/test_invalid_color_filter.vl.json new file mode 100644 index 0000000000..226a0ac82b --- /dev/null +++ b/examples/specs/test_invalid_color_filter.vl.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true} + }, + "hconcat": [{ + "title": "Quantitative X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_color_filter_but_include_in_scale_invalid.vl.json b/examples/specs/test_invalid_color_filter_but_include_in_scale_invalid.vl.json new file mode 100644 index 0000000000..8b720cb5cf --- /dev/null +++ b/examples/specs/test_invalid_color_filter_but_include_in_scale_invalid.vl.json @@ -0,0 +1,100 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true}, + "scale": {"invalid": {"color": {"value": "red"}}} + }, + "hconcat": [{ + "title": "Quantitative X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_color_show.vl.json b/examples/specs/test_invalid_color_show.vl.json new file mode 100644 index 0000000000..3cbf5d5fa3 --- /dev/null +++ b/examples/specs/test_invalid_color_show.vl.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "show", "tooltip": true} + }, + "hconcat": [{ + "title": "Quantitative X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_color_size_config_scale.vl.json b/examples/specs/test_invalid_color_size_config_scale.vl.json new file mode 100644 index 0000000000..89abb80964 --- /dev/null +++ b/examples/specs/test_invalid_color_size_config_scale.vl.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true}, + "scale": {"invalid": {"color": {"value": "#aaa"}, "size": {"value": 4}}} + }, + "concat": [{ + "title": "Color", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "title": "Size", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "size": {"field": "c", "type": "quantitative"} + } + }] +} diff --git a/examples/specs/test_invalid_color_size_mark_filter_only.vl.json b/examples/specs/test_invalid_color_size_mark_filter_only.vl.json new file mode 100644 index 0000000000..14cb0ef173 --- /dev/null +++ b/examples/specs/test_invalid_color_size_mark_filter_only.vl.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true} + }, + "concat": [{ + "title": "Color", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "title": "Size", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "size": {"field": "c", "type": "quantitative"} + } + }] +} diff --git a/examples/specs/test_invalid_color_size_mark_show_only.vl.json b/examples/specs/test_invalid_color_size_mark_show_only.vl.json new file mode 100644 index 0000000000..0d9ba9f132 --- /dev/null +++ b/examples/specs/test_invalid_color_size_mark_show_only.vl.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "show", "tooltip": true} + }, + "concat": [{ + "title": "Color", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "color": {"field": "c", "type": "quantitative"} + } + }, { + "title": "Size", + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "size": {"field": "c", "type": "quantitative"} + } + }] +} diff --git a/examples/specs/test_invalid_default.vl.json b/examples/specs/test_invalid_default.vl.json index 833dc2bd82..2d16f83c3b 100644 --- a/examples/specs/test_invalid_default.vl.json +++ b/examples/specs/test_invalid_default.vl.json @@ -3,19 +3,20 @@ "description": "Testing invalid", "data": { "values": [ - {"a": null, "b": 1000}, + {"a": null, "b": 100}, {"a": -10, "b": null}, - {"a": -5, "b": 25}, - {"a": -1, "b": 20}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, {"a": 0, "b": null}, {"a": 1, "b": 30}, {"a": 5, "b": 40}, {"a": 10, "b": null} ] }, - "hconcat": [{ + "config": {"mark": {"tooltip": true}}, + "vconcat": [{ "title": "Quantitative X", - "vconcat": [{ + "hconcat": [{ "width": 100, "height": 100, "mark": "point", @@ -34,7 +35,7 @@ }, { "width": 100, "height": 100, - "mark": "line", + "mark": {"type": "line", "point": true}, "encoding": { "x": {"field": "a", "type": "quantitative"}, "y": {"field": "b", "type": "quantitative"} @@ -50,7 +51,7 @@ }] },{ "title": "Ordinal X", - "vconcat": [{ + "hconcat": [{ "width": 100, "height": 100, "mark": "point", @@ -69,7 +70,7 @@ }, { "width": 100, "height": 100, - "mark": "line", + "mark": {"type": "line", "point": true}, "encoding": { "x": {"field": "a", "type": "ordinal"}, "y": {"field": "b", "type": "quantitative"} diff --git a/examples/specs/test_invalid_filter.vl.json b/examples/specs/test_invalid_filter.vl.json index 6b904d8a4b..db2c92270d 100644 --- a/examples/specs/test_invalid_filter.vl.json +++ b/examples/specs/test_invalid_filter.vl.json @@ -3,10 +3,10 @@ "description": "Testing invalid", "data": { "values": [ - {"a": null, "b": 1000}, + {"a": null, "b": 100}, {"a": -10, "b": null}, - {"a": -5, "b": 25}, - {"a": -1, "b": 20}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, {"a": 0, "b": null}, {"a": 1, "b": 30}, {"a": 5, "b": 40}, @@ -14,11 +14,11 @@ ] }, "config": { - "mark": {"invalid": "filter"} + "mark": {"invalid": "filter", "tooltip": true} }, - "hconcat": [{ + "vconcat": [{ "title": "Quantitative X", - "vconcat": [{ + "hconcat": [{ "width": 100, "height": 100, "mark": "point", @@ -37,7 +37,7 @@ }, { "width": 100, "height": 100, - "mark": "line", + "mark": {"type": "line", "point": true}, "encoding": { "x": {"field": "a", "type": "quantitative"}, "y": {"field": "b", "type": "quantitative"} @@ -53,7 +53,7 @@ }] },{ "title": "Ordinal X", - "vconcat": [{ + "hconcat": [{ "width": 100, "height": 100, "mark": "point", @@ -72,7 +72,7 @@ }, { "width": 100, "height": 100, - "mark": "line", + "mark": {"type": "line", "point": true}, "encoding": { "x": {"field": "a", "type": "ordinal"}, "y": {"field": "b", "type": "quantitative"} diff --git a/examples/specs/test_invalid_null.vl.json b/examples/specs/test_invalid_null.vl.json index b389d96ca4..fd8eecd079 100644 --- a/examples/specs/test_invalid_null.vl.json +++ b/examples/specs/test_invalid_null.vl.json @@ -3,10 +3,10 @@ "description": "Testing invalid", "data": { "values": [ - {"a": null, "b": 1000}, + {"a": null, "b": 100}, {"a": -10, "b": null}, - {"a": -5, "b": 25}, - {"a": -1, "b": 20}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, {"a": 0, "b": null}, {"a": 1, "b": 30}, {"a": 5, "b": 40}, @@ -14,11 +14,11 @@ ] }, "config": { - "mark": {"invalid": null} + "mark": {"invalid": null, "tooltip": true} }, - "hconcat": [{ + "vconcat": [{ "title": "Quantitative X", - "vconcat": [{ + "hconcat": [{ "width": 100, "height": 100, "mark": "point", @@ -37,7 +37,7 @@ }, { "width": 100, "height": 100, - "mark": "line", + "mark": {"type": "line", "point": true}, "encoding": { "x": {"field": "a", "type": "quantitative"}, "y": {"field": "b", "type": "quantitative"} @@ -53,7 +53,7 @@ }] },{ "title": "Ordinal X", - "vconcat": [{ + "hconcat": [{ "width": 100, "height": 100, "mark": "point", @@ -72,7 +72,7 @@ }, { "width": 100, "height": 100, - "mark": "line", + "mark": {"type": "line", "point": true}, "encoding": { "x": {"field": "a", "type": "ordinal"}, "y": {"field": "b", "type": "quantitative"} diff --git a/examples/specs/test_invalid_opacity_filter.vl.json b/examples/specs/test_invalid_opacity_filter.vl.json new file mode 100644 index 0000000000..549069f712 --- /dev/null +++ b/examples/specs/test_invalid_opacity_filter.vl.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true} + }, + "hconcat": [{ + "title": "Quantitative X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_opacity_filter_but_include_in_scale_invalid.vl.json b/examples/specs/test_invalid_opacity_filter_but_include_in_scale_invalid.vl.json new file mode 100644 index 0000000000..61db197bca --- /dev/null +++ b/examples/specs/test_invalid_opacity_filter_but_include_in_scale_invalid.vl.json @@ -0,0 +1,100 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "filter", "tooltip": true}, + "scale": {"invalid": {"opacity": {"value": 0.1}}} + }, + "hconcat": [{ + "title": "Quantitative X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_opacity_show.vl.json b/examples/specs/test_invalid_opacity_show.vl.json new file mode 100644 index 0000000000..9720bc5818 --- /dev/null +++ b/examples/specs/test_invalid_opacity_show.vl.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": 1, "b": 15, "c": 1}, + {"a": 2, "b": 25, "c": 1}, + {"a": 3, "b": 20, "c": 1}, + {"a": 1, "b": 12, "c": 2}, + {"a": 2, "b": 21, "c": 2}, + {"a": 3, "b": 29, "c": 2}, + {"a": 1, "b": 8, "c": null}, + {"a": 2, "b": 31, "c": null}, + {"a": 3, "b": 49, "c": null} + ] + }, + "config": { + "mark": {"invalid": "show", "tooltip": true} + }, + "hconcat": [{ + "title": "Quantitative X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "vconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + "opacity": {"field": "c", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/test_invalid_show.vl.json b/examples/specs/test_invalid_show.vl.json new file mode 100644 index 0000000000..6acafb9241 --- /dev/null +++ b/examples/specs/test_invalid_show.vl.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Testing invalid", + "data": { + "values": [ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} + ] + }, + "config": { + "mark": {"invalid": "show", "tooltip": true} + }, + "vconcat": [{ + "title": "Quantitative X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "quantitative"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + },{ + "title": "Ordinal X", + "hconcat": [{ + "width": 100, + "height": 100, + "mark": "point", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }, { + "width": 100, + "height": 100, + "mark": "area", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + }] + }] +} diff --git a/examples/specs/window_impute_null.vl.json b/examples/specs/window_impute_null.vl.json new file mode 100644 index 0000000000..cfe3da858d --- /dev/null +++ b/examples/specs/window_impute_null.vl.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Using window transform to impute missing values in a line chart by averaging the previous and next values.", + "width": 300, + "data": { + "values": [ + {"a": "Jan 1, 2000", "b": 28}, + {"a": "Jan 2, 2000", "b": 55}, + {"a": "Jan 3, 2000", "b": null}, + {"a": "Jan 4, 2000", "b": 65}, + {"a": "Jan 5, 2000", "b": 43}, + {"a": "Jan 6, 2000", "b": null}, + {"a": "Jan 7, 2000", "b": 55}, + {"a": "Jan 8, 2000", "b": 43} + ] + }, + "transform": [{ + "window": [{ + "op": "lag", + "field": "b", + "as": "prev" + },{ + "op": "lead", + "field": "b", + "as": "next" + }] + }, { + "calculate": "datum.b === null ? (datum.prev + datum.next)/2 : datum.b", + "as": "b" + }], + "mark": {"type": "line", "point": true}, + "encoding": { + "x": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal", "axis": {"format": "%d %b"}}, + "y": {"field": "b", "type": "quantitative"} + } +} diff --git a/site/Gemfile.lock b/site/Gemfile.lock index 100fc23c8d..8daf23b2d3 100644 --- a/site/Gemfile.lock +++ b/site/Gemfile.lock @@ -33,10 +33,8 @@ GEM ffi (>= 1.15.0) eventmachine (1.2.7) execjs (2.9.1) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) - net-http + faraday (2.0.0) + ruby2_keywords (>= 0.0.4) ffi (1.16.3) forwardable-extended (2.6.0) gemoji (4.1.0) @@ -220,13 +218,11 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.22.2) mutex_m (0.2.0) - net-http (0.4.1) - uri - nokogiri (1.16.5-arm64-darwin) + nokogiri (1.15.6-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-darwin) + nokogiri (1.15.6-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.15.6-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) @@ -241,6 +237,7 @@ GEM rexml (3.2.8) strscan (>= 3.0.9) rouge (3.30.0) + ruby2_keywords (0.0.5) rubyzip (2.3.2) safe_yaml (1.0.5) sass (3.7.4) @@ -264,7 +261,6 @@ GEM unf_ext unf_ext (0.0.9.1) unicode-display_width (1.8.0) - uri (0.13.0) webrick (1.8.1) PLATFORMS @@ -281,4 +277,4 @@ DEPENDENCIES webrick (~> 1.7) BUNDLED WITH - 2.2.32 + 2.4.22 diff --git a/site/_data/examples.json b/site/_data/examples.json index a04bc1af32..99568b67ea 100644 --- a/site/_data/examples.json +++ b/site/_data/examples.json @@ -520,6 +520,10 @@ { "name": "layer_point_line_loess", "title": "Loess Regression" + }, + { + "name": "window_impute_null", + "title": "Using window transform to impute missing values by averaging the previous and next values." } ] }, diff --git a/site/_data/versions.yml b/site/_data/versions.yml new file mode 100644 index 0000000000..4326f76f45 --- /dev/null +++ b/site/_data/versions.yml @@ -0,0 +1,4 @@ +vega: 5.28.0 +vega-lite: 5.18.1 +vega-embed: 6.25.0 +vega-tooltip: 0.34.0 diff --git a/site/_includes/docs_toc.md b/site/_includes/docs_toc.md index c1d1174988..db73d65914 100644 --- a/site/_includes/docs_toc.md +++ b/site/_includes/docs_toc.md @@ -381,3 +381,8 @@ - [Tooltip image]({{site.baseurl}}/docs/tooltip.html#tooltip-image) - [Disable tooltips]({{site.baseurl}}/docs/tooltip.html#disable-tooltips) - [Vega Tooltip plugin]({{site.baseurl}}/docs/tooltip.html#plugin) +- [Invalid Data]({{site.baseurl}}/docs/invalid-data.html) + - [Documentation Overview]({{site.baseurl}}/docs/invalid-data.html#documentation-overview) + - [Mark Invalid Mode]({{site.baseurl}}/docs/invalid-data.html#mark-invalid-mode) + - [Scale Output for Invalid Values]({{site.baseurl}}/docs/invalid-data.html#scale-output-for-invalid-values) + - [Other solutions]({{site.baseurl}}/docs/invalid-data.html#other-solutions) diff --git a/site/_layouts/docs.html b/site/_layouts/docs.html index 5dc0b66848..f6092e8602 100644 --- a/site/_layouts/docs.html +++ b/site/_layouts/docs.html @@ -169,6 +169,8 @@ url: predicate - text: Tooltip url: tooltip + - text: Invalid Data + url: invalid-data base: /docs/ --- diff --git a/site/docs/encoding/scale.md b/site/docs/encoding/scale.md index 86673fb955..8a5c6f9e2c 100644 --- a/site/docs/encoding/scale.md +++ b/site/docs/encoding/scale.md @@ -454,6 +454,10 @@ To provide themes for all scales, the scale config (`config: {scale: {...}}`) ca {% include table.html props="maxBandSize,minBandSize,maxFontSize,minFontSize,maxOpacity,minOpacity,maxSize,minSize,maxStrokeWidth,minStrokeWidth" source="ScaleConfig" %} +#### Scale Output for Invalid Values + +{% include table.html props="invalid" source="ScaleConfig" %} + #### Other {% include table.html props="clamp,round,xReverse,useUnaggregatedDomain,zero" source="ScaleConfig" %} diff --git a/site/docs/invaliddata.md b/site/docs/invaliddata.md new file mode 100644 index 0000000000..378e15faae --- /dev/null +++ b/site/docs/invaliddata.md @@ -0,0 +1,137 @@ +--- +layout: docs +menu: docs +title: Modes for Handling Invalid Data +permalink: /docs/invalid-data.html +--- + +This page discusses modes in Vega-Lite for handling invalid data (`null` and `NaN` in continuous scales). + +The main configurations are [`mark.invalid`](#mark) and [`config.scale.invalid`](#scale). In addition, you can use [other Vega-Lite features including conditional encodings, layering, or window transform to handle invalid and missing data](#other). + +Note: Vega-Lite does _not_ consider `null` and `NaN` in categorical scales and text encodings as invalid data: + +- Categorical scales can treat nulls and NaNs as separate categories +- Similarly, text encodings can directly display nulls and NaNs. + + +## Documentation Overview +{:.no_toc} + +- TOC +{:toc} + + + +## Mark Invalid Mode + +{:#mark} + +You can use `mark.invalid` (or `config.mark.invalid`) to configure how marks and their corresponding scales handle invalid data (`null` and `NaN` in continuous scales). + +{% include table.html props="invalid" source="MarkDef" %} + +### Examples + +To understand how these modes affect common marks, see these examples below, which visualize this dataset: + +```json +[ + {"a": null, "b": 100}, + {"a": -10, "b": null}, + {"a": -5, "b": -25}, + {"a": -1, "b": -20}, + {"a": 0, "b": null}, + {"a": 1, "b": 30}, + {"a": 5, "b": 40}, + {"a": 10, "b": null} +] +``` + +by assigning `"a"` to x-axis (as quantitative and ordinal fields) and `"b"` to y-axis. + +
+ +#### `"filter"` + +The `"filter"` invalid mode _excludes_ all invalid values from the visualization's _marks_ and _scales_. + +For path marks (for line, area, trail), this option will create paths that connect valid points, as if the points with invalid values do not exist. + + + +#### `"break-paths"` + +Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `"filter"`. All _scale_ domains will _exclude_ these filtered data points. + + + +#### `"break-paths-show-domains"` + +This option is like `"break-paths"`, except that all _scale_ domains will instead _include_ these filtered data points. + + + +#### `"show"` + +Include all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero). + + + +#### `"break-paths-show-path-domains"` (Default) + +For historical reasons, Vega-Lite 5 currently uses `"break-paths-show-path-domains"` as the default invalid data mode (to avoid breaking changes). This is equivalent to `"break-path-keep-domains"` for path-based marks (line/area/trail) and `"filter"` for other marks. + + + +## Scale Output for Invalid Values + +{:#scale} + +You can use `config.scale.invalid` to defines scale outputs per channel for invalid values. + +{% include table.html props="invalid" source="ScaleConfig" %} + +### Example: Output Color and Size with "Filter" Mode + +A visualization with `"filter"` invalid data mode will not filter (not exclude) color and size encoding if `config.scale.invalid.color` and `config.scale.invalid.size` are specified. + + + +Compare this with a similar spec, but without `config.scale.invalid`: + + + +### Example: Output Color with "Show" Mode + +As discussed earlier, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero). + + + +However, you may use `config.scale.invalid` to override the output for invalid data values: + + + +## Other solutions + +{:#other} + +Note that `mark.invalid` and `config.scale.invalid` are options for handling invalid data _without_ changing data or marks. + +However, you may use other Vega-Lite features such as conditional encoding, layering, and window transforms to encode invalid data. + +### Example: Conditional Encoding + +If you do not use color encoding, you may use conditional color encoding to use a specific color (e.g., gray) to encode invalid values. + + + +### Example: Layering + +You may also use different marks (such as bars) to encode null data. + + + +### Example: Using window transform to impute missing values + + diff --git a/site/docs/transform/window.md b/site/docs/transform/window.md index c769be0d2d..846f8f4a06 100644 --- a/site/docs/transform/window.md +++ b/site/docs/transform/window.md @@ -117,3 +117,7 @@ Here we use window transform to visualize how the average MPG for vehicles have ### Percent of Total The window transform _can_ be used to compute an aggregate and attach it to all records in order to derive a percent of total, however, a simpler approach is to use the [join aggregate](joinaggregate.html) transform instead. + +### Using window transform to impute missing values + + diff --git a/site/static/main.css b/site/static/main.css index 7eb4016836..d2f0180d9b 100644 --- a/site/static/main.css +++ b/site/static/main.css @@ -687,6 +687,9 @@ footer .edit-page { display: none; } +.code-only .example-vis { + display: none; +} .example .example-code { flex: 1.618 1 0; margin: 0; diff --git a/src/channel.ts b/src/channel.ts index a359383603..a66d21143e 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -480,7 +480,7 @@ const SCALE_CHANNEL_INDEX = { export const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX); export type ScaleChannel = (typeof SCALE_CHANNELS)[number]; -export function isScaleChannel(channel: Channel): channel is ScaleChannel { +export function isScaleChannel(channel: ExtendedChannel): channel is ScaleChannel { return !!SCALE_CHANNEL_INDEX[channel]; } diff --git a/src/compile/data/filterinvalid.ts b/src/compile/data/filterinvalid.ts index 2a85a69091..2d20b9e3c0 100644 --- a/src/compile/data/filterinvalid.ts +++ b/src/compile/data/filterinvalid.ts @@ -1,12 +1,12 @@ import {FilterTransform as VgFilterTransform} from 'vega'; import {isScaleChannel} from '../../channel'; import {TypedFieldDef, vgField as fieldRef} from '../../channeldef'; -import {isPathMark} from '../../mark'; -import {hasContinuousDomain} from '../../scale'; import {Dict, hash, keys} from '../../util'; -import {getMarkPropOrConfig} from '../common'; +import {getScaleInvalidDataMode} from '../invalid/ScaleInvalidDataMode'; +import {DataSourcesForHandlingInvalidValues} from '../invalid/datasources'; import {UnitModel} from '../unit'; import {DataFlowNode} from './dataflow'; +import {isCountingAggregateOp} from '../../aggregate'; export class FilterInvalidNode extends DataFlowNode { public clone() { @@ -20,27 +20,40 @@ export class FilterInvalidNode extends DataFlowNode { super(parent); } - public static make(parent: DataFlowNode, model: UnitModel): FilterInvalidNode { - const {config, mark, markDef} = model; + public static make( + parent: DataFlowNode, + model: UnitModel, + dataSourcesForHandlingInvalidValues: DataSourcesForHandlingInvalidValues + ): FilterInvalidNode { + const {config, markDef} = model; - const invalid = getMarkPropOrConfig('invalid', markDef, config); - if (invalid !== 'filter') { + const {marks, scales} = dataSourcesForHandlingInvalidValues; + if (marks === 'include-invalid-values' && scales === 'include-invalid-values') { + // If neither marks nor scale domains need data source to filter null values, then don't add the filter. return null; } const filter = model.reduceFieldDef( (aggregator: Dict