diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json
index 104d8bb29c..32456fbdbb 100644
--- a/build/vega-lite-schema.json
+++ b/build/vega-lite-schema.json
@@ -676,9 +676,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -3531,9 +3534,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -15203,9 +15209,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -16343,9 +16352,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -17239,9 +17251,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -18731,9 +18746,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -21016,9 +21034,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
@@ -27803,6 +27824,11 @@
],
"description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks."
},
+ "binSpacing": {
+ "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`",
+ "minimum": 0,
+ "type": "number"
+ },
"blend": {
"anyOf": [
{
@@ -27828,6 +27854,11 @@
],
"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`."
},
+ "continuousBandSize": {
+ "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`",
+ "minimum": 0,
+ "type": "number"
+ },
"cornerRadius": {
"anyOf": [
{
@@ -27916,6 +27947,18 @@
}
]
},
+ "discreteBandSize": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
+ }
+ ],
+ "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.",
+ "minimum": 0
+ },
"dx": {
"anyOf": [
{
@@ -28128,6 +28171,17 @@
}
]
},
+ "minBandSize": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "$ref": "#/definitions/ExprRef"
+ }
+ ],
+ "description": "The minimum band size for bar and rectangle marks. __Default value:__ `0.25`"
+ },
"opacity": {
"anyOf": [
{
@@ -28224,9 +28278,12 @@
},
{
"$ref": "#/definitions/ExprRef"
+ },
+ {
+ "$ref": "#/definitions/RelativeBandSize"
}
],
- "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.",
+ "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, or relative band size (e.g., `{\"band\": 0.5}` is half of the band).\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
},
"smooth": {
diff --git a/examples/compiled/bar.vg.json b/examples/compiled/bar.vg.json
index a7403201ad..c6c1b67b80 100644
--- a/examples/compiled/bar.vg.json
+++ b/examples/compiled/bar.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_aggregate.svg b/examples/compiled/bar_aggregate.svg
index d77986d027..f51c451a2f 100644
--- a/examples/compiled/bar_aggregate.svg
+++ b/examples/compiled/bar_aggregate.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_aggregate.vg.json b/examples/compiled/bar_aggregate.vg.json
index 034f12aaf4..9be1a32840 100644
--- a/examples/compiled/bar_aggregate.vg.json
+++ b/examples/compiled/bar_aggregate.vg.json
@@ -48,7 +48,7 @@
},
"x": {"scale": "x", "field": "sum_people"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "age"},
+ "yc": {"scale": "y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_aggregate_format.svg b/examples/compiled/bar_aggregate_format.svg
index 168786b2f7..43fd25104d 100644
--- a/examples/compiled/bar_aggregate_format.svg
+++ b/examples/compiled/bar_aggregate_format.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_aggregate_format.vg.json b/examples/compiled/bar_aggregate_format.vg.json
index ef2b5a09f1..5bbc805099 100644
--- a/examples/compiled/bar_aggregate_format.vg.json
+++ b/examples/compiled/bar_aggregate_format.vg.json
@@ -48,7 +48,7 @@
},
"x": {"scale": "x", "field": "sum_people"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "age"},
+ "yc": {"scale": "y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_aggregate_size.png b/examples/compiled/bar_aggregate_size.png
index 88e9429e37..6440723fb9 100644
Binary files a/examples/compiled/bar_aggregate_size.png and b/examples/compiled/bar_aggregate_size.png differ
diff --git a/examples/compiled/bar_aggregate_size.svg b/examples/compiled/bar_aggregate_size.svg
index 59a3b4dd3a..b4ee66e154 100644
--- a/examples/compiled/bar_aggregate_size.svg
+++ b/examples/compiled/bar_aggregate_size.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_aggregate_size.vg.json b/examples/compiled/bar_aggregate_size.vg.json
index 355edfa255..acdb2403c0 100644
--- a/examples/compiled/bar_aggregate_size.vg.json
+++ b/examples/compiled/bar_aggregate_size.vg.json
@@ -46,7 +46,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\"))"
},
- "xc": {"scale": "x", "field": "age", "band": 0.5},
+ "x": {"scale": "x", "field": "age"},
"width": {"value": 10},
"y": {"scale": "y", "field": "sum_people"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_aggregate_sort_by_encoding.svg b/examples/compiled/bar_aggregate_sort_by_encoding.svg
index 7a66875d85..6a07efa26c 100644
--- a/examples/compiled/bar_aggregate_sort_by_encoding.svg
+++ b/examples/compiled/bar_aggregate_sort_by_encoding.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_aggregate_sort_by_encoding.vg.json b/examples/compiled/bar_aggregate_sort_by_encoding.vg.json
index de6fe777a0..4e7ea808f4 100644
--- a/examples/compiled/bar_aggregate_sort_by_encoding.vg.json
+++ b/examples/compiled/bar_aggregate_sort_by_encoding.vg.json
@@ -52,7 +52,7 @@
},
"x": {"scale": "x", "field": "sum_people"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "age"},
+ "yc": {"scale": "y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_aggregate_sort_mean.vg.json b/examples/compiled/bar_aggregate_sort_mean.vg.json
index 4973b4a9c2..102ccc9e0d 100644
--- a/examples/compiled/bar_aggregate_sort_mean.vg.json
+++ b/examples/compiled/bar_aggregate_sort_mean.vg.json
@@ -52,7 +52,7 @@
},
"x": {"scale": "x", "field": "sum_people"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "age"},
+ "yc": {"scale": "y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_aggregate_transform.vg.json b/examples/compiled/bar_aggregate_transform.vg.json
index 2d3a70d941..d0318109ff 100644
--- a/examples/compiled/bar_aggregate_transform.vg.json
+++ b/examples/compiled/bar_aggregate_transform.vg.json
@@ -52,7 +52,7 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; mean_acc: \" + (format(datum[\"mean_acc\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_acc_end"},
"y2": {"scale": "y", "field": "mean_acc_start"}
diff --git a/examples/compiled/bar_aggregate_vertical.vg.json b/examples/compiled/bar_aggregate_vertical.vg.json
index 4691e64ce7..03a1ab412e 100644
--- a/examples/compiled/bar_aggregate_vertical.vg.json
+++ b/examples/compiled/bar_aggregate_vertical.vg.json
@@ -44,7 +44,7 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Mean of Acceleration: \" + (format(datum[\"mean_Acceleration\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_Acceleration"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_argmax.vg.json b/examples/compiled/bar_argmax.vg.json
index 13f7d7dd35..8f8455f101 100644
--- a/examples/compiled/bar_argmax.vg.json
+++ b/examples/compiled/bar_argmax.vg.json
@@ -50,7 +50,7 @@
"field": "argmax_US Gross[\"Production Budget\"]"
},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "Major Genre"},
+ "yc": {"scale": "y", "field": "Major Genre", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_argmax_transform.vg.json b/examples/compiled/bar_argmax_transform.vg.json
index 850047557f..9a64cb5a7b 100644
--- a/examples/compiled/bar_argmax_transform.vg.json
+++ b/examples/compiled/bar_argmax_transform.vg.json
@@ -69,7 +69,7 @@
"scale": "x",
"field": "argmax_US_Gross\\.Production Budget\\._start"
},
- "y": {"scale": "y", "field": "Major Genre"},
+ "yc": {"scale": "y", "field": "Major Genre", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_array_aggregate.vg.json b/examples/compiled/bar_array_aggregate.vg.json
index 6ff6f5ea89..58213b38a4 100644
--- a/examples/compiled/bar_array_aggregate.vg.json
+++ b/examples/compiled/bar_array_aggregate.vg.json
@@ -57,7 +57,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; Average of b: \" + (format(datum[\"average_b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "average_b"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_axis_orient.vg.json b/examples/compiled/bar_axis_orient.vg.json
index 53f1126461..440d57dae3 100644
--- a/examples/compiled/bar_axis_orient.vg.json
+++ b/examples/compiled/bar_axis_orient.vg.json
@@ -70,7 +70,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_axis_space_saving.vg.json b/examples/compiled/bar_axis_space_saving.vg.json
index c204ae6671..efa231053f 100644
--- a/examples/compiled/bar_axis_space_saving.vg.json
+++ b/examples/compiled/bar_axis_space_saving.vg.json
@@ -42,7 +42,7 @@
},
"x": {"scale": "x", "field": "__count"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "Origin", "offset": 5, "band": 0.25},
+ "yc": {"scale": "y", "field": "Origin", "offset": 5, "band": 0.5},
"height": {"signal": "max(0.25, 0.5 * bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_axis_title_quoted.vg.json b/examples/compiled/bar_axis_title_quoted.vg.json
index bda80bd031..6133b94709 100644
--- a/examples/compiled/bar_axis_title_quoted.vg.json
+++ b/examples/compiled/bar_axis_title_quoted.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"\\\"Quoted\\\" Title: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_bullet_expr_bind.vg.json b/examples/compiled/bar_bullet_expr_bind.vg.json
index c23e4af0f5..c7372ba294 100644
--- a/examples/compiled/bar_bullet_expr_bind.vg.json
+++ b/examples/compiled/bar_bullet_expr_bind.vg.json
@@ -272,10 +272,10 @@
"description": {
"signal": "\"markers[0]: \" + (format(datum[\"markers.0\"], \"\"))"
},
+ "width": {"value": 2},
"xc": {"scale": "x", "field": "markers\\.0"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"signal": "height"},
- "width": {"value": 2}
+ "height": {"signal": "height"}
}
}
}
diff --git a/examples/compiled/bar_color_disabled_scale.vg.json b/examples/compiled/bar_color_disabled_scale.vg.json
index 1f95862e5d..700f8e5fa9 100644
--- a/examples/compiled/bar_color_disabled_scale.vg.json
+++ b/examples/compiled/bar_color_disabled_scale.vg.json
@@ -53,7 +53,7 @@
"description": {
"signal": "\"color: \" + (isValid(datum[\"color\"]) ? datum[\"color\"] : \"\"+datum[\"color\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "color"},
+ "xc": {"scale": "x", "field": "color", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_column_fold.vg.json b/examples/compiled/bar_column_fold.vg.json
index 77675fa56d..f27b443114 100644
--- a/examples/compiled/bar_column_fold.vg.json
+++ b/examples/compiled/bar_column_fold.vg.json
@@ -137,7 +137,7 @@
"description": {
"signal": "\"country: \" + (isValid(datum[\"country\"]) ? datum[\"country\"] : \"\"+datum[\"country\"]) + \"; value: \" + (format(datum[\"value\"], \"\"))"
},
- "x": {"scale": "x", "field": "country"},
+ "xc": {"scale": "x", "field": "country", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "value_end"},
"y2": {"scale": "y", "field": "value_start"}
diff --git a/examples/compiled/bar_column_pivot.vg.json b/examples/compiled/bar_column_pivot.vg.json
index e66f5a1ea3..e7372b2ad7 100644
--- a/examples/compiled/bar_column_pivot.vg.json
+++ b/examples/compiled/bar_column_pivot.vg.json
@@ -64,7 +64,7 @@
"description": {
"signal": "\"country: \" + (isValid(datum[\"country\"]) ? datum[\"country\"] : \"\"+datum[\"country\"]) + \"; gold: \" + (format(datum[\"gold\"], \"\"))"
},
- "x": {"scale": "x", "field": "country"},
+ "xc": {"scale": "x", "field": "country", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "gold_end"},
"y2": {"scale": "y", "field": "gold_start"}
diff --git a/examples/compiled/bar_config_no_zero.vg.json b/examples/compiled/bar_config_no_zero.vg.json
index a7403201ad..c6c1b67b80 100644
--- a/examples/compiled/bar_config_no_zero.vg.json
+++ b/examples/compiled/bar_config_no_zero.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_corner_radius_end.vg.json b/examples/compiled/bar_corner_radius_end.vg.json
index 6c1a57b614..3ff9d0eedb 100644
--- a/examples/compiled/bar_corner_radius_end.vg.json
+++ b/examples/compiled/bar_corner_radius_end.vg.json
@@ -62,7 +62,7 @@
},
"encode": {
"update": {
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {
"signal": "min(scale('y',datum[\"min_b_start\"]),scale('y',datum[\"max_b_start\"]),scale('y',datum[\"min_b_end\"]),scale('y',datum[\"max_b_end\"]))"
diff --git a/examples/compiled/bar_count_minimap.svg b/examples/compiled/bar_count_minimap.svg
index f1b158d15a..d88c8e6aaf 100644
--- a/examples/compiled/bar_count_minimap.svg
+++ b/examples/compiled/bar_count_minimap.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_count_minimap.vg.json b/examples/compiled/bar_count_minimap.vg.json
index da5f50f1c4..8e04c38612 100644
--- a/examples/compiled/bar_count_minimap.vg.json
+++ b/examples/compiled/bar_count_minimap.vg.json
@@ -91,7 +91,7 @@
},
"x": {"scale": "concat_0_x", "field": "__count"},
"x2": {"scale": "concat_0_x", "value": 0},
- "y": {"scale": "concat_0_y", "field": "Name"},
+ "yc": {"scale": "concat_0_y", "field": "Name", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_0_y'))"}
}
}
@@ -361,7 +361,7 @@
},
"x": {"scale": "concat_1_x", "field": "__count"},
"x2": {"scale": "concat_1_x", "value": 0},
- "y": {"scale": "concat_1_y", "field": "Name"},
+ "yc": {"scale": "concat_1_y", "field": "Name", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_1_y'))"}
}
}
diff --git a/examples/compiled/bar_custom_sort_full.vg.json b/examples/compiled/bar_custom_sort_full.vg.json
index 7a444d9ab3..bdce4645b1 100644
--- a/examples/compiled/bar_custom_sort_full.vg.json
+++ b/examples/compiled/bar_custom_sort_full.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_custom_sort_partial.vg.json b/examples/compiled/bar_custom_sort_partial.vg.json
index 6828a9c6a4..1ae4651a53 100644
--- a/examples/compiled/bar_custom_sort_partial.vg.json
+++ b/examples/compiled/bar_custom_sort_partial.vg.json
@@ -66,7 +66,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_default_tooltip_title_null.vg.json b/examples/compiled/bar_default_tooltip_title_null.vg.json
index 22a9c5dfb0..2ab40a5a44 100644
--- a/examples/compiled/bar_default_tooltip_title_null.vg.json
+++ b/examples/compiled/bar_default_tooltip_title_null.vg.json
@@ -62,7 +62,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_distinct.vg.json b/examples/compiled/bar_distinct.vg.json
index 17721c5355..e3940332e3 100644
--- a/examples/compiled/bar_distinct.vg.json
+++ b/examples/compiled/bar_distinct.vg.json
@@ -44,7 +44,7 @@
"description": {
"signal": "\"Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Distinct of Name: \" + (format(datum[\"distinct_Name\"], \"\"))"
},
- "x": {"scale": "x", "field": "Origin"},
+ "xc": {"scale": "x", "field": "Origin", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "distinct_Name"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_diverging_stack_population_pyramid.svg b/examples/compiled/bar_diverging_stack_population_pyramid.svg
index 9c895fe36f..14fdc8e6ea 100644
--- a/examples/compiled/bar_diverging_stack_population_pyramid.svg
+++ b/examples/compiled/bar_diverging_stack_population_pyramid.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_diverging_stack_population_pyramid.vg.json b/examples/compiled/bar_diverging_stack_population_pyramid.vg.json
index e0afae68d8..69ab526365 100644
--- a/examples/compiled/bar_diverging_stack_population_pyramid.vg.json
+++ b/examples/compiled/bar_diverging_stack_population_pyramid.vg.json
@@ -66,7 +66,7 @@
},
"x": {"scale": "x", "field": "sum_signed_people_end"},
"x2": {"scale": "x", "field": "sum_signed_people_start"},
- "y": {"scale": "y", "field": "age"},
+ "yc": {"scale": "y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_diverging_stack_transform.vg.json b/examples/compiled/bar_diverging_stack_transform.vg.json
index 499eb20a72..d237723efc 100644
--- a/examples/compiled/bar_diverging_stack_transform.vg.json
+++ b/examples/compiled/bar_diverging_stack_transform.vg.json
@@ -311,7 +311,7 @@
},
"x": {"scale": "x", "field": "nx"},
"x2": {"scale": "x", "field": "nx2"},
- "y": {"scale": "y", "field": "question"},
+ "yc": {"scale": "y", "field": "question", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_filter_calc.vg.json b/examples/compiled/bar_filter_calc.vg.json
index ddaf50dcb1..7bbf75381a 100644
--- a/examples/compiled/bar_filter_calc.vg.json
+++ b/examples/compiled/bar_filter_calc.vg.json
@@ -61,7 +61,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b2: \" + (format(datum[\"b2\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b2_end"},
"y2": {"scale": "y", "field": "b2_start"}
diff --git a/examples/compiled/bar_fit.svg b/examples/compiled/bar_fit.svg
index 8d7fa51e0e..0c9933379d 100644
--- a/examples/compiled/bar_fit.svg
+++ b/examples/compiled/bar_fit.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_fit.vg.json b/examples/compiled/bar_fit.vg.json
index bd1f49f679..c1ab4f5f84 100644
--- a/examples/compiled/bar_fit.vg.json
+++ b/examples/compiled/bar_fit.vg.json
@@ -54,7 +54,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_gantt.vg.json b/examples/compiled/bar_gantt.vg.json
index 4fd65adfac..391dd4b7a4 100644
--- a/examples/compiled/bar_gantt.vg.json
+++ b/examples/compiled/bar_gantt.vg.json
@@ -47,7 +47,7 @@
},
"x": {"scale": "x", "field": "start"},
"x2": {"scale": "x", "field": "end"},
- "y": {"scale": "y", "field": "task"},
+ "yc": {"scale": "y", "field": "task", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_gantt_config_no_zero.vg.json b/examples/compiled/bar_gantt_config_no_zero.vg.json
index 47a431f9b6..9b16c4c282 100644
--- a/examples/compiled/bar_gantt_config_no_zero.vg.json
+++ b/examples/compiled/bar_gantt_config_no_zero.vg.json
@@ -47,7 +47,7 @@
},
"x": {"scale": "x", "field": "start"},
"x2": {"scale": "x", "field": "end"},
- "y": {"scale": "y", "field": "task"},
+ "yc": {"scale": "y", "field": "task", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_grouped.vg.json b/examples/compiled/bar_grouped.vg.json
index 23798b9f9d..88a62de25c 100644
--- a/examples/compiled/bar_grouped.vg.json
+++ b/examples/compiled/bar_grouped.vg.json
@@ -61,10 +61,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/bar_grouped_custom_padding.vg.json b/examples/compiled/bar_grouped_custom_padding.vg.json
index b6916729ed..0433c0ffce 100644
--- a/examples/compiled/bar_grouped_custom_padding.vg.json
+++ b/examples/compiled/bar_grouped_custom_padding.vg.json
@@ -58,10 +58,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/bar_grouped_discrete_bandsize.png b/examples/compiled/bar_grouped_discrete_bandsize.png
new file mode 100644
index 0000000000..d46950f8ca
Binary files /dev/null and b/examples/compiled/bar_grouped_discrete_bandsize.png differ
diff --git a/examples/compiled/bar_grouped_discrete_bandsize.svg b/examples/compiled/bar_grouped_discrete_bandsize.svg
new file mode 100644
index 0000000000..a32110aec9
--- /dev/null
+++ b/examples/compiled/bar_grouped_discrete_bandsize.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_discrete_bandsize.vg.json b/examples/compiled/bar_grouped_discrete_bandsize.vg.json
new file mode 100644
index 0000000000..7cc3720e98
--- /dev/null
+++ b/examples/compiled/bar_grouped_discrete_bandsize.vg.json
@@ -0,0 +1,142 @@
+{
+ "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "background": "white",
+ "padding": 5,
+ "height": 200,
+ "style": "cell",
+ "data": [
+ {
+ "name": "source_0",
+ "values": [
+ {"category": "A", "group": "x", "value": 0.1},
+ {"category": "A", "group": "y", "value": 0.6},
+ {"category": "A", "group": "z", "value": 0.9},
+ {"category": "B", "group": "x", "value": 0.7},
+ {"category": "B", "group": "y", "value": 0.2},
+ {"category": "B", "group": "z", "value": 1.1},
+ {"category": "C", "group": "x", "value": 0.6},
+ {"category": "C", "group": "y", "value": 0.1},
+ {"category": "C", "group": "z", "value": 0.2}
+ ]
+ },
+ {
+ "name": "data_0",
+ "source": "source_0",
+ "transform": [
+ {
+ "type": "stack",
+ "groupby": ["category", "group"],
+ "field": "value",
+ "sort": {"field": [], "order": []},
+ "as": ["value_start", "value_end"],
+ "offset": "zero"
+ },
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"value\"]) && isFinite(+datum[\"value\"])"
+ }
+ ]
+ }
+ ],
+ "signals": [
+ {
+ "name": "x_step",
+ "update": "20 * bandspace(domain('xOffset').length, 0, 0) / (1-0.2)"
+ },
+ {
+ "name": "width",
+ "update": "bandspace(domain('x').length, 0.2, 0.2) * x_step"
+ }
+ ],
+ "marks": [
+ {
+ "name": "marks",
+ "type": "rect",
+ "style": ["bar"],
+ "from": {"data": "data_0"},
+ "encode": {
+ "update": {
+ "fill": {"scale": "color", "field": "group"},
+ "ariaRoleDescription": {"value": "bar"},
+ "description": {
+ "signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
+ },
+ "xc": {
+ "scale": "x",
+ "field": "category",
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
+ },
+ "width": {"signal": "max(0.25, 0.5 * bandwidth('xOffset'))"},
+ "y": {"scale": "y", "field": "value_end"},
+ "y2": {"scale": "y", "field": "value_start"}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "band",
+ "domain": {"data": "data_0", "field": "category", "sort": true},
+ "range": {"step": {"signal": "x_step"}},
+ "paddingInner": 0.2,
+ "paddingOuter": 0.2
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {"data": "data_0", "fields": ["value_start", "value_end"]},
+ "range": [{"signal": "height"}, 0],
+ "nice": true,
+ "zero": true
+ },
+ {
+ "name": "xOffset",
+ "type": "band",
+ "domain": {"data": "data_0", "field": "group", "sort": true},
+ "range": {"step": 20}
+ },
+ {
+ "name": "color",
+ "type": "ordinal",
+ "domain": {"data": "data_0", "field": "group", "sort": true},
+ "range": "category"
+ }
+ ],
+ "axes": [
+ {
+ "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": "category",
+ "labelAlign": "right",
+ "labelAngle": 270,
+ "labelBaseline": "middle",
+ "zindex": 0
+ },
+ {
+ "scale": "y",
+ "orient": "left",
+ "grid": false,
+ "title": "value",
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(height/40)"},
+ "zindex": 0
+ }
+ ],
+ "legends": [{"fill": "color", "symbolType": "square", "title": "group"}]
+}
diff --git a/examples/compiled/bar_grouped_errorbar.vg.json b/examples/compiled/bar_grouped_errorbar.vg.json
index 1e6a3ac463..01a349a2e0 100644
--- a/examples/compiled/bar_grouped_errorbar.vg.json
+++ b/examples/compiled/bar_grouped_errorbar.vg.json
@@ -78,10 +78,10 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Mean of Acceleration: \" + (format(datum[\"mean_Acceleration\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Cylinders",
- "offset": {"scale": "xOffset", "field": "Origin"}
+ "offset": {"scale": "xOffset", "field": "Origin", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "mean_Acceleration"},
diff --git a/examples/compiled/bar_grouped_facet.vg.json b/examples/compiled/bar_grouped_facet.vg.json
index caa2f96c81..8f882a76d2 100644
--- a/examples/compiled/bar_grouped_facet.vg.json
+++ b/examples/compiled/bar_grouped_facet.vg.json
@@ -130,7 +130,7 @@
"description": {
"signal": "\"group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"]) + \"; value: \" + (format(datum[\"value\"], \"\"))"
},
- "x": {"scale": "x", "field": "group"},
+ "xc": {"scale": "x", "field": "group", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "value_end"},
"y2": {"scale": "y", "field": "value_start"}
diff --git a/examples/compiled/bar_grouped_facet_independent_scale.vg.json b/examples/compiled/bar_grouped_facet_independent_scale.vg.json
index 61f5f87a69..c9ce70a299 100644
--- a/examples/compiled/bar_grouped_facet_independent_scale.vg.json
+++ b/examples/compiled/bar_grouped_facet_independent_scale.vg.json
@@ -148,7 +148,7 @@
"description": {
"signal": "\"group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"]) + \"; value: \" + (format(datum[\"value\"], \"\"))"
},
- "x": {"scale": "child_x", "field": "group"},
+ "xc": {"scale": "child_x", "field": "group", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('child_x'))"},
"y": {"scale": "y", "field": "value_end"},
"y2": {"scale": "y", "field": "value_start"}
diff --git a/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.svg b/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.svg
index a3175ef2e8..092277529c 100644
--- a/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.svg
+++ b/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.vg.json b/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.vg.json
index 349601a689..11f670a0ad 100644
--- a/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.vg.json
+++ b/examples/compiled/bar_grouped_facet_independent_scale_fixed_width.vg.json
@@ -123,7 +123,7 @@
"description": {
"signal": "\"group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"]) + \"; value: \" + (format(datum[\"value\"], \"\"))"
},
- "x": {"scale": "child_x", "field": "group"},
+ "xc": {"scale": "child_x", "field": "group", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('child_x'))"},
"y": {"scale": "y", "field": "value_end"},
"y2": {"scale": "y", "field": "value_start"}
diff --git a/examples/compiled/bar_grouped_fixed_width.svg b/examples/compiled/bar_grouped_fixed_width.svg
index b807b6daf0..2f4bac2383 100644
--- a/examples/compiled/bar_grouped_fixed_width.svg
+++ b/examples/compiled/bar_grouped_fixed_width.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_fixed_width.vg.json b/examples/compiled/bar_grouped_fixed_width.vg.json
index f0f2fb3239..ce231b3efb 100644
--- a/examples/compiled/bar_grouped_fixed_width.vg.json
+++ b/examples/compiled/bar_grouped_fixed_width.vg.json
@@ -52,10 +52,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/bar_grouped_horizontal.vg.json b/examples/compiled/bar_grouped_horizontal.vg.json
index 6de464a01b..9beecbc192 100644
--- a/examples/compiled/bar_grouped_horizontal.vg.json
+++ b/examples/compiled/bar_grouped_horizontal.vg.json
@@ -63,10 +63,10 @@
},
"x": {"scale": "x", "field": "value_end"},
"x2": {"scale": "x", "field": "value_start"},
- "y": {
+ "yc": {
"scale": "y",
"field": "category",
- "offset": {"scale": "yOffset", "field": "group"}
+ "offset": {"scale": "yOffset", "field": "group", "band": 0.5}
},
"height": {"signal": "max(0.25, bandwidth('yOffset'))"}
}
diff --git a/examples/compiled/bar_grouped_label.vg.json b/examples/compiled/bar_grouped_label.vg.json
index 99fad91d1b..3bc9d59a74 100644
--- a/examples/compiled/bar_grouped_label.vg.json
+++ b/examples/compiled/bar_grouped_label.vg.json
@@ -76,10 +76,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/bar_grouped_repeated.svg b/examples/compiled/bar_grouped_repeated.svg
index b3f2276a96..d2fbb16c3b 100644
--- a/examples/compiled/bar_grouped_repeated.svg
+++ b/examples/compiled/bar_grouped_repeated.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_repeated.vg.json b/examples/compiled/bar_grouped_repeated.vg.json
index 8174ba5b62..a8d234deda 100644
--- a/examples/compiled/bar_grouped_repeated.vg.json
+++ b/examples/compiled/bar_grouped_repeated.vg.json
@@ -43,10 +43,14 @@
"description": {
"signal": "\"Major Genre: \" + (isValid(datum[\"Major Genre\"]) ? datum[\"Major Genre\"] : \"\"+datum[\"Major Genre\"]) + \"; Total Gross: \" + (format(datum[\"sum_Worldwide Gross\"], \"\"))"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Major Genre",
- "offset": {"scale": "xOffset", "value": "Worldwide Gross"}
+ "offset": {
+ "scale": "xOffset",
+ "value": "Worldwide Gross",
+ "band": 0.5
+ }
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": [
@@ -72,10 +76,10 @@
"description": {
"signal": "\"Major Genre: \" + (isValid(datum[\"Major Genre\"]) ? datum[\"Major Genre\"] : \"\"+datum[\"Major Genre\"]) + \"; Total Gross: \" + (format(datum[\"sum_US Gross\"], \"\"))"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Major Genre",
- "offset": {"scale": "xOffset", "value": "US Gross"}
+ "offset": {"scale": "xOffset", "value": "US Gross", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": [
diff --git a/examples/compiled/bar_grouped_stacked.vg.json b/examples/compiled/bar_grouped_stacked.vg.json
index 727c32e6be..43d97ab232 100644
--- a/examples/compiled/bar_grouped_stacked.vg.json
+++ b/examples/compiled/bar_grouped_stacked.vg.json
@@ -61,10 +61,10 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Sum of Weight_in_lbs: \" + (format(datum[\"sum_Weight_in_lbs\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Year (year): \" + (timeFormat(datum[\"year_Year\"], timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})))"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Cylinders",
- "offset": {"scale": "xOffset", "field": "Origin"}
+ "offset": {"scale": "xOffset", "field": "Origin", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "sum_Weight_in_lbs_end"},
diff --git a/examples/compiled/bar_grouped_step_for_offset.vg.json b/examples/compiled/bar_grouped_step_for_offset.vg.json
index 6b0296359e..c829603fa6 100644
--- a/examples/compiled/bar_grouped_step_for_offset.vg.json
+++ b/examples/compiled/bar_grouped_step_for_offset.vg.json
@@ -61,10 +61,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/bar_grouped_step_for_position.svg b/examples/compiled/bar_grouped_step_for_position.svg
index 71a0ec5360..3fb6e31ee2 100644
--- a/examples/compiled/bar_grouped_step_for_position.svg
+++ b/examples/compiled/bar_grouped_step_for_position.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_step_for_position.vg.json b/examples/compiled/bar_grouped_step_for_position.vg.json
index 81bd6e3c9c..3642801383 100644
--- a/examples/compiled/bar_grouped_step_for_position.vg.json
+++ b/examples/compiled/bar_grouped_step_for_position.vg.json
@@ -58,10 +58,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/bar_grouped_thin.png b/examples/compiled/bar_grouped_thin.png
index a923f8cf3f..7968a0d823 100644
Binary files a/examples/compiled/bar_grouped_thin.png and b/examples/compiled/bar_grouped_thin.png differ
diff --git a/examples/compiled/bar_grouped_thin.svg b/examples/compiled/bar_grouped_thin.svg
index 435574b26d..bb23553b7e 100644
--- a/examples/compiled/bar_grouped_thin.svg
+++ b/examples/compiled/bar_grouped_thin.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_thin.vg.json b/examples/compiled/bar_grouped_thin.vg.json
index 69c532b3bc..a905ba6754 100644
--- a/examples/compiled/bar_grouped_thin.vg.json
+++ b/examples/compiled/bar_grouped_thin.vg.json
@@ -40,10 +40,10 @@
"description": {
"signal": "\"Director: \" + (isValid(datum[\"Director\"]) ? datum[\"Director\"] : \"\"+datum[\"Director\"]) + \"; Mean of Rotten Tomatoes Rating: \" + (format(datum[\"mean_Rotten Tomatoes Rating\"], \"\")) + \"; Title: \" + (isValid(datum[\"Title\"]) ? datum[\"Title\"] : \"\"+datum[\"Title\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Director",
- "offset": {"scale": "xOffset", "field": "Title"}
+ "offset": {"scale": "xOffset", "field": "Title", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": [
diff --git a/examples/compiled/bar_grouped_thin_minBandSize.png b/examples/compiled/bar_grouped_thin_minBandSize.png
index 538793d2ac..c301ad7b78 100644
Binary files a/examples/compiled/bar_grouped_thin_minBandSize.png and b/examples/compiled/bar_grouped_thin_minBandSize.png differ
diff --git a/examples/compiled/bar_grouped_thin_minBandSize.svg b/examples/compiled/bar_grouped_thin_minBandSize.svg
index ea77344c19..68c9f6b751 100644
--- a/examples/compiled/bar_grouped_thin_minBandSize.svg
+++ b/examples/compiled/bar_grouped_thin_minBandSize.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_grouped_thin_minBandSize.vg.json b/examples/compiled/bar_grouped_thin_minBandSize.vg.json
index ce94c87630..3e82d44498 100644
--- a/examples/compiled/bar_grouped_thin_minBandSize.vg.json
+++ b/examples/compiled/bar_grouped_thin_minBandSize.vg.json
@@ -40,10 +40,10 @@
"description": {
"signal": "\"Director: \" + (isValid(datum[\"Director\"]) ? datum[\"Director\"] : \"\"+datum[\"Director\"]) + \"; Mean of Rotten Tomatoes Rating: \" + (format(datum[\"mean_Rotten Tomatoes Rating\"], \"\")) + \"; Title: \" + (isValid(datum[\"Title\"]) ? datum[\"Title\"] : \"\"+datum[\"Title\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Director",
- "offset": {"scale": "xOffset", "field": "Title"}
+ "offset": {"scale": "xOffset", "field": "Title", "band": 0.5}
},
"width": {"signal": "max(4, bandwidth('xOffset'))"},
"y": [
diff --git a/examples/compiled/bar_layered_transparent.svg b/examples/compiled/bar_layered_transparent.svg
index 26d80e5756..a18e495a46 100644
--- a/examples/compiled/bar_layered_transparent.svg
+++ b/examples/compiled/bar_layered_transparent.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_layered_transparent.vg.json b/examples/compiled/bar_layered_transparent.vg.json
index fbd9aa0f00..27972e5705 100644
--- a/examples/compiled/bar_layered_transparent.vg.json
+++ b/examples/compiled/bar_layered_transparent.vg.json
@@ -52,7 +52,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_month.vg.json b/examples/compiled/bar_month.vg.json
index d59b3b4477..90af332cbd 100644
--- a/examples/compiled/bar_month.vg.json
+++ b/examples/compiled/bar_month.vg.json
@@ -50,7 +50,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_precipitation"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_multi_values_per_categories.vg.json b/examples/compiled/bar_multi_values_per_categories.vg.json
index 63d48a5175..a5746dfe5b 100644
--- a/examples/compiled/bar_multi_values_per_categories.vg.json
+++ b/examples/compiled/bar_multi_values_per_categories.vg.json
@@ -62,7 +62,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_negative.vg.json b/examples/compiled/bar_negative.vg.json
index 8965cdfe1d..dacaf01778 100644
--- a/examples/compiled/bar_negative.vg.json
+++ b/examples/compiled/bar_negative.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_negative_horizontal_label.vg.json b/examples/compiled/bar_negative_horizontal_label.vg.json
index 96aa0dbd66..6f73a583c0 100644
--- a/examples/compiled/bar_negative_horizontal_label.vg.json
+++ b/examples/compiled/bar_negative_horizontal_label.vg.json
@@ -71,7 +71,7 @@
},
"x": {"scale": "x", "field": "b_end"},
"x2": {"scale": "x", "field": "b_start"},
- "y": {"scale": "y", "field": "a"},
+ "yc": {"scale": "y", "field": "a", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_params.vg.json b/examples/compiled/bar_params.vg.json
index 3273c30642..1457c03372 100644
--- a/examples/compiled/bar_params.vg.json
+++ b/examples/compiled/bar_params.vg.json
@@ -63,7 +63,7 @@
},
"encode": {
"update": {
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {
"signal": "min(scale('y',datum[\"min_b_start\"]),scale('y',datum[\"max_b_start\"]),scale('y',datum[\"min_b_end\"]),scale('y',datum[\"max_b_end\"]))"
diff --git a/examples/compiled/bar_params_bound.vg.json b/examples/compiled/bar_params_bound.vg.json
index 81146c10f5..68f1e8cc8f 100644
--- a/examples/compiled/bar_params_bound.vg.json
+++ b/examples/compiled/bar_params_bound.vg.json
@@ -67,7 +67,7 @@
},
"encode": {
"update": {
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {
"signal": "min(scale('y',datum[\"min_b_start\"]),scale('y',datum[\"max_b_start\"]),scale('y',datum[\"min_b_end\"]),scale('y',datum[\"max_b_end\"]))"
diff --git a/examples/compiled/bar_percent_of_total.svg b/examples/compiled/bar_percent_of_total.svg
index fb0eb20ba7..6e49682d93 100644
--- a/examples/compiled/bar_percent_of_total.svg
+++ b/examples/compiled/bar_percent_of_total.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_percent_of_total.vg.json b/examples/compiled/bar_percent_of_total.vg.json
index 2258fe7f1d..f5617de116 100644
--- a/examples/compiled/bar_percent_of_total.vg.json
+++ b/examples/compiled/bar_percent_of_total.vg.json
@@ -68,7 +68,7 @@
},
"x": {"scale": "x", "field": "PercentOfTotal_end"},
"x2": {"scale": "x", "field": "PercentOfTotal_start"},
- "y": {"scale": "y", "field": "Activity"},
+ "yc": {"scale": "y", "field": "Activity", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_simple_extent.vg.json b/examples/compiled/bar_simple_extent.vg.json
index d25a759582..c0c52e2231 100644
--- a/examples/compiled/bar_simple_extent.vg.json
+++ b/examples/compiled/bar_simple_extent.vg.json
@@ -69,7 +69,7 @@
},
"x": {"scale": "x", "field": "b_end"},
"x2": {"scale": "x", "field": "b_start"},
- "y": {"scale": "y", "field": "a"},
+ "yc": {"scale": "y", "field": "a", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_size_default.vg.json b/examples/compiled/bar_size_default.vg.json
index a657e6fda5..3cc308c47d 100644
--- a/examples/compiled/bar_size_default.vg.json
+++ b/examples/compiled/bar_size_default.vg.json
@@ -40,7 +40,7 @@
"description": {
"signal": "\"Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Origin"},
+ "xc": {"scale": "x", "field": "Origin", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_size_explicit_bad.svg b/examples/compiled/bar_size_explicit_bad.svg
index b0fe4d9d36..4cc5ce85d6 100644
--- a/examples/compiled/bar_size_explicit_bad.svg
+++ b/examples/compiled/bar_size_explicit_bad.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_size_explicit_bad.vg.json b/examples/compiled/bar_size_explicit_bad.vg.json
index 564c59c463..bd416f6993 100644
--- a/examples/compiled/bar_size_explicit_bad.vg.json
+++ b/examples/compiled/bar_size_explicit_bad.vg.json
@@ -34,7 +34,7 @@
"description": {
"signal": "\"Name: \" + (isValid(datum[\"Name\"]) ? datum[\"Name\"] : \"\"+datum[\"Name\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Name"},
+ "xc": {"scale": "x", "field": "Name", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_size_fit.svg b/examples/compiled/bar_size_fit.svg
index 162509f10b..2f8cdf80c0 100644
--- a/examples/compiled/bar_size_fit.svg
+++ b/examples/compiled/bar_size_fit.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_size_fit.vg.json b/examples/compiled/bar_size_fit.vg.json
index aed17f5075..aa758a57bb 100644
--- a/examples/compiled/bar_size_fit.vg.json
+++ b/examples/compiled/bar_size_fit.vg.json
@@ -34,7 +34,7 @@
"description": {
"signal": "\"Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Origin"},
+ "xc": {"scale": "x", "field": "Origin", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_size_relative_band.png b/examples/compiled/bar_size_relative_band.png
new file mode 100644
index 0000000000..95a29f5e80
Binary files /dev/null and b/examples/compiled/bar_size_relative_band.png differ
diff --git a/examples/compiled/bar_size_relative_band.svg b/examples/compiled/bar_size_relative_band.svg
new file mode 100644
index 0000000000..91f38da71a
--- /dev/null
+++ b/examples/compiled/bar_size_relative_band.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/bar_size_relative_band.vg.json b/examples/compiled/bar_size_relative_band.vg.json
new file mode 100644
index 0000000000..d55f1bbf97
--- /dev/null
+++ b/examples/compiled/bar_size_relative_band.vg.json
@@ -0,0 +1,122 @@
+{
+ "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "description": "A simple bar chart with embedded data.",
+ "background": "white",
+ "padding": 5,
+ "height": 200,
+ "style": "cell",
+ "data": [
+ {
+ "name": "source_0",
+ "values": [
+ {"a": "A", "b": 28},
+ {"a": "B", "b": 55},
+ {"a": "C", "b": 43},
+ {"a": "D", "b": 91},
+ {"a": "E", "b": 81},
+ {"a": "F", "b": 53},
+ {"a": "G", "b": 19},
+ {"a": "H", "b": 87},
+ {"a": "I", "b": 52}
+ ]
+ },
+ {
+ "name": "data_0",
+ "source": "source_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\"])"
+ }
+ ]
+ }
+ ],
+ "signals": [
+ {"name": "x_step", "value": 20},
+ {
+ "name": "width",
+ "update": "bandspace(domain('x').length, 0.1, 0.05) * x_step"
+ }
+ ],
+ "marks": [
+ {
+ "name": "marks",
+ "type": "rect",
+ "style": ["bar"],
+ "from": {"data": "data_0"},
+ "encode": {
+ "update": {
+ "fill": {"value": "#4c78a8"},
+ "ariaRoleDescription": {"value": "bar"},
+ "description": {
+ "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
+ },
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
+ "width": {"signal": "max(0.25, 0.5 * bandwidth('x'))"},
+ "y": {"scale": "y", "field": "b_end"},
+ "y2": {"scale": "y", "field": "b_start"}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "band",
+ "domain": {"data": "data_0", "field": "a", "sort": true},
+ "range": {"step": {"signal": "x_step"}},
+ "paddingInner": 0.1,
+ "paddingOuter": 0.05
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {"data": "data_0", "fields": ["b_start", "b_end"]},
+ "range": [{"signal": "height"}, 0],
+ "nice": true,
+ "zero": true
+ }
+ ],
+ "axes": [
+ {
+ "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",
+ "labelAngle": 0,
+ "labelBaseline": "top",
+ "zindex": 0
+ },
+ {
+ "scale": "y",
+ "orient": "left",
+ "grid": false,
+ "title": "b",
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(height/40)"},
+ "zindex": 0
+ }
+ ]
+}
diff --git a/examples/compiled/bar_size_responsive.svg b/examples/compiled/bar_size_responsive.svg
index b5cce508a9..93d05e2f6f 100644
--- a/examples/compiled/bar_size_responsive.svg
+++ b/examples/compiled/bar_size_responsive.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_size_responsive.vg.json b/examples/compiled/bar_size_responsive.vg.json
index 2ed5384234..77d178af62 100644
--- a/examples/compiled/bar_size_responsive.vg.json
+++ b/examples/compiled/bar_size_responsive.vg.json
@@ -46,7 +46,7 @@
"description": {
"signal": "\"Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Number of Cars: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Origin"},
+ "xc": {"scale": "x", "field": "Origin", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_size_step_small.vg.json b/examples/compiled/bar_size_step_small.vg.json
index 4b49288a92..2eb5a61639 100644
--- a/examples/compiled/bar_size_step_small.vg.json
+++ b/examples/compiled/bar_size_step_small.vg.json
@@ -40,7 +40,7 @@
"description": {
"signal": "\"Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Origin"},
+ "xc": {"scale": "x", "field": "Origin", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_sort_by_count.vg.json b/examples/compiled/bar_sort_by_count.vg.json
index cec76baa9b..431de1af7d 100644
--- a/examples/compiled/bar_sort_by_count.vg.json
+++ b/examples/compiled/bar_sort_by_count.vg.json
@@ -41,7 +41,7 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/bar_swap_axes.vg.json b/examples/compiled/bar_swap_axes.vg.json
index 24c5aedd84..99a8bd0e64 100644
--- a/examples/compiled/bar_swap_axes.vg.json
+++ b/examples/compiled/bar_swap_axes.vg.json
@@ -59,7 +59,7 @@
},
"x": {"scale": "x", "field": "average_b"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "a"},
+ "yc": {"scale": "y", "field": "a", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_swap_custom.vg.json b/examples/compiled/bar_swap_custom.vg.json
index 4d8760930d..50c8d4e91c 100644
--- a/examples/compiled/bar_swap_custom.vg.json
+++ b/examples/compiled/bar_swap_custom.vg.json
@@ -59,7 +59,7 @@
},
"x": {"scale": "x", "field": "average_b"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "a"},
+ "yc": {"scale": "y", "field": "a", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/bar_temporal_color_config_time_unit_band_position.vg.json b/examples/compiled/bar_temporal_color_config_time_unit_band_position.vg.json
index a1e33bc152..b8b79a3c88 100644
--- a/examples/compiled/bar_temporal_color_config_time_unit_band_position.vg.json
+++ b/examples/compiled/bar_temporal_color_config_time_unit_band_position.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"symbol: \" + (isValid(datum[\"symbol\"]) ? datum[\"symbol\"] : \"\"+datum[\"symbol\"]) + \"; Sum of price: \" + (format(datum[\"sum_price\"], \"\")) + \"; date (year): \" + (timeFormat(datum[\"year_date\"], timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})))"
},
- "x": {"scale": "x", "field": "symbol"},
+ "xc": {"scale": "x", "field": "symbol", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_price_end"},
"y2": {"scale": "y", "field": "sum_price_start"}
diff --git a/examples/compiled/bar_title.vg.json b/examples/compiled/bar_title.vg.json
index cef272a2d1..199475639f 100644
--- a/examples/compiled/bar_title.vg.json
+++ b/examples/compiled/bar_title.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_title_start.vg.json b/examples/compiled/bar_title_start.vg.json
index 03fedcee38..d582fc3e94 100644
--- a/examples/compiled/bar_title_start.vg.json
+++ b/examples/compiled/bar_title_start.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_tooltip.vg.json b/examples/compiled/bar_tooltip.vg.json
index 5295344d5f..f191b8a363 100644
--- a/examples/compiled/bar_tooltip.vg.json
+++ b/examples/compiled/bar_tooltip.vg.json
@@ -60,7 +60,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_tooltip_aggregate.vg.json b/examples/compiled/bar_tooltip_aggregate.vg.json
index f4b9af25c1..da4eb402c7 100644
--- a/examples/compiled/bar_tooltip_aggregate.vg.json
+++ b/examples/compiled/bar_tooltip_aggregate.vg.json
@@ -39,10 +39,10 @@
"description": {
"signal": "\"Mean of data: \" + (format(datum[\"mean_data\"], \"\"))"
},
+ "height": {"value": 1},
"xc": {"signal": "width", "mult": 0.5},
- "yc": {"scale": "y", "field": "mean_data"},
- "width": {"value": 15},
- "height": {"value": 1}
+ "width": {"mult": 0.75, "field": {"group": "width"}},
+ "yc": {"scale": "y", "field": "mean_data"}
}
}
}
diff --git a/examples/compiled/bar_tooltip_groupby.vg.json b/examples/compiled/bar_tooltip_groupby.vg.json
index d024f77b49..74e363efcd 100644
--- a/examples/compiled/bar_tooltip_groupby.vg.json
+++ b/examples/compiled/bar_tooltip_groupby.vg.json
@@ -41,10 +41,10 @@
"description": {
"signal": "\"Mean of data: \" + (format(datum[\"mean_data\"], \"\")) + \"; data: \" + (isValid(datum[\"data\"]) ? datum[\"data\"] : \"\"+datum[\"data\"])"
},
+ "height": {"value": 1},
"xc": {"signal": "width", "mult": 0.5},
- "yc": {"scale": "y", "field": "mean_data"},
- "width": {"value": 15},
- "height": {"value": 1}
+ "width": {"mult": 0.75, "field": {"group": "width"}},
+ "yc": {"scale": "y", "field": "mean_data"}
}
}
}
diff --git a/examples/compiled/bar_tooltip_multi.vg.json b/examples/compiled/bar_tooltip_multi.vg.json
index 6a35ed202d..13a984f679 100644
--- a/examples/compiled/bar_tooltip_multi.vg.json
+++ b/examples/compiled/bar_tooltip_multi.vg.json
@@ -61,7 +61,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_tooltip_title.vg.json b/examples/compiled/bar_tooltip_title.vg.json
index 4575f585db..4e4cc44917 100644
--- a/examples/compiled/bar_tooltip_title.vg.json
+++ b/examples/compiled/bar_tooltip_title.vg.json
@@ -61,7 +61,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; Field A: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; Field B: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/bar_width_relative_band_size.png b/examples/compiled/bar_width_relative_band_size.png
new file mode 100644
index 0000000000..95a29f5e80
Binary files /dev/null and b/examples/compiled/bar_width_relative_band_size.png differ
diff --git a/examples/compiled/bar_width_relative_band_size.svg b/examples/compiled/bar_width_relative_band_size.svg
new file mode 100644
index 0000000000..91f38da71a
--- /dev/null
+++ b/examples/compiled/bar_width_relative_band_size.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/bar_width_relative_band_size.vg.json b/examples/compiled/bar_width_relative_band_size.vg.json
new file mode 100644
index 0000000000..d55f1bbf97
--- /dev/null
+++ b/examples/compiled/bar_width_relative_band_size.vg.json
@@ -0,0 +1,122 @@
+{
+ "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "description": "A simple bar chart with embedded data.",
+ "background": "white",
+ "padding": 5,
+ "height": 200,
+ "style": "cell",
+ "data": [
+ {
+ "name": "source_0",
+ "values": [
+ {"a": "A", "b": 28},
+ {"a": "B", "b": 55},
+ {"a": "C", "b": 43},
+ {"a": "D", "b": 91},
+ {"a": "E", "b": 81},
+ {"a": "F", "b": 53},
+ {"a": "G", "b": 19},
+ {"a": "H", "b": 87},
+ {"a": "I", "b": 52}
+ ]
+ },
+ {
+ "name": "data_0",
+ "source": "source_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\"])"
+ }
+ ]
+ }
+ ],
+ "signals": [
+ {"name": "x_step", "value": 20},
+ {
+ "name": "width",
+ "update": "bandspace(domain('x').length, 0.1, 0.05) * x_step"
+ }
+ ],
+ "marks": [
+ {
+ "name": "marks",
+ "type": "rect",
+ "style": ["bar"],
+ "from": {"data": "data_0"},
+ "encode": {
+ "update": {
+ "fill": {"value": "#4c78a8"},
+ "ariaRoleDescription": {"value": "bar"},
+ "description": {
+ "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
+ },
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
+ "width": {"signal": "max(0.25, 0.5 * bandwidth('x'))"},
+ "y": {"scale": "y", "field": "b_end"},
+ "y2": {"scale": "y", "field": "b_start"}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "band",
+ "domain": {"data": "data_0", "field": "a", "sort": true},
+ "range": {"step": {"signal": "x_step"}},
+ "paddingInner": 0.1,
+ "paddingOuter": 0.05
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {"data": "data_0", "fields": ["b_start", "b_end"]},
+ "range": [{"signal": "height"}, 0],
+ "nice": true,
+ "zero": true
+ }
+ ],
+ "axes": [
+ {
+ "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",
+ "labelAngle": 0,
+ "labelBaseline": "top",
+ "zindex": 0
+ },
+ {
+ "scale": "y",
+ "orient": "left",
+ "grid": false,
+ "title": "b",
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(height/40)"},
+ "zindex": 0
+ }
+ ]
+}
diff --git a/examples/compiled/bar_x_offset_without_x.svg b/examples/compiled/bar_x_offset_without_x.svg
index 339c464fe7..6dbf0f7345 100644
--- a/examples/compiled/bar_x_offset_without_x.svg
+++ b/examples/compiled/bar_x_offset_without_x.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/bar_x_offset_without_x.vg.json b/examples/compiled/bar_x_offset_without_x.vg.json
index c3fb601dde..df0cd1750b 100644
--- a/examples/compiled/bar_x_offset_without_x.vg.json
+++ b/examples/compiled/bar_x_offset_without_x.vg.json
@@ -53,10 +53,10 @@
"description": {
"signal": "\"value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"signal": "width",
"mult": 0.5,
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/boxplot_1D_horizontal.vg.json b/examples/compiled/boxplot_1D_horizontal.vg.json
index b7dd924888..bcbf854d90 100644
--- a/examples/compiled/boxplot_1D_horizontal.vg.json
+++ b/examples/compiled/boxplot_1D_horizontal.vg.json
@@ -223,10 +223,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\")}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json b/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
index 37c52929e7..3ecd0545df 100644
--- a/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
+++ b/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
@@ -211,10 +211,10 @@
"tooltip": {
"signal": "{\"Upper Whisker of Body Mass (g)\": format(datum[\"upper_whisker_Body Mass (g)\"], \"\"), \"Lower Whisker of Body Mass (g)\": format(datum[\"lower_whisker_Body Mass (g)\"], \"\")}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "lower_whisker_Body Mass (g)"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"mult": 0.75, "field": {"group": "height"}}
}
}
},
@@ -231,10 +231,10 @@
"tooltip": {
"signal": "{\"Upper Whisker of Body Mass (g)\": format(datum[\"upper_whisker_Body Mass (g)\"], \"\"), \"Lower Whisker of Body Mass (g)\": format(datum[\"lower_whisker_Body Mass (g)\"], \"\")}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "upper_whisker_Body Mass (g)"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"mult": 0.75, "field": {"group": "height"}}
}
}
},
@@ -273,10 +273,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\")}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_1D_horizontal_explicit.vg.json b/examples/compiled/boxplot_1D_horizontal_explicit.vg.json
index b7dd924888..bcbf854d90 100644
--- a/examples/compiled/boxplot_1D_horizontal_explicit.vg.json
+++ b/examples/compiled/boxplot_1D_horizontal_explicit.vg.json
@@ -223,10 +223,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\")}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_1D_invalid.vg.json b/examples/compiled/boxplot_1D_invalid.vg.json
index 9bca1863b7..7fc4148147 100644
--- a/examples/compiled/boxplot_1D_invalid.vg.json
+++ b/examples/compiled/boxplot_1D_invalid.vg.json
@@ -211,10 +211,10 @@
"tooltip": {
"signal": "{\"Max of b\": format(datum[\"max_b\"], \"\"), \"Q3 of b\": format(datum[\"upper_box_b\"], \"\"), \"Median of b\": format(datum[\"mid_box_b\"], \"\"), \"Q1 of b\": format(datum[\"lower_box_b\"], \"\"), \"Min of b\": format(datum[\"min_b\"], \"\"), \"a\": format(datum[\"a\"], \"\")}"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "a"},
- "yc": {"scale": "y", "field": "mid_box_b"},
"width": {"value": 14},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "mid_box_b"}
}
}
}
diff --git a/examples/compiled/boxplot_1D_vertical.vg.json b/examples/compiled/boxplot_1D_vertical.vg.json
index fcf60d6c8f..97015fba3d 100644
--- a/examples/compiled/boxplot_1D_vertical.vg.json
+++ b/examples/compiled/boxplot_1D_vertical.vg.json
@@ -223,10 +223,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\")}"
},
+ "height": {"value": 1},
"xc": {"signal": "width", "mult": 0.5},
- "yc": {"scale": "y", "field": "mid_box_Body Mass (g)"},
"width": {"value": 14},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "mid_box_Body Mass (g)"}
}
}
}
diff --git a/examples/compiled/boxplot_2D_horizontal.vg.json b/examples/compiled/boxplot_2D_horizontal.vg.json
index 657e0434dd..9c81f7e5c1 100644
--- a/examples/compiled/boxplot_2D_horizontal.vg.json
+++ b/examples/compiled/boxplot_2D_horizontal.vg.json
@@ -226,10 +226,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_2D_horizontal_color_size.vg.json b/examples/compiled/boxplot_2D_horizontal_color_size.vg.json
index aa06950bc5..9480cbc09a 100644
--- a/examples/compiled/boxplot_2D_horizontal_color_size.vg.json
+++ b/examples/compiled/boxplot_2D_horizontal_color_size.vg.json
@@ -226,10 +226,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 10},
- "width": {"value": 1}
+ "height": {"value": 10}
}
}
}
diff --git a/examples/compiled/boxplot_2D_vertical.vg.json b/examples/compiled/boxplot_2D_vertical.vg.json
index d79f793f82..f17f165e36 100644
--- a/examples/compiled/boxplot_2D_vertical.vg.json
+++ b/examples/compiled/boxplot_2D_vertical.vg.json
@@ -226,10 +226,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "Species", "band": 0.5},
- "yc": {"scale": "y", "field": "mid_box_Body Mass (g)"},
"width": {"value": 14},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "mid_box_Body Mass (g)"}
}
}
}
diff --git a/examples/compiled/boxplot_groupped.vg.json b/examples/compiled/boxplot_groupped.vg.json
index 71cd079b7d..5abf1ce3e3 100644
--- a/examples/compiled/boxplot_groupped.vg.json
+++ b/examples/compiled/boxplot_groupped.vg.json
@@ -244,14 +244,14 @@
"tooltip": {
"signal": "{\"Max of Acceleration\": format(datum[\"max_Acceleration\"], \"\"), \"Q3 of Acceleration\": format(datum[\"upper_box_Acceleration\"], \"\"), \"Median of Acceleration\": format(datum[\"mid_box_Acceleration\"], \"\"), \"Q1 of Acceleration\": format(datum[\"lower_box_Acceleration\"], \"\"), \"Min of Acceleration\": format(datum[\"min_Acceleration\"], \"\"), \"Cylinders\": isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"], \"Origin\": isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]}"
},
+ "height": {"value": 1},
"xc": {
"scale": "x",
"field": "Cylinders",
"offset": {"scale": "xOffset", "field": "Origin", "band": 0.5}
},
- "yc": {"scale": "y", "field": "mid_box_Acceleration"},
"width": {"value": 14},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "mid_box_Acceleration"}
}
}
}
diff --git a/examples/compiled/boxplot_minmax_2D_horizontal.vg.json b/examples/compiled/boxplot_minmax_2D_horizontal.vg.json
index b6a8859e67..b936723cb8 100644
--- a/examples/compiled/boxplot_minmax_2D_horizontal.vg.json
+++ b/examples/compiled/boxplot_minmax_2D_horizontal.vg.json
@@ -149,10 +149,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"upper_whisker_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"lower_whisker_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_minmax_2D_horizontal_custom_midtick_color.vg.json b/examples/compiled/boxplot_minmax_2D_horizontal_custom_midtick_color.vg.json
index cbbf3ea904..80712bc0ac 100644
--- a/examples/compiled/boxplot_minmax_2D_horizontal_custom_midtick_color.vg.json
+++ b/examples/compiled/boxplot_minmax_2D_horizontal_custom_midtick_color.vg.json
@@ -149,10 +149,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"upper_whisker_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"lower_whisker_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_minmax_2D_vertical.vg.json b/examples/compiled/boxplot_minmax_2D_vertical.vg.json
index ebff85d15d..44aba7b4ee 100644
--- a/examples/compiled/boxplot_minmax_2D_vertical.vg.json
+++ b/examples/compiled/boxplot_minmax_2D_vertical.vg.json
@@ -149,10 +149,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"upper_whisker_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"lower_whisker_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "Species", "band": 0.5},
- "yc": {"scale": "y", "field": "mid_box_Body Mass (g)"},
"width": {"value": 14},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "mid_box_Body Mass (g)"}
}
}
}
diff --git a/examples/compiled/boxplot_preaggregated.vg.json b/examples/compiled/boxplot_preaggregated.vg.json
index 90a007ded0..9b4442f4a3 100644
--- a/examples/compiled/boxplot_preaggregated.vg.json
+++ b/examples/compiled/boxplot_preaggregated.vg.json
@@ -134,10 +134,10 @@
"description": {
"signal": "\"median: \" + (format(datum[\"median\"], \"\")) + \"; Species: \" + (isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "median"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
},
diff --git a/examples/compiled/boxplot_tooltip_aggregate.vg.json b/examples/compiled/boxplot_tooltip_aggregate.vg.json
index 3639739c61..da2d60cdfa 100644
--- a/examples/compiled/boxplot_tooltip_aggregate.vg.json
+++ b/examples/compiled/boxplot_tooltip_aggregate.vg.json
@@ -222,10 +222,10 @@
"opacity": {"value": 0.7},
"fill": {"value": "white"},
"tooltip": {"signal": "format(datum[\"mean_Body Mass (g)\"], \"\")"},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/boxplot_tooltip_not_aggregate.vg.json b/examples/compiled/boxplot_tooltip_not_aggregate.vg.json
index fdc830314a..c9f943506c 100644
--- a/examples/compiled/boxplot_tooltip_not_aggregate.vg.json
+++ b/examples/compiled/boxplot_tooltip_not_aggregate.vg.json
@@ -227,10 +227,10 @@
"tooltip": {
"signal": "{\"Max of Body Mass (g)\": format(datum[\"max_Body Mass (g)\"], \"\"), \"Q3 of Body Mass (g)\": format(datum[\"upper_box_Body Mass (g)\"], \"\"), \"Median of Body Mass (g)\": format(datum[\"mid_box_Body Mass (g)\"], \"\"), \"Q1 of Body Mass (g)\": format(datum[\"lower_box_Body Mass (g)\"], \"\"), \"Min of Body Mass (g)\": format(datum[\"min_Body Mass (g)\"], \"\"), \"Species\": isValid(datum[\"Species\"]) ? datum[\"Species\"] : \"\"+datum[\"Species\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
}
diff --git a/examples/compiled/concat_bar_layer_circle.svg b/examples/compiled/concat_bar_layer_circle.svg
index a7eca207ff..1d4951e8df 100644
--- a/examples/compiled/concat_bar_layer_circle.svg
+++ b/examples/compiled/concat_bar_layer_circle.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/concat_bar_layer_circle.vg.json b/examples/compiled/concat_bar_layer_circle.vg.json
index 170abb4319..71a188d966 100644
--- a/examples/compiled/concat_bar_layer_circle.vg.json
+++ b/examples/compiled/concat_bar_layer_circle.vg.json
@@ -314,7 +314,11 @@
"description": {
"signal": "\"Major Genre: \" + (isValid(datum[\"Major Genre\"]) ? datum[\"Major Genre\"] : \"\"+datum[\"Major Genre\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "concat_1_x", "field": "Major Genre"},
+ "xc": {
+ "scale": "concat_1_x",
+ "field": "Major Genre",
+ "band": 0.5
+ },
"width": {"signal": "max(0.25, bandwidth('concat_1_x'))"},
"y": {"scale": "concat_1_y", "field": "__count"},
"y2": {"scale": "concat_1_y", "value": 0}
diff --git a/examples/compiled/concat_population_pyramid.vg.json b/examples/compiled/concat_population_pyramid.vg.json
index 8e337a1fb8..ed29b3b798 100644
--- a/examples/compiled/concat_population_pyramid.vg.json
+++ b/examples/compiled/concat_population_pyramid.vg.json
@@ -128,7 +128,7 @@
},
"x": {"scale": "concat_0_x", "field": "sum_people_end"},
"x2": {"scale": "concat_0_x", "field": "sum_people_start"},
- "y": {"scale": "concat_0_y", "field": "age"},
+ "yc": {"scale": "concat_0_y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_0_y'))"}
}
}
@@ -207,7 +207,7 @@
},
"x": {"scale": "concat_2_x", "field": "sum_people_end"},
"x2": {"scale": "concat_2_x", "field": "sum_people_start"},
- "y": {"scale": "concat_2_y", "field": "age"},
+ "yc": {"scale": "concat_2_y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_2_y'))"}
}
}
diff --git a/examples/compiled/concat_weather.vg.json b/examples/compiled/concat_weather.vg.json
index 7db19ec215..a4ab33c0ba 100644
--- a/examples/compiled/concat_weather.vg.json
+++ b/examples/compiled/concat_weather.vg.json
@@ -137,7 +137,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "concat_0_x", "field": "month_date"},
+ "xc": {"scale": "concat_0_x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('concat_0_x'))"},
"y": {"scale": "concat_0_y", "field": "mean_precipitation"},
"y2": {"scale": "concat_0_y", "value": 0}
@@ -209,7 +209,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Median of precipitation: \" + (format(datum[\"median_precipitation\"], \"\"))"
},
- "x": {"scale": "concat_1_x", "field": "month_date"},
+ "xc": {"scale": "concat_1_x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('concat_1_x'))"},
"y": {"scale": "concat_1_y", "field": "median_precipitation"},
"y2": {"scale": "concat_1_y", "value": 0}
diff --git a/examples/compiled/dynamic_color_legend.vg.json b/examples/compiled/dynamic_color_legend.vg.json
index 4193e2fd7e..0e0b29b104 100644
--- a/examples/compiled/dynamic_color_legend.vg.json
+++ b/examples/compiled/dynamic_color_legend.vg.json
@@ -508,7 +508,7 @@
},
"x": {"scale": "concat_1_x", "field": "__count"},
"x2": {"scale": "concat_1_x", "value": 0},
- "y": {"scale": "concat_1_y", "field": "weather"},
+ "yc": {"scale": "concat_1_y", "field": "weather", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_1_y'))"}
}
}
diff --git a/examples/compiled/errorbar_2d_vertical_ticks.png b/examples/compiled/errorbar_2d_vertical_ticks.png
index 8c4828d6a6..a5ac9cd539 100644
Binary files a/examples/compiled/errorbar_2d_vertical_ticks.png and b/examples/compiled/errorbar_2d_vertical_ticks.png differ
diff --git a/examples/compiled/errorbar_2d_vertical_ticks.svg b/examples/compiled/errorbar_2d_vertical_ticks.svg
index 6de06f9260..49ef22cd48 100644
--- a/examples/compiled/errorbar_2d_vertical_ticks.svg
+++ b/examples/compiled/errorbar_2d_vertical_ticks.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/errorbar_2d_vertical_ticks.vg.json b/examples/compiled/errorbar_2d_vertical_ticks.vg.json
index 35c3dd8558..476dce917f 100644
--- a/examples/compiled/errorbar_2d_vertical_ticks.vg.json
+++ b/examples/compiled/errorbar_2d_vertical_ticks.vg.json
@@ -69,10 +69,10 @@
"tooltip": {
"signal": "{\"Ci1 of Miles_per_Gallon\": format(datum[\"upper_Miles_per_Gallon\"], \"\"), \"Ci0 of Miles_per_Gallon\": format(datum[\"lower_Miles_per_Gallon\"], \"\"), \"Mean of Miles_per_Gallon\": format(datum[\"center_Miles_per_Gallon\"], \"\"), \"Year (year)\": timeFormat(datum[\"year_Year\"], '%b %d, %Y')}"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "year_Year"},
- "yc": {"scale": "y", "field": "lower_Miles_per_Gallon"},
- "width": {"value": 15},
- "height": {"value": 1}
+ "width": {"value": 18},
+ "yc": {"scale": "y", "field": "lower_Miles_per_Gallon"}
}
}
},
@@ -89,10 +89,10 @@
"tooltip": {
"signal": "{\"Ci1 of Miles_per_Gallon\": format(datum[\"upper_Miles_per_Gallon\"], \"\"), \"Ci0 of Miles_per_Gallon\": format(datum[\"lower_Miles_per_Gallon\"], \"\"), \"Mean of Miles_per_Gallon\": format(datum[\"center_Miles_per_Gallon\"], \"\"), \"Year (year)\": timeFormat(datum[\"year_Year\"], '%b %d, %Y')}"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "year_Year"},
- "yc": {"scale": "y", "field": "upper_Miles_per_Gallon"},
- "width": {"value": 15},
- "height": {"value": 1}
+ "width": {"value": 18},
+ "yc": {"scale": "y", "field": "upper_Miles_per_Gallon"}
}
}
},
diff --git a/examples/compiled/errorbar_aggregate.png b/examples/compiled/errorbar_aggregate.png
index af77071551..3f45c61dda 100644
Binary files a/examples/compiled/errorbar_aggregate.png and b/examples/compiled/errorbar_aggregate.png differ
diff --git a/examples/compiled/errorbar_aggregate.svg b/examples/compiled/errorbar_aggregate.svg
index bfaa477b3b..70e3966f45 100644
--- a/examples/compiled/errorbar_aggregate.svg
+++ b/examples/compiled/errorbar_aggregate.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/errorbar_aggregate.vg.json b/examples/compiled/errorbar_aggregate.vg.json
index 70df548211..780c031497 100644
--- a/examples/compiled/errorbar_aggregate.vg.json
+++ b/examples/compiled/errorbar_aggregate.vg.json
@@ -86,10 +86,10 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"min_people\"], \"\"))"
},
- "xc": {"scale": "x", "field": "age", "band": 0.5},
- "yc": {"scale": "y", "field": "min_people"},
+ "height": {"value": 1},
+ "x": {"scale": "x", "field": "age", "band": 0.125},
"width": {"value": 5},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "min_people"}
}
}
},
@@ -105,10 +105,10 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"max_people\"], \"\"))"
},
- "xc": {"scale": "x", "field": "age", "band": 0.5},
- "yc": {"scale": "y", "field": "max_people"},
+ "height": {"value": 1},
+ "x": {"scale": "x", "field": "age", "band": 0.125},
"width": {"value": 5},
- "height": {"value": 1}
+ "yc": {"scale": "y", "field": "max_people"}
}
}
},
diff --git a/examples/compiled/errorbar_horizontal_aggregate.png b/examples/compiled/errorbar_horizontal_aggregate.png
index af085b9dc4..bb042356d6 100644
Binary files a/examples/compiled/errorbar_horizontal_aggregate.png and b/examples/compiled/errorbar_horizontal_aggregate.png differ
diff --git a/examples/compiled/errorbar_horizontal_aggregate.svg b/examples/compiled/errorbar_horizontal_aggregate.svg
index 2ab63ded04..f7c2bb7d7f 100644
--- a/examples/compiled/errorbar_horizontal_aggregate.svg
+++ b/examples/compiled/errorbar_horizontal_aggregate.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/errorbar_horizontal_aggregate.vg.json b/examples/compiled/errorbar_horizontal_aggregate.vg.json
index e1c5a726d4..7fa75ced29 100644
--- a/examples/compiled/errorbar_horizontal_aggregate.vg.json
+++ b/examples/compiled/errorbar_horizontal_aggregate.vg.json
@@ -86,10 +86,10 @@
"description": {
"signal": "\"population: \" + (format(datum[\"min_people\"], \"\")) + \"; age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "min_people"},
- "yc": {"scale": "y", "field": "age", "band": 0.5},
- "height": {"value": 5},
- "width": {"value": 1}
+ "y": {"scale": "y", "field": "age", "band": 0.125},
+ "height": {"value": 5}
}
}
},
@@ -105,10 +105,10 @@
"description": {
"signal": "\"population: \" + (format(datum[\"max_people\"], \"\")) + \"; age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "max_people"},
- "yc": {"scale": "y", "field": "age", "band": 0.5},
- "height": {"value": 5},
- "width": {"value": 1}
+ "y": {"scale": "y", "field": "age", "band": 0.125},
+ "height": {"value": 5}
}
}
},
diff --git a/examples/compiled/facet_bullet.vg.json b/examples/compiled/facet_bullet.vg.json
index d594fea208..79fa44d160 100644
--- a/examples/compiled/facet_bullet.vg.json
+++ b/examples/compiled/facet_bullet.vg.json
@@ -437,10 +437,10 @@
"description": {
"signal": "\"markers[0]: \" + (format(datum[\"markers.0\"], \"\"))"
},
+ "width": {"value": 2},
"xc": {"scale": "child_x", "field": "markers\\.0"},
"yc": {"signal": "child_height", "mult": 0.5},
- "height": {"value": 15},
- "width": {"value": 2}
+ "height": {"mult": 0.75, "field": {"group": "height"}}
}
}
}
diff --git a/examples/compiled/facet_cross_independent_scale.vg.json b/examples/compiled/facet_cross_independent_scale.vg.json
index d6280b91b1..b8bcc12153 100644
--- a/examples/compiled/facet_cross_independent_scale.vg.json
+++ b/examples/compiled/facet_cross_independent_scale.vg.json
@@ -168,9 +168,9 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (isValid(datum[\"b\"]) ? datum[\"b\"] : \"\"+datum[\"b\"])"
},
- "x": {"scale": "child_x", "field": "a"},
+ "xc": {"scale": "child_x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('child_x'))"},
- "y": {"scale": "child_y", "field": "b"},
+ "yc": {"scale": "child_y", "field": "b", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('child_y'))"}
}
}
diff --git a/examples/compiled/facet_custom.svg b/examples/compiled/facet_custom.svg
index 2527a013c9..7e857c7946 100644
--- a/examples/compiled/facet_custom.svg
+++ b/examples/compiled/facet_custom.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/facet_custom.vg.json b/examples/compiled/facet_custom.vg.json
index 8efd0d24a6..7515c9c640 100644
--- a/examples/compiled/facet_custom.vg.json
+++ b/examples/compiled/facet_custom.vg.json
@@ -150,7 +150,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/facet_custom_header.svg b/examples/compiled/facet_custom_header.svg
index 2527a013c9..7e857c7946 100644
--- a/examples/compiled/facet_custom_header.svg
+++ b/examples/compiled/facet_custom_header.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/facet_custom_header.vg.json b/examples/compiled/facet_custom_header.vg.json
index 8efd0d24a6..7515c9c640 100644
--- a/examples/compiled/facet_custom_header.vg.json
+++ b/examples/compiled/facet_custom_header.vg.json
@@ -150,7 +150,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/facet_grid_bar.svg b/examples/compiled/facet_grid_bar.svg
index 758c0e2c96..8a3ff33bce 100644
--- a/examples/compiled/facet_grid_bar.svg
+++ b/examples/compiled/facet_grid_bar.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/facet_grid_bar.vg.json b/examples/compiled/facet_grid_bar.vg.json
index ffe8d7fbb6..2e90d490b6 100644
--- a/examples/compiled/facet_grid_bar.vg.json
+++ b/examples/compiled/facet_grid_bar.vg.json
@@ -191,7 +191,7 @@
},
"x": {"scale": "x", "field": "p_end"},
"x2": {"scale": "x", "field": "p_start"},
- "y": {"scale": "y", "field": "c"},
+ "yc": {"scale": "y", "field": "c", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/facet_independent_scale.svg b/examples/compiled/facet_independent_scale.svg
index b2223dd7d8..3424ee0d37 100644
--- a/examples/compiled/facet_independent_scale.svg
+++ b/examples/compiled/facet_independent_scale.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/facet_independent_scale.vg.json b/examples/compiled/facet_independent_scale.vg.json
index ec52febd7e..c254551cdf 100644
--- a/examples/compiled/facet_independent_scale.vg.json
+++ b/examples/compiled/facet_independent_scale.vg.json
@@ -145,7 +145,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "child_x", "field": "age"},
+ "xc": {"scale": "child_x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('child_x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/hconcat_weather.vg.json b/examples/compiled/hconcat_weather.vg.json
index 240bcd9e94..3786420bbd 100644
--- a/examples/compiled/hconcat_weather.vg.json
+++ b/examples/compiled/hconcat_weather.vg.json
@@ -116,7 +116,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "concat_0_x", "field": "month_date"},
+ "xc": {"scale": "concat_0_x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('concat_0_x'))"},
"y": {"scale": "concat_0_y", "field": "mean_precipitation"},
"y2": {"scale": "concat_0_y", "value": 0}
diff --git a/examples/compiled/histogram_ordinal.png b/examples/compiled/histogram_ordinal.png
index eb920d8265..85560aaacc 100644
Binary files a/examples/compiled/histogram_ordinal.png and b/examples/compiled/histogram_ordinal.png differ
diff --git a/examples/compiled/histogram_ordinal.svg b/examples/compiled/histogram_ordinal.svg
index ab8ff7748a..22f177adbb 100644
--- a/examples/compiled/histogram_ordinal.svg
+++ b/examples/compiled/histogram_ordinal.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/histogram_ordinal.vg.json b/examples/compiled/histogram_ordinal.vg.json
index 1b11b8bd79..fd4739a41e 100644
--- a/examples/compiled/histogram_ordinal.vg.json
+++ b/examples/compiled/histogram_ordinal.vg.json
@@ -65,7 +65,7 @@
"description": {
"signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "bin_maxbins_10_IMDB Rating_range"},
+ "xc": {"scale": "x", "field": "bin_maxbins_10_IMDB Rating_range"},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/histogram_ordinal_sort.png b/examples/compiled/histogram_ordinal_sort.png
index 712fccdc72..be0a08bd43 100644
Binary files a/examples/compiled/histogram_ordinal_sort.png and b/examples/compiled/histogram_ordinal_sort.png differ
diff --git a/examples/compiled/histogram_ordinal_sort.svg b/examples/compiled/histogram_ordinal_sort.svg
index 87613db883..ac13e9faea 100644
--- a/examples/compiled/histogram_ordinal_sort.svg
+++ b/examples/compiled/histogram_ordinal_sort.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/histogram_ordinal_sort.vg.json b/examples/compiled/histogram_ordinal_sort.vg.json
index a31354fb06..a1dadd2b4e 100644
--- a/examples/compiled/histogram_ordinal_sort.vg.json
+++ b/examples/compiled/histogram_ordinal_sort.vg.json
@@ -71,7 +71,7 @@
"description": {
"signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "bin_maxbins_10_IMDB Rating_range"},
+ "xc": {"scale": "x", "field": "bin_maxbins_10_IMDB Rating_range"},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/interactive_bar_select_highlight.vg.json b/examples/compiled/interactive_bar_select_highlight.vg.json
index 4c67db065f..7a9c10fb8b 100644
--- a/examples/compiled/interactive_bar_select_highlight.vg.json
+++ b/examples/compiled/interactive_bar_select_highlight.vg.json
@@ -166,7 +166,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/interactive_concat_layer.svg b/examples/compiled/interactive_concat_layer.svg
index 589f838521..25ba34ca69 100644
--- a/examples/compiled/interactive_concat_layer.svg
+++ b/examples/compiled/interactive_concat_layer.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/interactive_concat_layer.vg.json b/examples/compiled/interactive_concat_layer.vg.json
index 8fe143bcde..f78c3b4911 100644
--- a/examples/compiled/interactive_concat_layer.vg.json
+++ b/examples/compiled/interactive_concat_layer.vg.json
@@ -324,7 +324,11 @@
"description": {
"signal": "\"Major Genre: \" + (isValid(datum[\"Major Genre\"]) ? datum[\"Major Genre\"] : \"\"+datum[\"Major Genre\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "concat_1_x", "field": "Major Genre"},
+ "xc": {
+ "scale": "concat_1_x",
+ "field": "Major Genre",
+ "band": 0.5
+ },
"width": {"signal": "max(0.25, bandwidth('concat_1_x'))"},
"y": {"scale": "concat_1_y", "field": "__count"},
"y2": {"scale": "concat_1_y", "value": 0}
diff --git a/examples/compiled/interactive_dashboard_europe_pop.svg b/examples/compiled/interactive_dashboard_europe_pop.svg
index d95d788ccc..aa881ebe27 100644
--- a/examples/compiled/interactive_dashboard_europe_pop.svg
+++ b/examples/compiled/interactive_dashboard_europe_pop.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/interactive_dashboard_europe_pop.vg.json b/examples/compiled/interactive_dashboard_europe_pop.vg.json
index 5816e34a46..f90ba0125b 100644
--- a/examples/compiled/interactive_dashboard_europe_pop.vg.json
+++ b/examples/compiled/interactive_dashboard_europe_pop.vg.json
@@ -625,7 +625,7 @@
"scale": "concat_0_x",
"field": "Population_ages_15_64_of_total_start"
},
- "y": {"scale": "concat_0_y", "field": "Country"},
+ "yc": {"scale": "concat_0_y", "field": "Country", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_0_y'))"}
}
}
@@ -949,7 +949,7 @@
"scale": "concat_1_x",
"field": "Population_ages_65_and_above_of_total_start"
},
- "y": {"scale": "concat_1_y", "field": "Country"},
+ "yc": {"scale": "concat_1_y", "field": "Country", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_1_y'))"}
}
}
diff --git a/examples/compiled/interactive_seattle_weather.vg.json b/examples/compiled/interactive_seattle_weather.vg.json
index 985b686756..d21229bbe1 100644
--- a/examples/compiled/interactive_seattle_weather.vg.json
+++ b/examples/compiled/interactive_seattle_weather.vg.json
@@ -503,7 +503,7 @@
},
"x": {"scale": "concat_1_x", "field": "__count"},
"x2": {"scale": "concat_1_x", "value": 0},
- "y": {"scale": "concat_1_y", "field": "weather"},
+ "yc": {"scale": "concat_1_y", "field": "weather", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('concat_1_y'))"}
}
}
diff --git a/examples/compiled/joinaggregate_mean_difference.vg.json b/examples/compiled/joinaggregate_mean_difference.vg.json
index d3592f878a..37fa5814d8 100644
--- a/examples/compiled/joinaggregate_mean_difference.vg.json
+++ b/examples/compiled/joinaggregate_mean_difference.vg.json
@@ -81,7 +81,7 @@
},
"x": {"scale": "x", "field": "IMDB Rating_end"},
"x2": {"scale": "x", "field": "IMDB Rating_start"},
- "y": {"scale": "y", "field": "Title"},
+ "yc": {"scale": "y", "field": "Title", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/joinaggregate_mean_difference_by_year.png b/examples/compiled/joinaggregate_mean_difference_by_year.png
index 3c437b0a94..5b08a99401 100644
Binary files a/examples/compiled/joinaggregate_mean_difference_by_year.png and b/examples/compiled/joinaggregate_mean_difference_by_year.png differ
diff --git a/examples/compiled/joinaggregate_mean_difference_by_year.svg b/examples/compiled/joinaggregate_mean_difference_by_year.svg
index 3311d20410..0857afbef0 100644
--- a/examples/compiled/joinaggregate_mean_difference_by_year.svg
+++ b/examples/compiled/joinaggregate_mean_difference_by_year.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/joinaggregate_mean_difference_by_year.vg.json b/examples/compiled/joinaggregate_mean_difference_by_year.vg.json
index 611937a644..1111bfc145 100644
--- a/examples/compiled/joinaggregate_mean_difference_by_year.vg.json
+++ b/examples/compiled/joinaggregate_mean_difference_by_year.vg.json
@@ -83,7 +83,7 @@
},
"x": {"scale": "x", "field": "IMDB Rating_end"},
"x2": {"scale": "x", "field": "IMDB Rating_start"},
- "y": {"scale": "y", "field": "Title"},
+ "yc": {"scale": "y", "field": "Title", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
@@ -101,10 +101,10 @@
"description": {
"signal": "\"AverageYearRating: \" + (format(datum[\"AverageYearRating\"], \"\")) + \"; Title: \" + (isValid(datum[\"Title\"]) ? datum[\"Title\"] : \"\"+datum[\"Title\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "AverageYearRating"},
"yc": {"scale": "y", "field": "Title", "band": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
}
diff --git a/examples/compiled/joinaggregate_percent_of_total.svg b/examples/compiled/joinaggregate_percent_of_total.svg
index fb0eb20ba7..6e49682d93 100644
--- a/examples/compiled/joinaggregate_percent_of_total.svg
+++ b/examples/compiled/joinaggregate_percent_of_total.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/joinaggregate_percent_of_total.vg.json b/examples/compiled/joinaggregate_percent_of_total.vg.json
index 2258fe7f1d..f5617de116 100644
--- a/examples/compiled/joinaggregate_percent_of_total.vg.json
+++ b/examples/compiled/joinaggregate_percent_of_total.vg.json
@@ -68,7 +68,7 @@
},
"x": {"scale": "x", "field": "PercentOfTotal_end"},
"x2": {"scale": "x", "field": "PercentOfTotal_start"},
- "y": {"scale": "y", "field": "Activity"},
+ "yc": {"scale": "y", "field": "Activity", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/layer_bar_annotations.vg.json b/examples/compiled/layer_bar_annotations.vg.json
index 0c4bd6ee71..dd6229b65f 100644
--- a/examples/compiled/layer_bar_annotations.vg.json
+++ b/examples/compiled/layer_bar_annotations.vg.json
@@ -78,7 +78,7 @@
"description": {
"signal": "\"Day: \" + (isValid(datum[\"Day\"]) ? datum[\"Day\"] : \"\"+datum[\"Day\"]) + \"; Value: \" + (format(datum[\"Value\"], \"\"))"
},
- "x": {"scale": "x", "field": "Day"},
+ "xc": {"scale": "x", "field": "Day", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "Value_end"},
"y2": {"scale": "y", "field": "Value_start"}
@@ -97,7 +97,7 @@
"description": {
"signal": "\"Day: \" + (isValid(datum[\"Day\"]) ? datum[\"Day\"] : \"\"+datum[\"Day\"]) + \"; PM2.5 Value: \" + (format(datum[\"baseline\"], \"\")) + \"; Value: \" + (format(datum[\"Value\"], \"\"))"
},
- "x": {"scale": "x", "field": "Day"},
+ "xc": {"scale": "x", "field": "Day", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "baseline"},
"y2": {"scale": "y", "field": "Value"}
diff --git a/examples/compiled/layer_bar_circle_grouped.vg.json b/examples/compiled/layer_bar_circle_grouped.vg.json
index 4de4dea6d2..471580a1b3 100644
--- a/examples/compiled/layer_bar_circle_grouped.vg.json
+++ b/examples/compiled/layer_bar_circle_grouped.vg.json
@@ -76,10 +76,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/layer_bar_fruit.vg.json b/examples/compiled/layer_bar_fruit.vg.json
index e7d01668fb..bde754ed4d 100644
--- a/examples/compiled/layer_bar_fruit.vg.json
+++ b/examples/compiled/layer_bar_fruit.vg.json
@@ -70,7 +70,7 @@
},
"x": {"scale": "x", "field": "count_end"},
"x2": {"scale": "x", "field": "count_start"},
- "y": {"scale": "y", "field": "name"},
+ "yc": {"scale": "y", "field": "name", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/layer_bar_grouped_line_ungrouped.vg.json b/examples/compiled/layer_bar_grouped_line_ungrouped.vg.json
index bd2e4f27df..088d1ff817 100644
--- a/examples/compiled/layer_bar_grouped_line_ungrouped.vg.json
+++ b/examples/compiled/layer_bar_grouped_line_ungrouped.vg.json
@@ -74,10 +74,10 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "value_end"},
diff --git a/examples/compiled/layer_bar_labels.vg.json b/examples/compiled/layer_bar_labels.vg.json
index 31d397cd71..4609b051c6 100644
--- a/examples/compiled/layer_bar_labels.vg.json
+++ b/examples/compiled/layer_bar_labels.vg.json
@@ -61,7 +61,7 @@
},
"x": {"scale": "x", "field": "b_end"},
"x2": {"scale": "x", "field": "b_start"},
- "y": {"scale": "y", "field": "a"},
+ "yc": {"scale": "y", "field": "a", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/layer_bar_labels_grey.vg.json b/examples/compiled/layer_bar_labels_grey.vg.json
index 8b77756483..06732ce2df 100644
--- a/examples/compiled/layer_bar_labels_grey.vg.json
+++ b/examples/compiled/layer_bar_labels_grey.vg.json
@@ -52,7 +52,7 @@
},
"x": {"scale": "x", "field": "mean_IMDB Rating"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "Major Genre"},
+ "yc": {"scale": "y", "field": "Major Genre", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/layer_bar_labels_style.vg.json b/examples/compiled/layer_bar_labels_style.vg.json
index dd0169cc9c..7e3ed86509 100644
--- a/examples/compiled/layer_bar_labels_style.vg.json
+++ b/examples/compiled/layer_bar_labels_style.vg.json
@@ -60,7 +60,7 @@
},
"x": {"scale": "x", "field": "b_end"},
"x2": {"scale": "x", "field": "b_start"},
- "y": {"scale": "y", "field": "a"},
+ "yc": {"scale": "y", "field": "a", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/layer_bar_line.vg.json b/examples/compiled/layer_bar_line.vg.json
index 0fa026c72d..81b7be3cd7 100644
--- a/examples/compiled/layer_bar_line.vg.json
+++ b/examples/compiled/layer_bar_line.vg.json
@@ -58,7 +58,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/layer_bar_line_union.vg.json b/examples/compiled/layer_bar_line_union.vg.json
index 3cf4f28bc2..667990fd30 100644
--- a/examples/compiled/layer_bar_line_union.vg.json
+++ b/examples/compiled/layer_bar_line_union.vg.json
@@ -58,7 +58,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; c: \" + (format(datum[\"c\"], \"\"))"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "c_end"},
"y2": {"scale": "y", "field": "c_start"}
diff --git a/examples/compiled/layer_bar_month.vg.json b/examples/compiled/layer_bar_month.vg.json
index 98c23e75f6..a80ea3d614 100644
--- a/examples/compiled/layer_bar_month.vg.json
+++ b/examples/compiled/layer_bar_month.vg.json
@@ -71,7 +71,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_precipitation"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/layer_bar_tick_datum_grouped.vg.json b/examples/compiled/layer_bar_tick_datum_grouped.vg.json
index 335a19cc9d..150ad159ca 100644
--- a/examples/compiled/layer_bar_tick_datum_grouped.vg.json
+++ b/examples/compiled/layer_bar_tick_datum_grouped.vg.json
@@ -48,10 +48,10 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Mean of Acceleration: \" + (format(datum[\"mean_Acceleration\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])"
},
- "x": {
+ "xc": {
"scale": "x",
"field": "Cylinders",
- "offset": {"scale": "xOffset", "field": "Origin"}
+ "offset": {"scale": "xOffset", "field": "Origin", "band": 0.5}
},
"width": {"signal": "max(0.25, bandwidth('xOffset'))"},
"y": {"scale": "y", "field": "mean_Acceleration"},
@@ -72,14 +72,14 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])"
},
+ "height": {"value": 1},
"xc": {
"scale": "x",
"field": "Cylinders",
"offset": {"scale": "xOffset", "field": "Origin", "band": 0.5}
},
- "yc": {"scale": "y", "value": 10},
- "width": {"value": 15},
- "height": {"value": 1}
+ "width": {"signal": "0.75 * bandwidth('xOffset')"},
+ "yc": {"scale": "y", "value": 10}
}
}
}
diff --git a/examples/compiled/layer_boxplot_circle.vg.json b/examples/compiled/layer_boxplot_circle.vg.json
index bf1b80bc52..bc6d37a67d 100644
--- a/examples/compiled/layer_boxplot_circle.vg.json
+++ b/examples/compiled/layer_boxplot_circle.vg.json
@@ -191,10 +191,10 @@
"tooltip": {
"signal": "{\"Max of population\": format(datum[\"max_people\"], \"\"), \"Q3 of population\": format(datum[\"upper_box_people\"], \"\"), \"Median of population\": format(datum[\"mid_box_people\"], \"\"), \"Q1 of population\": format(datum[\"lower_box_people\"], \"\"), \"Min of population\": format(datum[\"min_people\"], \"\"), \"age\": isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "mid_box_people"},
"yc": {"scale": "y", "field": "age", "band": 0.5},
- "height": {"value": 14},
- "width": {"value": 1}
+ "height": {"value": 14}
}
}
},
diff --git a/examples/compiled/layer_likert.png b/examples/compiled/layer_likert.png
index 27a90920e2..7780c5a826 100644
Binary files a/examples/compiled/layer_likert.png and b/examples/compiled/layer_likert.png differ
diff --git a/examples/compiled/layer_likert.svg b/examples/compiled/layer_likert.svg
index 2f39416374..d6ad221b36 100644
--- a/examples/compiled/layer_likert.svg
+++ b/examples/compiled/layer_likert.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/layer_likert.vg.json b/examples/compiled/layer_likert.vg.json
index 2de2020aba..ae011a06fb 100644
--- a/examples/compiled/layer_likert.vg.json
+++ b/examples/compiled/layer_likert.vg.json
@@ -271,7 +271,7 @@
"signal": "\"value: \" + (format(datum[\"value\"], \"\")) + \"; name: \" + (isValid(datum[\"name\"]) ? datum[\"name\"] : \"\"+datum[\"name\"]) + \"; Number of Ratings: \" + (format(datum[\"__count\"], \"\"))"
},
"x": {"scale": "x", "field": "value"},
- "y": {"scale": "y", "field": "name"},
+ "y": {"scale": "y", "field": "name", "band": 0.5},
"size": {"scale": "size", "field": "__count"},
"shape": {"value": "circle"}
}
@@ -290,10 +290,10 @@
"description": {
"signal": "\"median: \" + (format(datum[\"median\"], \"\")) + \"; name: \" + (isValid(datum[\"name\"]) ? datum[\"name\"] : \"\"+datum[\"name\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "median"},
- "yc": {"scale": "y", "field": "name"},
- "height": {"value": 15},
- "width": {"value": 1}
+ "yc": {"scale": "y", "field": "name", "band": 0.5},
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
},
@@ -310,7 +310,7 @@
"signal": "\"name: \" + (isValid(datum[\"name\"]) ? datum[\"name\"] : \"\"+datum[\"name\"]) + \"; lo: \" + (isValid(datum[\"lo\"]) ? datum[\"lo\"] : \"\"+datum[\"lo\"])"
},
"x": {"value": -5},
- "y": {"scale": "y", "field": "name"},
+ "y": {"scale": "y", "field": "name", "band": 0.5},
"text": {
"signal": "isValid(datum[\"lo\"]) ? datum[\"lo\"] : \"\"+datum[\"lo\"]"
},
@@ -331,7 +331,7 @@
"signal": "\"name: \" + (isValid(datum[\"name\"]) ? datum[\"name\"] : \"\"+datum[\"name\"]) + \"; hi: \" + (isValid(datum[\"hi\"]) ? datum[\"hi\"] : \"\"+datum[\"hi\"])"
},
"x": {"value": 255},
- "y": {"scale": "y", "field": "name"},
+ "y": {"scale": "y", "field": "name", "band": 0.5},
"text": {
"signal": "isValid(datum[\"hi\"]) ? datum[\"hi\"] : \"\"+datum[\"hi\"]"
},
@@ -350,7 +350,7 @@
},
{
"name": "y",
- "type": "point",
+ "type": "band",
"domain": {
"fields": [
{"data": "data_1", "field": "name"},
@@ -359,7 +359,8 @@
]
},
"range": [0, {"signal": "height"}],
- "padding": 0.5
+ "paddingInner": 0,
+ "paddingOuter": 0
},
{
"name": "size",
diff --git a/examples/compiled/layer_point_errorbar_2d_horizontal_color_encoding.vg.json b/examples/compiled/layer_point_errorbar_2d_horizontal_color_encoding.vg.json
index eea7d71aef..cf75a9f09e 100644
--- a/examples/compiled/layer_point_errorbar_2d_horizontal_color_encoding.vg.json
+++ b/examples/compiled/layer_point_errorbar_2d_horizontal_color_encoding.vg.json
@@ -84,10 +84,10 @@
"tooltip": {
"signal": "{\"Mean of yield\": format(datum[\"center_yield\"], \"\"), \"Mean + stderr of yield\": format(datum[\"upper_yield\"], \"\"), \"Mean - stderr of yield\": format(datum[\"lower_yield\"], \"\"), \"variety\": isValid(datum[\"variety\"]) ? datum[\"variety\"] : \"\"+datum[\"variety\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "lower_yield"},
"yc": {"scale": "y", "field": "variety", "band": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
},
@@ -104,10 +104,10 @@
"tooltip": {
"signal": "{\"Mean of yield\": format(datum[\"center_yield\"], \"\"), \"Mean + stderr of yield\": format(datum[\"upper_yield\"], \"\"), \"Mean - stderr of yield\": format(datum[\"lower_yield\"], \"\"), \"variety\": isValid(datum[\"variety\"]) ? datum[\"variety\"] : \"\"+datum[\"variety\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "upper_yield"},
"yc": {"scale": "y", "field": "variety", "band": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
},
diff --git a/examples/compiled/layer_point_errorbar_2d_horizontal_custom_ticks.vg.json b/examples/compiled/layer_point_errorbar_2d_horizontal_custom_ticks.vg.json
index b36cf09ebf..440c305548 100644
--- a/examples/compiled/layer_point_errorbar_2d_horizontal_custom_ticks.vg.json
+++ b/examples/compiled/layer_point_errorbar_2d_horizontal_custom_ticks.vg.json
@@ -84,10 +84,10 @@
"tooltip": {
"signal": "{\"Mean of yield\": format(datum[\"center_yield\"], \"\"), \"Mean + stderr of yield\": format(datum[\"upper_yield\"], \"\"), \"Mean - stderr of yield\": format(datum[\"lower_yield\"], \"\"), \"variety\": isValid(datum[\"variety\"]) ? datum[\"variety\"] : \"\"+datum[\"variety\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "lower_yield"},
"yc": {"scale": "y", "field": "variety", "band": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
},
@@ -104,10 +104,10 @@
"tooltip": {
"signal": "{\"Mean of yield\": format(datum[\"center_yield\"], \"\"), \"Mean + stderr of yield\": format(datum[\"upper_yield\"], \"\"), \"Mean - stderr of yield\": format(datum[\"lower_yield\"], \"\"), \"variety\": isValid(datum[\"variety\"]) ? datum[\"variety\"] : \"\"+datum[\"variety\"]}"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "upper_yield"},
"yc": {"scale": "y", "field": "variety", "band": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
},
diff --git a/examples/compiled/layer_precipitation_mean.vg.json b/examples/compiled/layer_precipitation_mean.vg.json
index 6d2e5e4be2..728cc0a2cc 100644
--- a/examples/compiled/layer_precipitation_mean.vg.json
+++ b/examples/compiled/layer_precipitation_mean.vg.json
@@ -71,7 +71,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_precipitation"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/layer_text_heatmap.vg.json b/examples/compiled/layer_text_heatmap.vg.json
index 4f005e6d2d..d46c8abfa2 100644
--- a/examples/compiled/layer_text_heatmap.vg.json
+++ b/examples/compiled/layer_text_heatmap.vg.json
@@ -47,9 +47,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"num_cars\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/layer_text_heatmap_joinaggregate.vg.json b/examples/compiled/layer_text_heatmap_joinaggregate.vg.json
index 030416d423..6628e51f23 100644
--- a/examples/compiled/layer_text_heatmap_joinaggregate.vg.json
+++ b/examples/compiled/layer_text_heatmap_joinaggregate.vg.json
@@ -58,9 +58,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"num_cars\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/lookup.vg.json b/examples/compiled/lookup.vg.json
index 461db2d4fd..d361598835 100644
--- a/examples/compiled/lookup.vg.json
+++ b/examples/compiled/lookup.vg.json
@@ -56,7 +56,7 @@
"description": {
"signal": "\"group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"]) + \"; Mean of age: \" + (format(datum[\"mean_age\"], \"\"))"
},
- "x": {"scale": "x", "field": "group"},
+ "xc": {"scale": "x", "field": "group", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_age"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/parallel_coordinate.vg.json b/examples/compiled/parallel_coordinate.vg.json
index 657a014d4b..cd6854ae43 100644
--- a/examples/compiled/parallel_coordinate.vg.json
+++ b/examples/compiled/parallel_coordinate.vg.json
@@ -151,10 +151,10 @@
"description": {
"signal": "\"key: \" + (isValid(datum[\"key\"]) ? datum[\"key\"] : \"\"+datum[\"key\"])"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "key", "band": 0.5},
- "yc": {"value": 0},
"width": {"value": 8},
- "height": {"value": 1}
+ "yc": {"value": 0}
}
}
},
@@ -188,10 +188,10 @@
"description": {
"signal": "\"key: \" + (isValid(datum[\"key\"]) ? datum[\"key\"] : \"\"+datum[\"key\"])"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "key", "band": 0.5},
- "yc": {"value": 150},
"width": {"value": 8},
- "height": {"value": 1}
+ "yc": {"value": 150}
}
}
},
@@ -225,10 +225,10 @@
"description": {
"signal": "\"key: \" + (isValid(datum[\"key\"]) ? datum[\"key\"] : \"\"+datum[\"key\"])"
},
+ "height": {"value": 1},
"xc": {"scale": "x", "field": "key", "band": 0.5},
- "yc": {"value": 300},
"width": {"value": 8},
- "height": {"value": 1}
+ "yc": {"value": 300}
}
}
}
diff --git a/examples/compiled/rect_heatmap.vg.json b/examples/compiled/rect_heatmap.vg.json
index 5afa68acb2..ff7bcf18b3 100644
--- a/examples/compiled/rect_heatmap.vg.json
+++ b/examples/compiled/rect_heatmap.vg.json
@@ -41,9 +41,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Mean of Horsepower: \" + (format(datum[\"mean_Horsepower\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/rect_heatmap_weather.vg.json b/examples/compiled/rect_heatmap_weather.vg.json
index 6c00cfca80..e9cfdb4d25 100644
--- a/examples/compiled/rect_heatmap_weather.vg.json
+++ b/examples/compiled/rect_heatmap_weather.vg.json
@@ -60,9 +60,9 @@
"description": {
"signal": "\"Day: \" + (timeFormat(datum[\"date_date\"], '%e')) + \"; Month: \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Max of temp_max: \" + (format(datum[\"max_temp_max\"], \"\"))"
},
- "x": {"scale": "x", "field": "date_date"},
+ "xc": {"scale": "x", "field": "date_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "month_date"},
+ "yc": {"scale": "y", "field": "month_date", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/rect_lasagna.svg b/examples/compiled/rect_lasagna.svg
index 99fe05b88a..4775220d96 100644
--- a/examples/compiled/rect_lasagna.svg
+++ b/examples/compiled/rect_lasagna.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/rect_lasagna.vg.json b/examples/compiled/rect_lasagna.vg.json
index 95f0ff9d87..aac763d114 100644
--- a/examples/compiled/rect_lasagna.vg.json
+++ b/examples/compiled/rect_lasagna.vg.json
@@ -44,9 +44,9 @@
"description": {
"signal": "\"Time: \" + (timeFormat(datum[\"yearmonthdate_date\"], '%Y')) + \"; symbol: \" + (isValid(datum[\"symbol\"]) ? datum[\"symbol\"] : \"\"+datum[\"symbol\"]) + \"; Price: \" + (format(datum[\"sum_price\"], \"\"))"
},
- "x": {"scale": "x", "field": "yearmonthdate_date"},
+ "xc": {"scale": "x", "field": "yearmonthdate_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "symbol"},
+ "yc": {"scale": "y", "field": "symbol", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_composition_and.vg.json b/examples/compiled/selection_composition_and.vg.json
index d7736f2efa..9e7e9b23f5 100644
--- a/examples/compiled/selection_composition_and.vg.json
+++ b/examples/compiled/selection_composition_and.vg.json
@@ -584,9 +584,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_composition_or.vg.json b/examples/compiled/selection_composition_or.vg.json
index 78ada163fa..61d2806103 100644
--- a/examples/compiled/selection_composition_or.vg.json
+++ b/examples/compiled/selection_composition_or.vg.json
@@ -584,9 +584,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_heatmap.vg.json b/examples/compiled/selection_heatmap.vg.json
index c3d9ddae10..6ed7c286ec 100644
--- a/examples/compiled/selection_heatmap.vg.json
+++ b/examples/compiled/selection_heatmap.vg.json
@@ -120,9 +120,9 @@
"description": {
"signal": "\"predicted: \" + (isValid(datum[\"predicted\"]) ? datum[\"predicted\"] : \"\"+datum[\"predicted\"]) + \"; actual: \" + (isValid(datum[\"actual\"]) ? datum[\"actual\"] : \"\"+datum[\"actual\"]) + \"; count: \" + (format(datum[\"count\"], \"\"))"
},
- "x": {"scale": "x", "field": "predicted"},
+ "xc": {"scale": "x", "field": "predicted", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "actual"},
+ "yc": {"scale": "y", "field": "actual", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_interval_mark_style.vg.json b/examples/compiled/selection_interval_mark_style.vg.json
index f49328edbc..22606bda49 100644
--- a/examples/compiled/selection_interval_mark_style.vg.json
+++ b/examples/compiled/selection_interval_mark_style.vg.json
@@ -577,9 +577,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_layer_bar_month.vg.json b/examples/compiled/selection_layer_bar_month.vg.json
index bf4b4c590d..8d7fd3772b 100644
--- a/examples/compiled/selection_layer_bar_month.vg.json
+++ b/examples/compiled/selection_layer_bar_month.vg.json
@@ -296,7 +296,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "mean_precipitation"},
"y2": {"scale": "y", "value": 0}
diff --git a/examples/compiled/selection_project_interval.vg.json b/examples/compiled/selection_project_interval.vg.json
index 617dbefacc..07cbce17e6 100644
--- a/examples/compiled/selection_project_interval.vg.json
+++ b/examples/compiled/selection_project_interval.vg.json
@@ -307,9 +307,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_project_interval_x.vg.json b/examples/compiled/selection_project_interval_x.vg.json
index 158d58798c..61e6d7818f 100644
--- a/examples/compiled/selection_project_interval_x.vg.json
+++ b/examples/compiled/selection_project_interval_x.vg.json
@@ -250,9 +250,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_project_interval_x_y.vg.json b/examples/compiled/selection_project_interval_x_y.vg.json
index 617dbefacc..07cbce17e6 100644
--- a/examples/compiled/selection_project_interval_x_y.vg.json
+++ b/examples/compiled/selection_project_interval_x_y.vg.json
@@ -307,9 +307,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_project_interval_y.vg.json b/examples/compiled/selection_project_interval_y.vg.json
index e9edd1f855..f845cd313e 100644
--- a/examples/compiled/selection_project_interval_y.vg.json
+++ b/examples/compiled/selection_project_interval_y.vg.json
@@ -250,9 +250,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_type_interval.vg.json b/examples/compiled/selection_type_interval.vg.json
index 617dbefacc..07cbce17e6 100644
--- a/examples/compiled/selection_type_interval.vg.json
+++ b/examples/compiled/selection_type_interval.vg.json
@@ -307,9 +307,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_type_interval_invert.vg.json b/examples/compiled/selection_type_interval_invert.vg.json
index 04ca6d0f8d..32ec0d4853 100644
--- a/examples/compiled/selection_type_interval_invert.vg.json
+++ b/examples/compiled/selection_type_interval_invert.vg.json
@@ -306,9 +306,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_type_point.vg.json b/examples/compiled/selection_type_point.vg.json
index 77df606b03..24da0c5b9d 100644
--- a/examples/compiled/selection_type_point.vg.json
+++ b/examples/compiled/selection_type_point.vg.json
@@ -96,9 +96,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_type_single_dblclick.vg.json b/examples/compiled/selection_type_single_dblclick.vg.json
index 29abd06d18..938e673b89 100644
--- a/examples/compiled/selection_type_single_dblclick.vg.json
+++ b/examples/compiled/selection_type_single_dblclick.vg.json
@@ -96,9 +96,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/selection_type_single_pointerover.vg.json b/examples/compiled/selection_type_single_pointerover.vg.json
index bacea56be8..58f9c2e695 100644
--- a/examples/compiled/selection_type_single_pointerover.vg.json
+++ b/examples/compiled/selection_type_single_pointerover.vg.json
@@ -96,9 +96,9 @@
"description": {
"signal": "\"Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"]) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
- "x": {"scale": "x", "field": "Cylinders"},
+ "xc": {"scale": "x", "field": "Cylinders", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
- "y": {"scale": "y", "field": "Origin"},
+ "yc": {"scale": "y", "field": "Origin", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/stacked_bar_count.vg.json b/examples/compiled/stacked_bar_count.vg.json
index 122e0b7c50..d82c1fdde4 100644
--- a/examples/compiled/stacked_bar_count.vg.json
+++ b/examples/compiled/stacked_bar_count.vg.json
@@ -54,7 +54,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\")) + \"; weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"])"
},
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count_end"},
"y2": {"scale": "y", "field": "__count_start"}
diff --git a/examples/compiled/stacked_bar_count_corner_radius_config.vg.json b/examples/compiled/stacked_bar_count_corner_radius_config.vg.json
index 71509e63d7..04fb4903f4 100644
--- a/examples/compiled/stacked_bar_count_corner_radius_config.vg.json
+++ b/examples/compiled/stacked_bar_count_corner_radius_config.vg.json
@@ -62,7 +62,7 @@
},
"encode": {
"update": {
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {
"signal": "min(scale('y',datum[\"min___count_start\"]),scale('y',datum[\"max___count_start\"]),scale('y',datum[\"min___count_end\"]),scale('y',datum[\"max___count_end\"]))"
diff --git a/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json b/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json
index 0c06b8c8ec..00bcd21c14 100644
--- a/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json
+++ b/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json
@@ -62,7 +62,7 @@
},
"encode": {
"update": {
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {
"signal": "min(scale('y',datum[\"min___count_start\"]),scale('y',datum[\"max___count_start\"]),scale('y',datum[\"min___count_end\"]),scale('y',datum[\"max___count_end\"]))"
diff --git a/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json b/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json
index 984baf0d17..65047bd88d 100644
--- a/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json
+++ b/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json
@@ -62,7 +62,7 @@
},
"encode": {
"update": {
- "y": {"scale": "y", "field": "month_date"},
+ "yc": {"scale": "y", "field": "month_date", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"},
"cornerRadiusTopRight": {"value": 8},
"cornerRadiusBottomRight": {"value": 8},
diff --git a/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json b/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json
index 15bd6cdf6c..8be65e82d2 100644
--- a/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json
+++ b/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json
@@ -62,7 +62,7 @@
},
"encode": {
"update": {
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {
"signal": "min(scale('y',datum[\"min___count_start\"]),scale('y',datum[\"max___count_start\"]),scale('y',datum[\"min___count_end\"]),scale('y',datum[\"max___count_end\"]))"
diff --git a/examples/compiled/stacked_bar_h.vg.json b/examples/compiled/stacked_bar_h.vg.json
index 2d7351dc7a..671b67752c 100644
--- a/examples/compiled/stacked_bar_h.vg.json
+++ b/examples/compiled/stacked_bar_h.vg.json
@@ -54,7 +54,7 @@
},
"x": {"scale": "x", "field": "sum_yield_end"},
"x2": {"scale": "x", "field": "sum_yield_start"},
- "y": {"scale": "y", "field": "variety"},
+ "yc": {"scale": "y", "field": "variety", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/stacked_bar_h_normalized_labeled.svg b/examples/compiled/stacked_bar_h_normalized_labeled.svg
index badef42ad7..e96de831e3 100644
--- a/examples/compiled/stacked_bar_h_normalized_labeled.svg
+++ b/examples/compiled/stacked_bar_h_normalized_labeled.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/stacked_bar_h_normalized_labeled.vg.json b/examples/compiled/stacked_bar_h_normalized_labeled.vg.json
index 87e5d5c356..e993531897 100644
--- a/examples/compiled/stacked_bar_h_normalized_labeled.vg.json
+++ b/examples/compiled/stacked_bar_h_normalized_labeled.vg.json
@@ -76,7 +76,7 @@
},
"x": {"scale": "x", "field": "sum_people_end"},
"x2": {"scale": "x", "field": "sum_people_start"},
- "y": {"scale": "y", "field": "age"},
+ "yc": {"scale": "y", "field": "age", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/stacked_bar_h_order.vg.json b/examples/compiled/stacked_bar_h_order.vg.json
index bf3acb95fb..3bc3bc5bb6 100644
--- a/examples/compiled/stacked_bar_h_order.vg.json
+++ b/examples/compiled/stacked_bar_h_order.vg.json
@@ -54,7 +54,7 @@
},
"x": {"scale": "x", "field": "sum_yield_end"},
"x2": {"scale": "x", "field": "sum_yield_start"},
- "y": {"scale": "y", "field": "variety"},
+ "yc": {"scale": "y", "field": "variety", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/stacked_bar_h_order_custom.vg.json b/examples/compiled/stacked_bar_h_order_custom.vg.json
index b1bd41de1e..3a4a3e04aa 100644
--- a/examples/compiled/stacked_bar_h_order_custom.vg.json
+++ b/examples/compiled/stacked_bar_h_order_custom.vg.json
@@ -59,7 +59,7 @@
},
"x": {"scale": "x", "field": "sum_yield_end"},
"x2": {"scale": "x", "field": "sum_yield_start"},
- "y": {"scale": "y", "field": "variety"},
+ "yc": {"scale": "y", "field": "variety", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/stacked_bar_normalize.svg b/examples/compiled/stacked_bar_normalize.svg
index ae3f026c05..df51a3bf9a 100644
--- a/examples/compiled/stacked_bar_normalize.svg
+++ b/examples/compiled/stacked_bar_normalize.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/stacked_bar_normalize.vg.json b/examples/compiled/stacked_bar_normalize.vg.json
index 08df66d85e..2a9580baf6 100644
--- a/examples/compiled/stacked_bar_normalize.vg.json
+++ b/examples/compiled/stacked_bar_normalize.vg.json
@@ -58,7 +58,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people_end\"]-datum[\"sum_people_start\"], \".0%\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/stacked_bar_population.svg b/examples/compiled/stacked_bar_population.svg
index 6a4453dd6b..f6be828a8c 100644
--- a/examples/compiled/stacked_bar_population.svg
+++ b/examples/compiled/stacked_bar_population.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/stacked_bar_population.vg.json b/examples/compiled/stacked_bar_population.vg.json
index 89196843e0..af9a8e85e7 100644
--- a/examples/compiled/stacked_bar_population.vg.json
+++ b/examples/compiled/stacked_bar_population.vg.json
@@ -59,7 +59,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/stacked_bar_population_transform.svg b/examples/compiled/stacked_bar_population_transform.svg
index 9dd896ffed..38e0e488c2 100644
--- a/examples/compiled/stacked_bar_population_transform.svg
+++ b/examples/compiled/stacked_bar_population_transform.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/stacked_bar_population_transform.vg.json b/examples/compiled/stacked_bar_population_transform.vg.json
index 1d5c55b211..daab99a320 100644
--- a/examples/compiled/stacked_bar_population_transform.vg.json
+++ b/examples/compiled/stacked_bar_population_transform.vg.json
@@ -52,7 +52,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"v1\"], \"\")) + \"; v2: \" + (format(datum[\"v2\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "v1"},
"y2": {"scale": "y", "field": "v2"}
diff --git a/examples/compiled/stacked_bar_size.png b/examples/compiled/stacked_bar_size.png
index f7c0197ce9..15246116e0 100644
Binary files a/examples/compiled/stacked_bar_size.png and b/examples/compiled/stacked_bar_size.png differ
diff --git a/examples/compiled/stacked_bar_size.svg b/examples/compiled/stacked_bar_size.svg
index 41eabbc7f6..f42418bd16 100644
--- a/examples/compiled/stacked_bar_size.svg
+++ b/examples/compiled/stacked_bar_size.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/stacked_bar_size.vg.json b/examples/compiled/stacked_bar_size.vg.json
index 7008e2f790..fbf1f7f77d 100644
--- a/examples/compiled/stacked_bar_size.vg.json
+++ b/examples/compiled/stacked_bar_size.vg.json
@@ -55,7 +55,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\")) + \"; weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"])"
},
- "xc": {"scale": "x", "field": "month_date", "band": 0.5},
+ "x": {"scale": "x", "field": "month_date"},
"width": {"scale": "size", "field": "weather"},
"y": {"scale": "y", "field": "__count_end"},
"y2": {"scale": "y", "field": "__count_start"}
diff --git a/examples/compiled/stacked_bar_sum_opacity.svg b/examples/compiled/stacked_bar_sum_opacity.svg
index 39e5c56886..749bc922d5 100644
--- a/examples/compiled/stacked_bar_sum_opacity.svg
+++ b/examples/compiled/stacked_bar_sum_opacity.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/stacked_bar_sum_opacity.vg.json b/examples/compiled/stacked_bar_sum_opacity.vg.json
index 6492caecc1..3165374448 100644
--- a/examples/compiled/stacked_bar_sum_opacity.vg.json
+++ b/examples/compiled/stacked_bar_sum_opacity.vg.json
@@ -60,7 +60,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; people: \" + (format(datum[\"people\"], \"\"))"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/stacked_bar_unaggregate.vg.json b/examples/compiled/stacked_bar_unaggregate.vg.json
index 92509ade9d..344324baa4 100644
--- a/examples/compiled/stacked_bar_unaggregate.vg.json
+++ b/examples/compiled/stacked_bar_unaggregate.vg.json
@@ -53,7 +53,7 @@
"description": {
"signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (isValid(datum[\"c\"]) ? datum[\"c\"] : \"\"+datum[\"c\"])"
},
- "x": {"scale": "x", "field": "a"},
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"}
diff --git a/examples/compiled/stacked_bar_v.vg.json b/examples/compiled/stacked_bar_v.vg.json
index a0409fbb63..cc21ce4b89 100644
--- a/examples/compiled/stacked_bar_v.vg.json
+++ b/examples/compiled/stacked_bar_v.vg.json
@@ -52,7 +52,7 @@
"description": {
"signal": "\"variety: \" + (isValid(datum[\"variety\"]) ? datum[\"variety\"] : \"\"+datum[\"variety\"]) + \"; Sum of yield: \" + (format(datum[\"sum_yield\"], \"\")) + \"; site: \" + (isValid(datum[\"site\"]) ? datum[\"site\"] : \"\"+datum[\"site\"])"
},
- "x": {"scale": "x", "field": "variety"},
+ "xc": {"scale": "x", "field": "variety", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_yield_end"},
"y2": {"scale": "y", "field": "sum_yield_start"}
diff --git a/examples/compiled/stacked_bar_v_ascending.vg.json b/examples/compiled/stacked_bar_v_ascending.vg.json
index 9581042ae0..52c6b34bca 100644
--- a/examples/compiled/stacked_bar_v_ascending.vg.json
+++ b/examples/compiled/stacked_bar_v_ascending.vg.json
@@ -52,7 +52,7 @@
"description": {
"signal": "\"variety: \" + (isValid(datum[\"variety\"]) ? datum[\"variety\"] : \"\"+datum[\"variety\"]) + \"; Sum of yield: \" + (format(datum[\"sum_yield\"], \"\")) + \"; site: \" + (isValid(datum[\"site\"]) ? datum[\"site\"] : \"\"+datum[\"site\"])"
},
- "x": {"scale": "x", "field": "variety"},
+ "xc": {"scale": "x", "field": "variety", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_yield_end"},
"y2": {"scale": "y", "field": "sum_yield_start"}
diff --git a/examples/compiled/stacked_bar_weather.vg.json b/examples/compiled/stacked_bar_weather.vg.json
index 14721fff3b..2a7542dcb5 100644
--- a/examples/compiled/stacked_bar_weather.vg.json
+++ b/examples/compiled/stacked_bar_weather.vg.json
@@ -54,7 +54,7 @@
"description": {
"signal": "\"Month of the year: \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\")) + \"; Weather type: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"])"
},
- "x": {"scale": "x", "field": "month_date"},
+ "xc": {"scale": "x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "__count_end"},
"y2": {"scale": "y", "field": "__count_start"}
diff --git a/examples/compiled/test_aggregate_nested.vg.json b/examples/compiled/test_aggregate_nested.vg.json
index 65bda28edf..e26d5cfffb 100644
--- a/examples/compiled/test_aggregate_nested.vg.json
+++ b/examples/compiled/test_aggregate_nested.vg.json
@@ -91,7 +91,7 @@
},
"x": {"scale": "x", "field": "sum_properties\\.yield_end"},
"x2": {"scale": "x", "field": "sum_properties\\.yield_start"},
- "y": {"scale": "y", "field": "properties\\.variety"},
+ "yc": {"scale": "y", "field": "properties\\.variety", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/tick_dot.vg.json b/examples/compiled/tick_dot.vg.json
index d8b575c0b5..83a0556a61 100644
--- a/examples/compiled/tick_dot.vg.json
+++ b/examples/compiled/tick_dot.vg.json
@@ -32,10 +32,10 @@
"description": {
"signal": "\"precipitation: \" + (format(datum[\"precipitation\"], \"\"))"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "precipitation"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"mult": 0.75, "field": {"group": "height"}}
}
}
}
diff --git a/examples/compiled/tick_dot_thickness.png b/examples/compiled/tick_dot_thickness.png
index be571af076..371fa232c5 100644
Binary files a/examples/compiled/tick_dot_thickness.png and b/examples/compiled/tick_dot_thickness.png differ
diff --git a/examples/compiled/tick_dot_thickness.svg b/examples/compiled/tick_dot_thickness.svg
index 676fc14a39..50ad2b9ddb 100644
--- a/examples/compiled/tick_dot_thickness.svg
+++ b/examples/compiled/tick_dot_thickness.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/tick_dot_thickness.vg.json b/examples/compiled/tick_dot_thickness.vg.json
index 962912839c..0c045d7ccd 100644
--- a/examples/compiled/tick_dot_thickness.vg.json
+++ b/examples/compiled/tick_dot_thickness.vg.json
@@ -32,10 +32,10 @@
"description": {
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\"))"
},
+ "width": {"value": 2},
"xc": {"scale": "x", "field": "Horsepower"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 10},
- "width": {"value": 2}
+ "height": {"mult": 0.75, "field": {"group": "height"}}
}
}
}
diff --git a/examples/compiled/tick_grouped.vg.json b/examples/compiled/tick_grouped.vg.json
index 2bb4b56c33..694afe6ef0 100644
--- a/examples/compiled/tick_grouped.vg.json
+++ b/examples/compiled/tick_grouped.vg.json
@@ -31,7 +31,10 @@
}
],
"signals": [
- {"name": "x_step", "update": "20 * domain('xOffset').length / (1-0.2)"},
+ {
+ "name": "x_step",
+ "update": "20 * bandspace(domain('xOffset').length, 0, 0) / (1-0.2)"
+ },
{
"name": "width",
"update": "bandspace(domain('x').length, 0.2, 0.2) * x_step"
@@ -51,14 +54,14 @@
"description": {
"signal": "\"category: \" + (isValid(datum[\"category\"]) ? datum[\"category\"] : \"\"+datum[\"category\"]) + \"; value: \" + (format(datum[\"value\"], \"\")) + \"; group: \" + (isValid(datum[\"group\"]) ? datum[\"group\"] : \"\"+datum[\"group\"])"
},
+ "height": {"value": 1},
"xc": {
"scale": "x",
"field": "category",
- "offset": {"scale": "xOffset", "field": "group"}
+ "offset": {"scale": "xOffset", "field": "group", "band": 0.5}
},
- "yc": {"scale": "y", "field": "value"},
- "width": {"value": 15},
- "height": {"value": 1}
+ "width": {"signal": "0.75 * bandwidth('xOffset')"},
+ "yc": {"scale": "y", "field": "value"}
}
}
}
@@ -82,10 +85,9 @@
},
{
"name": "xOffset",
- "type": "point",
+ "type": "band",
"domain": {"data": "data_0", "field": "group", "sort": true},
- "range": {"step": 20},
- "paddingOuter": 0.5
+ "range": {"step": 20}
},
{
"name": "color",
diff --git a/examples/compiled/tick_histogram.png b/examples/compiled/tick_histogram.png
new file mode 100644
index 0000000000..190ae345a2
Binary files /dev/null and b/examples/compiled/tick_histogram.png differ
diff --git a/examples/compiled/tick_histogram.svg b/examples/compiled/tick_histogram.svg
new file mode 100644
index 0000000000..ca92051621
--- /dev/null
+++ b/examples/compiled/tick_histogram.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/tick_histogram.vg.json b/examples/compiled/tick_histogram.vg.json
new file mode 100644
index 0000000000..c59ea7d8d6
--- /dev/null
+++ b/examples/compiled/tick_histogram.vg.json
@@ -0,0 +1,131 @@
+{
+ "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "background": "white",
+ "padding": 5,
+ "width": 400,
+ "height": 200,
+ "style": "cell",
+ "data": [
+ {
+ "name": "source_0",
+ "url": "data/movies.json",
+ "format": {"type": "json"},
+ "transform": [
+ {
+ "type": "extent",
+ "field": "IMDB Rating",
+ "signal": "bin_maxbins_10_IMDB_Rating_extent"
+ },
+ {
+ "type": "bin",
+ "field": "IMDB Rating",
+ "as": [
+ "bin_maxbins_10_IMDB Rating",
+ "bin_maxbins_10_IMDB Rating_end"
+ ],
+ "signal": "bin_maxbins_10_IMDB_Rating_bins",
+ "extent": {"signal": "bin_maxbins_10_IMDB_Rating_extent"},
+ "maxbins": 10
+ },
+ {
+ "type": "aggregate",
+ "groupby": [
+ "bin_maxbins_10_IMDB Rating",
+ "bin_maxbins_10_IMDB Rating_end"
+ ],
+ "ops": ["count"],
+ "fields": [null],
+ "as": ["__count"]
+ },
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"])"
+ }
+ ]
+ }
+ ],
+ "marks": [
+ {
+ "name": "marks",
+ "type": "rect",
+ "style": ["tick"],
+ "from": {"data": "source_0"},
+ "encode": {
+ "update": {
+ "fill": {"value": "#4c78a8"},
+ "ariaRoleDescription": {"value": "tick"},
+ "description": {
+ "signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
+ },
+ "height": {"value": 1},
+ "x2": {
+ "scale": "x",
+ "field": "bin_maxbins_10_IMDB Rating",
+ "offset": 0.5
+ },
+ "x": {
+ "scale": "x",
+ "field": "bin_maxbins_10_IMDB Rating_end",
+ "offset": 0.5
+ },
+ "yc": {"scale": "y", "field": "__count"}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "linear",
+ "domain": {
+ "signal": "[bin_maxbins_10_IMDB_Rating_bins.start, bin_maxbins_10_IMDB_Rating_bins.stop]"
+ },
+ "range": [0, {"signal": "width"}],
+ "bins": {"signal": "bin_maxbins_10_IMDB_Rating_bins"},
+ "zero": false
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {"data": "source_0", "field": "__count"},
+ "range": [{"signal": "height"}, 0],
+ "nice": true,
+ "zero": true
+ }
+ ],
+ "axes": [
+ {
+ "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": "IMDB Rating (binned)",
+ "labelFlush": true,
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(width/10)"},
+ "zindex": 0
+ },
+ {
+ "scale": "y",
+ "orient": "left",
+ "grid": false,
+ "title": "Count of Records",
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(height/40)"},
+ "zindex": 0
+ }
+ ]
+}
diff --git a/examples/compiled/tick_month_histogram.png b/examples/compiled/tick_month_histogram.png
new file mode 100644
index 0000000000..4ba6835728
Binary files /dev/null and b/examples/compiled/tick_month_histogram.png differ
diff --git a/examples/compiled/tick_month_histogram.svg b/examples/compiled/tick_month_histogram.svg
new file mode 100644
index 0000000000..e8cada5efe
--- /dev/null
+++ b/examples/compiled/tick_month_histogram.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/tick_month_histogram.vg.json b/examples/compiled/tick_month_histogram.vg.json
new file mode 100644
index 0000000000..6c35b6fe78
--- /dev/null
+++ b/examples/compiled/tick_month_histogram.vg.json
@@ -0,0 +1,139 @@
+{
+ "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "description": "Using `labelExpr` to show only initial letters of month names.",
+ "background": "white",
+ "padding": 5,
+ "width": 200,
+ "height": 200,
+ "style": "cell",
+ "data": [
+ {
+ "name": "source_0",
+ "url": "data/seattle-weather.csv",
+ "format": {"type": "csv", "parse": {"date": "date"}},
+ "transform": [
+ {
+ "field": "date",
+ "type": "timeunit",
+ "units": ["month"],
+ "as": ["month_date", "month_date_end"]
+ },
+ {
+ "type": "aggregate",
+ "groupby": ["month_date", "month_date_end"],
+ "ops": ["mean"],
+ "fields": ["precipitation"],
+ "as": ["mean_precipitation"]
+ },
+ {
+ "type": "filter",
+ "expr": "(isDate(datum[\"month_date\"]) || (isValid(datum[\"month_date\"]) && isFinite(+datum[\"month_date\"]))) && isValid(datum[\"mean_precipitation\"]) && isFinite(+datum[\"mean_precipitation\"])"
+ }
+ ]
+ }
+ ],
+ "marks": [
+ {
+ "name": "marks",
+ "type": "rect",
+ "style": ["tick"],
+ "from": {"data": "source_0"},
+ "encode": {
+ "update": {
+ "fill": {"value": "#4c78a8"},
+ "ariaRoleDescription": {"value": "tick"},
+ "description": {
+ "signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
+ },
+ "height": {"value": 1},
+ "x2": {
+ "signal": "scale(\"x\", 0.875 * datum[\"month_date\"] + 0.125 * datum[\"month_date_end\"])",
+ "offset": 0.5
+ },
+ "x": {
+ "signal": "scale(\"x\", 0.125 * datum[\"month_date\"] + 0.875 * datum[\"month_date_end\"])",
+ "offset": 0.5
+ },
+ "yc": {"scale": "y", "field": "mean_precipitation"}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "time",
+ "domain": {
+ "data": "source_0",
+ "fields": ["month_date", "month_date_end"]
+ },
+ "range": [0, {"signal": "width"}]
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {"data": "source_0", "field": "mean_precipitation"},
+ "range": [{"signal": "height"}, 0],
+ "nice": true,
+ "zero": true
+ }
+ ],
+ "axes": [
+ {
+ "scale": "x",
+ "orient": "bottom",
+ "gridScale": "y",
+ "grid": true,
+ "tickMinStep": {
+ "signal": "datetime(2001, 1, 1, 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": "date (month)",
+ "labelAlign": "left",
+ "format": {
+ "signal": "timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})"
+ },
+ "labelFlush": true,
+ "labelOverlap": true,
+ "tickMinStep": {
+ "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)"
+ },
+ "encode": {"labels": {"update": {"text": {"signal": "datum.label[0]"}}}},
+ "zindex": 0
+ },
+ {
+ "scale": "y",
+ "orient": "left",
+ "grid": false,
+ "title": "Mean of precipitation",
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(height/40)"},
+ "zindex": 0
+ }
+ ]
+}
diff --git a/examples/compiled/tick_sort.vg.json b/examples/compiled/tick_sort.vg.json
index e54fb4aed0..df72b433e0 100644
--- a/examples/compiled/tick_sort.vg.json
+++ b/examples/compiled/tick_sort.vg.json
@@ -32,10 +32,10 @@
"description": {
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\"))"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "Horsepower"},
"yc": {"signal": "height", "mult": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"mult": 0.75, "field": {"group": "height"}}
}
}
}
diff --git a/examples/compiled/tick_strip.png b/examples/compiled/tick_strip.png
index 9740c3ffab..9d8fff5853 100644
Binary files a/examples/compiled/tick_strip.png and b/examples/compiled/tick_strip.png differ
diff --git a/examples/compiled/tick_strip.svg b/examples/compiled/tick_strip.svg
index d4d8749600..12dcc9a5ec 100644
--- a/examples/compiled/tick_strip.svg
+++ b/examples/compiled/tick_strip.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/tick_strip.vg.json b/examples/compiled/tick_strip.vg.json
index d27a6f5fb6..5a9b0f0e18 100644
--- a/examples/compiled/tick_strip.vg.json
+++ b/examples/compiled/tick_strip.vg.json
@@ -20,10 +20,7 @@
],
"signals": [
{"name": "y_step", "value": 20},
- {
- "name": "height",
- "update": "bandspace(domain('y').length, 1, 0.5) * y_step"
- }
+ {"name": "height", "update": "bandspace(domain('y').length, 0, 0) * y_step"}
],
"marks": [
{
@@ -39,10 +36,10 @@
"description": {
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "Horsepower"},
- "yc": {"scale": "y", "field": "Cylinders"},
- "height": {"value": 15},
- "width": {"value": 1}
+ "yc": {"scale": "y", "field": "Cylinders", "band": 0.5},
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
}
@@ -58,10 +55,11 @@
},
{
"name": "y",
- "type": "point",
+ "type": "band",
"domain": {"data": "source_0", "field": "Cylinders", "sort": true},
"range": {"step": {"signal": "y_step"}},
- "padding": 0.5
+ "paddingInner": 0,
+ "paddingOuter": 0
}
],
"axes": [
diff --git a/examples/compiled/tick_strip_tick_band.vg.json b/examples/compiled/tick_strip_tick_band.vg.json
index 4302d64a9d..2c97f89f99 100644
--- a/examples/compiled/tick_strip_tick_band.vg.json
+++ b/examples/compiled/tick_strip_tick_band.vg.json
@@ -35,10 +35,10 @@
"description": {
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"])"
},
+ "width": {"value": 1},
"xc": {"scale": "x", "field": "Horsepower"},
"yc": {"scale": "y", "field": "Cylinders", "band": 0.5},
- "height": {"value": 15},
- "width": {"value": 1}
+ "height": {"signal": "0.75 * bandwidth('y')"}
}
}
}
diff --git a/examples/compiled/time_parse_binnedutc.vg.json b/examples/compiled/time_parse_binnedutc.vg.json
index 55dc8f7d78..c6ec0897fd 100644
--- a/examples/compiled/time_parse_binnedutc.vg.json
+++ b/examples/compiled/time_parse_binnedutc.vg.json
@@ -44,7 +44,7 @@
},
"x": {"field": {"group": "width"}},
"x2": {"value": 0},
- "y": {"scale": "y", "field": "date"},
+ "yc": {"scale": "y", "field": "date", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/trellis_bar.svg b/examples/compiled/trellis_bar.svg
index 0ef9bf5478..fe4127a503 100644
--- a/examples/compiled/trellis_bar.svg
+++ b/examples/compiled/trellis_bar.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/trellis_bar.vg.json b/examples/compiled/trellis_bar.vg.json
index a8b3fef14a..cfc5cbf1cc 100644
--- a/examples/compiled/trellis_bar.vg.json
+++ b/examples/compiled/trellis_bar.vg.json
@@ -142,7 +142,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/trellis_bar_no_header.svg b/examples/compiled/trellis_bar_no_header.svg
index 111b089c59..b9b791fbf9 100644
--- a/examples/compiled/trellis_bar_no_header.svg
+++ b/examples/compiled/trellis_bar_no_header.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/compiled/trellis_bar_no_header.vg.json b/examples/compiled/trellis_bar_no_header.vg.json
index 0e859595af..0f6c8e1049 100644
--- a/examples/compiled/trellis_bar_no_header.vg.json
+++ b/examples/compiled/trellis_bar_no_header.vg.json
@@ -116,7 +116,7 @@
"description": {
"signal": "\"age: \" + (isValid(datum[\"age\"]) ? datum[\"age\"] : \"\"+datum[\"age\"]) + \"; population: \" + (format(datum[\"sum_people\"], \"\")) + \"; gender: \" + (isValid(datum[\"gender\"]) ? datum[\"gender\"] : \"\"+datum[\"gender\"])"
},
- "x": {"scale": "x", "field": "age"},
+ "xc": {"scale": "x", "field": "age", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "sum_people_end"},
"y2": {"scale": "y", "field": "sum_people_start"}
diff --git a/examples/compiled/trellis_stacked_bar.vg.json b/examples/compiled/trellis_stacked_bar.vg.json
index 0291364369..4f3afa1e02 100644
--- a/examples/compiled/trellis_stacked_bar.vg.json
+++ b/examples/compiled/trellis_stacked_bar.vg.json
@@ -137,7 +137,7 @@
},
"x": {"scale": "x", "field": "sum_yield_end"},
"x2": {"scale": "x", "field": "sum_yield_start"},
- "y": {"scale": "y", "field": "variety"},
+ "yc": {"scale": "y", "field": "variety", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/vconcat_weather.vg.json b/examples/compiled/vconcat_weather.vg.json
index 3db6ba2d6b..8b612575bd 100644
--- a/examples/compiled/vconcat_weather.vg.json
+++ b/examples/compiled/vconcat_weather.vg.json
@@ -116,7 +116,7 @@
"description": {
"signal": "\"date (month): \" + (timeFormat(datum[\"month_date\"], timeUnitSpecifier([\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Mean of precipitation: \" + (format(datum[\"mean_precipitation\"], \"\"))"
},
- "x": {"scale": "concat_0_x", "field": "month_date"},
+ "xc": {"scale": "concat_0_x", "field": "month_date", "band": 0.5},
"width": {"signal": "max(0.25, bandwidth('concat_0_x'))"},
"y": {"scale": "concat_0_y", "field": "mean_precipitation"},
"y2": {"scale": "concat_0_y", "value": 0}
diff --git a/examples/compiled/window_top_k.vg.json b/examples/compiled/window_top_k.vg.json
index 23aec6d38c..a8896b6356 100644
--- a/examples/compiled/window_top_k.vg.json
+++ b/examples/compiled/window_top_k.vg.json
@@ -89,7 +89,7 @@
},
"x": {"scale": "x", "field": "score_end"},
"x2": {"scale": "x", "field": "score_start"},
- "y": {"scale": "y", "field": "student"},
+ "yc": {"scale": "y", "field": "student", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/compiled/window_top_k_others.vg.json b/examples/compiled/window_top_k_others.vg.json
index 106ca55477..7438d6506e 100644
--- a/examples/compiled/window_top_k_others.vg.json
+++ b/examples/compiled/window_top_k_others.vg.json
@@ -77,7 +77,7 @@
},
"x": {"scale": "x", "field": "mean_aggregate_gross"},
"x2": {"scale": "x", "value": 0},
- "y": {"scale": "y", "field": "ranked_director"},
+ "yc": {"scale": "y", "field": "ranked_director", "band": 0.5},
"height": {"signal": "max(0.25, bandwidth('y'))"}
}
}
diff --git a/examples/specs/bar_grouped_discrete_bandsize.vl.json b/examples/specs/bar_grouped_discrete_bandsize.vl.json
new file mode 100644
index 0000000000..f18a359829
--- /dev/null
+++ b/examples/specs/bar_grouped_discrete_bandsize.vl.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+ "data": {
+ "values": [
+ {"category":"A", "group": "x", "value":0.1},
+ {"category":"A", "group": "y", "value":0.6},
+ {"category":"A", "group": "z", "value":0.9},
+ {"category":"B", "group": "x", "value":0.7},
+ {"category":"B", "group": "y", "value":0.2},
+ {"category":"B", "group": "z", "value":1.1},
+ {"category":"C", "group": "x", "value":0.6},
+ {"category":"C", "group": "y", "value":0.1},
+ {"category":"C", "group": "z", "value":0.2}
+ ]
+ },
+ "mark": "bar",
+ "encoding": {
+ "x": {"field": "category"},
+ "y": {"field": "value", "type": "quantitative"},
+ "xOffset": {"field": "group"},
+ "color": {"field": "group"}
+ },
+ "config": {
+ "bar": {"discreteBandSize": {"band": 0.5}}
+ }
+}
diff --git a/examples/specs/bar_size_relative_band.vl.json b/examples/specs/bar_size_relative_band.vl.json
new file mode 100644
index 0000000000..3b88add8c9
--- /dev/null
+++ b/examples/specs/bar_size_relative_band.vl.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+ "description": "A simple bar chart with embedded data.",
+ "data": {
+ "values": [
+ {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
+ {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
+ {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
+ ]
+ },
+ "mark": {"type": "bar", "size": {"band": 0.5}},
+ "encoding": {
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "y": {"field": "b", "type": "quantitative"}
+ }
+}
diff --git a/examples/specs/bar_width_relative_band_size.vl.json b/examples/specs/bar_width_relative_band_size.vl.json
new file mode 100644
index 0000000000..016e6b63ba
--- /dev/null
+++ b/examples/specs/bar_width_relative_band_size.vl.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+ "description": "A simple bar chart with embedded data.",
+ "data": {
+ "values": [
+ {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
+ {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
+ {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
+ ]
+ },
+ "mark": {"type": "bar", "width": {"band": 0.5}},
+ "encoding": {
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "y": {"field": "b", "type": "quantitative"}
+ }
+}
diff --git a/examples/specs/tick_histogram.vl.json b/examples/specs/tick_histogram.vl.json
new file mode 100644
index 0000000000..9681b2703b
--- /dev/null
+++ b/examples/specs/tick_histogram.vl.json
@@ -0,0 +1,13 @@
+{
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+ "data": {"url": "data/movies.json"},
+ "width": 400,
+ "mark": "tick",
+ "encoding": {
+ "x": {
+ "bin": true,
+ "field": "IMDB Rating"
+ },
+ "y": {"aggregate": "count"}
+ }
+}
diff --git a/examples/specs/tick_month_histogram.vl.json b/examples/specs/tick_month_histogram.vl.json
new file mode 100644
index 0000000000..38e2e1b7cc
--- /dev/null
+++ b/examples/specs/tick_month_histogram.vl.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+ "description": "Using `labelExpr` to show only initial letters of month names.",
+ "data": {"url": "data/seattle-weather.csv"},
+ "mark": "tick",
+ "encoding": {
+ "x": {
+ "timeUnit": "month",
+ "field": "date",
+ "axis": {
+ "labelAlign": "left",
+ "labelExpr": "datum.label[0]"
+ }
+ },
+ "y": {"aggregate": "mean", "field": "precipitation"}
+ }
+}
diff --git a/src/compile/mark/encode/nonposition.ts b/src/compile/mark/encode/nonposition.ts
index df56da2fb2..aac6b2d447 100644
--- a/src/compile/mark/encode/nonposition.ts
+++ b/src/compile/mark/encode/nonposition.ts
@@ -6,6 +6,7 @@ import {getMarkPropOrConfig, signalOrValueRef} from '../../common';
import {UnitModel} from '../../unit';
import {wrapCondition} from './conditional';
import * as ref from './valueref';
+import {isRelativeBandSize} from '../../../mark';
/**
* Return encode for non-positional channels with scales. (Text doesn't have scale.)
@@ -24,11 +25,14 @@ export function nonPosition(
let {defaultRef, defaultValue} = opt;
if (defaultRef === undefined) {
- // prettier-ignore
- defaultValue ??= getMarkPropOrConfig(channel, markDef, config, {vgChannel, ignoreVgConfig: true});
+ const markPropOrConfig = getMarkPropOrConfig(channel, markDef, config, {vgChannel, ignoreVgConfig: true});
+ if (!isRelativeBandSize(markPropOrConfig)) {
+ // prettier-ignore
+ defaultValue ??= markPropOrConfig;
- if (defaultValue !== undefined) {
- defaultRef = signalOrValueRef(defaultValue);
+ if (defaultValue !== undefined) {
+ defaultRef = signalOrValueRef(defaultValue);
+ }
}
}
diff --git a/src/compile/mark/encode/offset.ts b/src/compile/mark/encode/offset.ts
index 0ee51be1d2..b2da454a74 100644
--- a/src/compile/mark/encode/offset.ts
+++ b/src/compile/mark/encode/offset.ts
@@ -26,7 +26,7 @@ export function positionOffset({
markDef: MarkDef;
encoding?: Encoding;
model?: UnitModel;
- bandPosition?: number;
+ bandPosition?: number | SignalRef;
}): Offset {
const channel = `${baseChannel}Offset` as
| 'xOffset'
diff --git a/src/compile/mark/encode/position-rect.ts b/src/compile/mark/encode/position-rect.ts
index b2229b1433..a2389d355e 100644
--- a/src/compile/mark/encode/position-rect.ts
+++ b/src/compile/mark/encode/position-rect.ts
@@ -18,7 +18,7 @@ import * as log from '../../../log';
import {BandSize, isRelativeBandSize} from '../../../mark';
import {hasDiscreteDomain} from '../../../scale';
import {isSignalRef, isVgRangeStep, VgEncodeEntry, VgValueRef} from '../../../vega.schema';
-import {getMarkConfig, getMarkPropOrConfig, signalOrStringValue, signalOrValueRef} from '../../common';
+import {getMarkConfig, getMarkPropOrConfig, signalOrStringValue} from '../../common';
import {ScaleComponent} from '../../scale/component';
import {UnitModel} from '../../unit';
import {nonPosition} from './nonposition';
@@ -50,7 +50,9 @@ export function rectPosition(model: UnitModel, channel: 'x' | 'y' | 'theta' | 'r
const offsetScaleChannel = getOffsetChannel(channel);
- const isBarBand = mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal');
+ const isBandChannel =
+ (mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal')) ||
+ (mark === 'tick' && (channel === 'x' ? orient === 'horizontal' : orient === 'vertical'));
// x, x2, and width -- we must specify two of these in all conditions
if (
@@ -66,7 +68,7 @@ export function rectPosition(model: UnitModel, channel: 'x' | 'y' | 'theta' | 'r
channel,
model
});
- } else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarBand) && !channelDef2) {
+ } else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBandChannel) && !channelDef2) {
return positionAndSize(channelDef, channel, model);
} else {
return rangePosition(channel, model, {defaultPos: 'zeroOrMax', defaultPos2: 'zeroOrMin'});
@@ -136,7 +138,7 @@ function positionAndSize(
channel: 'x' | 'y' | 'theta' | 'radius',
model: UnitModel
) {
- const {markDef, encoding, config, stack} = model;
+ const {mark, markDef, encoding, config, stack} = model;
const orient = markDef.orient;
const scaleName = model.scaleName(channel);
@@ -149,21 +151,24 @@ function positionAndSize(
const offsetScale = model.getScaleComponent(getOffsetScaleChannel(channel));
// use "size" channel for bars, if there is orient and the channel matches the right orientation
- const useVlSizeChannel = (orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x');
+ const useVlSizeChannel =
+ mark === 'tick'
+ ? // tick's orientation is opposite to other marks
+ (orient === 'vertical' && channel === 'y') || (orient === 'horizontal' && channel === 'x')
+ : (orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x');
// Use size encoding / mark property / config if it exists
- let sizeMixins;
- if (encoding.size || markDef.size) {
+ let sizeEncodingMixins;
+
+ if (encoding.size) {
if (useVlSizeChannel) {
- sizeMixins = nonPosition('size', model, {
- vgChannel: vgSizeChannel,
- defaultRef: signalOrValueRef(markDef.size)
+ sizeEncodingMixins = nonPosition('size', model, {
+ vgChannel: vgSizeChannel
});
} else {
log.warn(log.message.cannotApplySizeToNonOrientedMark(markDef.type));
}
}
- const hasSizeFromMarkOrEncoding = !!sizeMixins;
// Otherwise, apply default value
const bandSize = getBandSize({
@@ -175,7 +180,7 @@ function positionAndSize(
useVlSizeChannel
});
- sizeMixins = sizeMixins || {
+ const sizeMixins = sizeEncodingMixins || {
[vgSizeChannel]: defaultSizeRef(
vgSizeChannel,
offsetScaleName || scaleName,
@@ -197,13 +202,22 @@ function positionAndSize(
*/
const defaultBandAlign =
- (scale || offsetScale)?.get('type') === 'band' && isRelativeBandSize(bandSize) && !hasSizeFromMarkOrEncoding
+ (scale || offsetScale)?.get('type') === 'band' && isRelativeBandSize(bandSize) && !!sizeEncodingMixins
? 'top'
: 'middle';
const vgChannel = vgAlignedPositionChannel(channel, markDef, config, defaultBandAlign);
const center = vgChannel === 'xc' || vgChannel === 'yc';
- const {offset, offsetType} = positionOffset({channel, markDef, encoding, model, bandPosition: center ? 0.5 : 0});
+
+ const bandPosition = center
+ ? 0.5
+ : isSignalRef(bandSize)
+ ? {signal: `(1-${bandSize})/2`}
+ : isRelativeBandSize(bandSize)
+ ? (1 - bandSize.band) / 2
+ : 0;
+
+ const {offset, offsetType} = positionOffset({channel, markDef, encoding, model, bandPosition});
const posRef = ref.midPointRefWithPositionInvalidTest({
channel,
@@ -215,15 +229,7 @@ function positionAndSize(
stack,
offset,
defaultRef: pointPositionDefaultRef({model, defaultPos: 'mid', channel, scaleName, scale}),
- bandPosition: center
- ? offsetType === 'encoding'
- ? 0
- : 0.5
- : isSignalRef(bandSize)
- ? {signal: `(1-${bandSize})/2`}
- : isRelativeBandSize(bandSize)
- ? (1 - bandSize.band) / 2
- : 0
+ bandPosition: offsetType === 'encoding' ? 0 : bandPosition
});
if (vgSizeChannel) {
diff --git a/src/compile/mark/tick.ts b/src/compile/mark/tick.ts
index c24fb48f4a..2e03bca738 100644
--- a/src/compile/mark/tick.ts
+++ b/src/compile/mark/tick.ts
@@ -1,7 +1,3 @@
-import type {SignalRef} from 'vega';
-import {isNumber} from 'vega-util';
-import {getViewConfigDiscreteStep} from '../../config';
-import {isVgRangeStep} from '../../vega.schema';
import {getMarkPropOrConfig, signalOrValueRef} from '../common';
import {UnitModel} from '../unit';
import {MarkCompiler} from './base';
@@ -14,10 +10,9 @@ export const tick: MarkCompiler = {
const {config, markDef} = model;
const orient = markDef.orient;
- const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';
const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';
- return {
+ const baseAndThickness = {
...encode.baseEncodeEntry(model, {
align: 'ignore',
baseline: 'ignore',
@@ -26,40 +21,22 @@ export const tick: MarkCompiler = {
size: 'ignore',
theta: 'ignore'
}),
-
- ...encode.pointPosition('x', model, {defaultPos: 'mid', vgChannel: 'xc'}),
- ...encode.pointPosition('y', model, {defaultPos: 'mid', vgChannel: 'yc'}),
-
- // size / thickness => width / height
- ...encode.nonPosition('size', model, {
- defaultValue: defaultSize(model),
- vgChannel: vgSizeChannel
- }),
[vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config))
};
- }
-};
-
-function defaultSize(model: UnitModel): number | SignalRef {
- const {config, markDef} = model;
- const {orient} = markDef;
- const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';
- const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');
-
- const markPropOrConfig =
- getMarkPropOrConfig('size', markDef, config, {vgChannel: vgSizeChannel}) ?? config.tick.bandSize;
-
- if (markPropOrConfig !== undefined) {
- return markPropOrConfig;
- } else {
- const scaleRange = scale ? scale.get('range') : undefined;
- if (scaleRange && isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {
- return (scaleRange.step * 3) / 4;
+ if (orient === 'horizontal') {
+ return {
+ ...baseAndThickness,
+ ...encode.rectPosition(model, 'x'),
+ ...encode.pointPosition('y', model, {defaultPos: 'mid', vgChannel: 'yc'})
+ };
+ } else {
+ // vertical
+ return {
+ ...baseAndThickness,
+ ...encode.pointPosition('x', model, {defaultPos: 'mid', vgChannel: 'xc'}),
+ ...encode.rectPosition(model, 'y')
+ };
}
-
- const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);
-
- return (defaultViewStep * 3) / 4;
}
-}
+};
diff --git a/src/compile/scale/type.ts b/src/compile/scale/type.ts
index 6476559586..c3159d6972 100644
--- a/src/compile/scale/type.ts
+++ b/src/compile/scale/type.ts
@@ -77,7 +77,7 @@ function defaultType(
}
if (isXorY(channel) || isXorYOffset(channel)) {
- if (util.contains(['rect', 'bar', 'image', 'rule'], mark.type)) {
+ if (util.contains(['rect', 'bar', 'image', 'tick', 'rule'], mark.type)) {
// The rect/bar mark should fit into a band.
// For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429
return 'band';
diff --git a/src/mark.ts b/src/mark.ts
index 77bcd40dc5..ee1a8f457e 100644
--- a/src/mark.ts
+++ b/src/mark.ts
@@ -1,4 +1,14 @@
-import {Align, Color, Gradient, MarkConfig as VgMarkConfig, Orientation, SignalRef, TextBaseline} from 'vega';
+import {
+ Align,
+ Color,
+ Gradient,
+ MarkConfig as VgMarkConfig,
+ Orientation,
+ SignalRef,
+ TextBaseline,
+ LinearGradient,
+ RadialGradient
+} from 'vega';
import {CompositeMark, CompositeMarkDef} from './compositemark';
import {ExprRef} from './expr';
import {Flag, keys} from './util';
@@ -50,7 +60,7 @@ export function isPathMark(m: Mark | CompositeMark): m is 'line' | 'area' | 'tra
}
export function isRectBasedMark(m: Mark | CompositeMark): m is 'rect' | 'bar' | 'image' | 'arc' {
- return ['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */].includes(m);
+ return ['rect', 'bar', 'image', 'arc', 'tick' /* arc is rect/interval in polar coordinate */].includes(m);
}
export const PRIMITIVE_MARKS = new Set(keys(Mark));
@@ -128,7 +138,7 @@ export interface VLOnlyMarkConfig extends ColorM
export interface MarkConfig
extends VLOnlyMarkConfig,
- MapExcludeValueRefAndReplaceSignalWith, ES> {
+ MapExcludeValueRefAndReplaceSignalWith, ES> {
// ========== Overriding Vega ==========
/**
@@ -147,7 +157,7 @@ export interface MarkConfig
/**
* Default size for marks.
* - 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.
- * - For `bar`, this represents the band size of the bar, in pixels.
+ * - For `bar`, this represents the band size of the bar, in pixels, or relative band size (e.g., `{"band": 0.5}` is half of the band).
* - For `text`, this represents the font size, in pixels.
*
* __Default value:__
@@ -158,7 +168,7 @@ export interface MarkConfig
*
* @minimum 0
*/
- size?: number | ES; // size works beyond symbol marks in VL
+ size?: number | ES | RelativeBandSize; // Unlike in VG where size is only for symbol marks (point in VL), size works beyond symbol marks in VL
/**
* X coordinates of the marks, or width of horizontal `"bar"` and `"area"` without specified `x2` or `width`.
@@ -284,17 +294,6 @@ export interface MarkConfig
outerRadius?: number | ES;
}
-export interface RectBinSpacingMixins {
- /**
- * Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).
- *
- * __Default value:__ `1`
- *
- * @minimum 0
- */
- binSpacing?: number;
-}
-
export type AnyMark = CompositeMark | CompositeMarkDef | Mark | MarkDef;
export function isMarkDef(mark: string | GenericMarkDef): mark is GenericMarkDef {
@@ -333,14 +332,23 @@ const VL_ONLY_MARK_CONFIG_INDEX: Flag> = {
export const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);
+const VL_ONLY_BAND_SIZE_CONFIG_MIXINS_INDEX: Flag> = {
+ binSpacing: 1,
+ continuousBandSize: 1,
+ discreteBandSize: 1,
+ minBandSize: 1
+};
+
+const VL_ONLY_BAND_SIZE_CONFIG_MIXINS_PROPS = keys(VL_ONLY_BAND_SIZE_CONFIG_MIXINS_INDEX);
+
export const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX: {
[k in Mark]?: (keyof Required>[k])[];
} = {
area: ['line', 'point'],
- bar: ['binSpacing', 'continuousBandSize', 'discreteBandSize', 'minBandSize'],
- rect: ['binSpacing', 'continuousBandSize', 'discreteBandSize', 'minBandSize'],
+ bar: VL_ONLY_BAND_SIZE_CONFIG_MIXINS_PROPS,
+ rect: VL_ONLY_BAND_SIZE_CONFIG_MIXINS_PROPS,
line: ['point'],
- tick: ['bandSize', 'thickness']
+ tick: ['bandSize', 'thickness', ...VL_ONLY_BAND_SIZE_CONFIG_MIXINS_PROPS]
};
export const defaultMarkConfig: MarkConfig = {
@@ -427,7 +435,9 @@ const MARK_CONFIG_INDEX: Flag> = {
export const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);
-export interface RectConfig extends RectBinSpacingMixins, MarkConfig {
+export type RectConfig = MarkConfig & BandSizeConfigMixins;
+
+interface BandSizeConfigMixins {
/**
* The default size of the bars on continuous scales.
*
@@ -448,6 +458,15 @@ export interface RectConfig extends RectBinSpaci
* __Default value:__ `0.25`
*/
minBandSize?: number | ES;
+
+ /**
+ * Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).
+ *
+ * __Default value:__ `1`
+ *
+ * @minimum 0
+ */
+ binSpacing?: number;
}
export type BandSize = number | RelativeBandSize | SignalRef;
@@ -459,7 +478,9 @@ export interface RelativeBandSize {
band: number;
}
-export function isRelativeBandSize(o: number | RelativeBandSize | ExprRef | SignalRef): o is RelativeBandSize {
+export function isRelativeBandSize(
+ o: number | RelativeBandSize | ExprRef | SignalRef | string | LinearGradient | RadialGradient | number[]
+): o is RelativeBandSize {
return o && o['band'] != undefined;
}
@@ -667,7 +688,10 @@ export const defaultRectConfig: RectConfig = {
timeUnitBandPosition: 0.5
};
-export interface TickConfig extends MarkConfig, TickThicknessMixins {
+export interface TickConfig
+ extends MarkConfig,
+ TickThicknessMixins,
+ BandSizeConfigMixins {
/**
* The width of the ticks.
*
@@ -678,7 +702,10 @@ export interface TickConfig extends MarkConfig = {
- thickness: 1
+ thickness: 1,
+ discreteBandSize: {band: 0.75},
+ timeUnitBandPosition: 0.5,
+ timeUnitBandSize: 0.75
};
export function getMarkType(m: string | GenericMarkDef) {
diff --git a/test/compile/mark/tick.test.ts b/test/compile/mark/tick.test.ts
index 625f6ef20e..bce25aa47a 100644
--- a/test/compile/mark/tick.test.ts
+++ b/test/compile/mark/tick.test.ts
@@ -111,7 +111,7 @@ describe('Mark: Tick', () => {
});
it('should scale on y', () => {
- expect(props.yc).toEqual({scale: Y, field: 'Cylinders'});
+ expect(props.y).toEqual({scale: Y, field: 'Cylinders', band: 0.125});
});
it('width should be tick thickness with default orient vertical', () => {
@@ -119,7 +119,7 @@ describe('Mark: Tick', () => {
});
it('height should be matched to field with default orient vertical', () => {
- expect(props.height).toEqual({value: 15});
+ expect(props.height).toEqual({signal: "0.75 * bandwidth('y')"});
});
});
diff --git a/test/compile/scale/type.test.ts b/test/compile/scale/type.test.ts
index 841ac59fb5..af14c68a17 100644
--- a/test/compile/scale/type.test.ts
+++ b/test/compile/scale/type.test.ts
@@ -91,7 +91,7 @@ describe('compile/scale', () => {
describe('continuous', () => {
it('should return point scale for ordinal X,Y for marks others than rect, rule, bar, and arc', () => {
PRIMITIVE_MARKS.forEach(mark => {
- if (util.contains(['bar', 'rule', 'rect', 'image', 'arc'], mark)) {
+ if (util.contains(['bar', 'rule', 'rect', 'image', 'arc', 'tick'], mark)) {
return;
}