diff --git a/examples/compiled/boxplot_1D_horizontal.vg.json b/examples/compiled/boxplot_1D_horizontal.vg.json
index b7dd924888..989dcbfbf3 100644
--- a/examples/compiled/boxplot_1D_horizontal.vg.json
+++ b/examples/compiled/boxplot_1D_horizontal.vg.json
@@ -219,7 +219,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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)\"], \"\")}"
},
diff --git a/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json b/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
index 37c52929e7..b46b4f4f66 100644
--- a/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
+++ b/examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
@@ -269,7 +269,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "red"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "red"}
+ ],
"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)\"], \"\")}"
},
diff --git a/examples/compiled/boxplot_1D_horizontal_explicit.vg.json b/examples/compiled/boxplot_1D_horizontal_explicit.vg.json
index b7dd924888..989dcbfbf3 100644
--- a/examples/compiled/boxplot_1D_horizontal_explicit.vg.json
+++ b/examples/compiled/boxplot_1D_horizontal_explicit.vg.json
@@ -219,7 +219,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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)\"], \"\")}"
},
diff --git a/examples/compiled/boxplot_1D_invalid.vg.json b/examples/compiled/boxplot_1D_invalid.vg.json
index 9bca1863b7..cdaf4a8f35 100644
--- a/examples/compiled/boxplot_1D_invalid.vg.json
+++ b/examples/compiled/boxplot_1D_invalid.vg.json
@@ -207,7 +207,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_b'] >= datum['upper_box_b']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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\"], \"\")}"
},
diff --git a/examples/compiled/boxplot_1D_vertical.vg.json b/examples/compiled/boxplot_1D_vertical.vg.json
index fcf60d6c8f..4e5ceedd6f 100644
--- a/examples/compiled/boxplot_1D_vertical.vg.json
+++ b/examples/compiled/boxplot_1D_vertical.vg.json
@@ -219,7 +219,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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)\"], \"\")}"
},
diff --git a/examples/compiled/boxplot_2D_horizontal.vg.json b/examples/compiled/boxplot_2D_horizontal.vg.json
index 657e0434dd..5ae134dabb 100644
--- a/examples/compiled/boxplot_2D_horizontal.vg.json
+++ b/examples/compiled/boxplot_2D_horizontal.vg.json
@@ -222,7 +222,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
diff --git a/examples/compiled/boxplot_2D_horizontal_color_size.vg.json b/examples/compiled/boxplot_2D_horizontal_color_size.vg.json
index aa06950bc5..8bc85b5725 100644
--- a/examples/compiled/boxplot_2D_horizontal_color_size.vg.json
+++ b/examples/compiled/boxplot_2D_horizontal_color_size.vg.json
@@ -222,7 +222,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "teal"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
diff --git a/examples/compiled/boxplot_2D_vertical.vg.json b/examples/compiled/boxplot_2D_vertical.vg.json
index d79f793f82..7dbbd0d072 100644
--- a/examples/compiled/boxplot_2D_vertical.vg.json
+++ b/examples/compiled/boxplot_2D_vertical.vg.json
@@ -222,7 +222,14 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "scale": "color",
+ "field": "Species"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
@@ -277,7 +284,8 @@
"domain": {
"fields": [
{"data": "data_1", "field": "Species"},
- {"data": "data_6", "field": "Species"}
+ {"data": "data_6", "field": "Species"},
+ {"data": "data_7", "field": "Species"}
],
"sort": true
},
diff --git a/examples/compiled/boxplot_2D_vertical_single_per_group.png b/examples/compiled/boxplot_2D_vertical_single_per_group.png
new file mode 100644
index 0000000000..2f990f9293
Binary files /dev/null and b/examples/compiled/boxplot_2D_vertical_single_per_group.png differ
diff --git a/examples/compiled/boxplot_2D_vertical_single_per_group.svg b/examples/compiled/boxplot_2D_vertical_single_per_group.svg
new file mode 100644
index 0000000000..f43395584f
--- /dev/null
+++ b/examples/compiled/boxplot_2D_vertical_single_per_group.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/boxplot_2D_vertical_single_per_group.vg.json b/examples/compiled/boxplot_2D_vertical_single_per_group.vg.json
new file mode 100644
index 0000000000..0ea2889ea3
--- /dev/null
+++ b/examples/compiled/boxplot_2D_vertical_single_per_group.vg.json
@@ -0,0 +1,297 @@
+{
+ "$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": "A", "b": 30}, {"a": "B", "b": 55}]
+ },
+ {
+ "name": "data_1",
+ "source": "source_0",
+ "transform": [
+ {
+ "type": "joinaggregate",
+ "as": ["lower_box_b", "upper_box_b"],
+ "ops": ["q1", "q3"],
+ "fields": ["b", "b"],
+ "groupby": ["a"]
+ }
+ ]
+ },
+ {
+ "name": "data_2",
+ "source": "data_1",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "(datum[\"b\"] < datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"])) || (datum[\"b\"] > datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ },
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_3",
+ "source": "data_1",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "(datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]) <= datum[\"b\"]) && (datum[\"b\"] <= datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ },
+ {
+ "type": "aggregate",
+ "groupby": ["a"],
+ "ops": ["min", "max", "min", "max"],
+ "fields": ["b", "b", "lower_box_b", "upper_box_b"],
+ "as": [
+ "lower_whisker_b",
+ "upper_whisker_b",
+ "lower_box_b",
+ "upper_box_b"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "data_4",
+ "source": "data_3",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"lower_whisker_b\"]) && isFinite(+datum[\"lower_whisker_b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_5",
+ "source": "data_3",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"upper_box_b\"]) && isFinite(+datum[\"upper_box_b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_6",
+ "source": "source_0",
+ "transform": [
+ {
+ "type": "aggregate",
+ "groupby": ["a"],
+ "ops": ["q1", "q3", "median", "min", "max"],
+ "fields": ["b", "b", "b", "b", "b"],
+ "as": ["lower_box_b", "upper_box_b", "mid_box_b", "min_b", "max_b"]
+ }
+ ]
+ },
+ {
+ "name": "data_7",
+ "source": "data_6",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"lower_box_b\"]) && isFinite(+datum[\"lower_box_b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_8",
+ "source": "data_6",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"mid_box_b\"]) && isFinite(+datum[\"mid_box_b\"])"
+ }
+ ]
+ }
+ ],
+ "signals": [
+ {"name": "x_step", "value": 20},
+ {"name": "width", "update": "bandspace(domain('x').length, 0, 0) * x_step"}
+ ],
+ "marks": [
+ {
+ "name": "layer_0_layer_0_marks",
+ "type": "symbol",
+ "style": ["point", "boxplot-outliers"],
+ "from": {"data": "data_2"},
+ "encode": {
+ "update": {
+ "opacity": {"value": 0.7},
+ "fill": {"value": "transparent"},
+ "stroke": {"value": "#4c78a8"},
+ "ariaRoleDescription": {"value": "point"},
+ "description": {
+ "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
+ },
+ "x": {"scale": "x", "field": "a", "band": 0.5},
+ "y": {"scale": "y", "field": "b"}
+ }
+ }
+ },
+ {
+ "name": "layer_0_layer_1_layer_0_marks",
+ "type": "rule",
+ "style": ["rule", "boxplot-rule"],
+ "aria": false,
+ "from": {"data": "data_4"},
+ "encode": {
+ "update": {
+ "stroke": {"value": "black"},
+ "tooltip": {
+ "signal": "{\"Upper Whisker of b\": format(datum[\"upper_whisker_b\"], \"\"), \"Lower Whisker of b\": format(datum[\"lower_whisker_b\"], \"\"), \"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "x": {"scale": "x", "field": "a", "band": 0.5},
+ "y": {"scale": "y", "field": "lower_whisker_b"},
+ "y2": {"scale": "y", "field": "lower_box_b"}
+ }
+ }
+ },
+ {
+ "name": "layer_0_layer_1_layer_1_marks",
+ "type": "rule",
+ "style": ["rule", "boxplot-rule"],
+ "aria": false,
+ "from": {"data": "data_5"},
+ "encode": {
+ "update": {
+ "stroke": {"value": "black"},
+ "tooltip": {
+ "signal": "{\"Upper Whisker of b\": format(datum[\"upper_whisker_b\"], \"\"), \"Lower Whisker of b\": format(datum[\"lower_whisker_b\"], \"\"), \"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "x": {"scale": "x", "field": "a", "band": 0.5},
+ "y": {"scale": "y", "field": "upper_box_b"},
+ "y2": {"scale": "y", "field": "upper_whisker_b"}
+ }
+ }
+ },
+ {
+ "name": "layer_1_layer_0_marks",
+ "type": "rect",
+ "style": ["bar", "boxplot-box"],
+ "from": {"data": "data_7"},
+ "encode": {
+ "update": {
+ "ariaRoleDescription": {"value": "box"},
+ "fill": {"value": "#4c78a8"},
+ "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\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "description": {
+ "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"lower_box_b\"], \"\")) + \"; upper_box_b: \" + (format(datum[\"upper_box_b\"], \"\")) + \"; 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\"], \"\"))"
+ },
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
+ "width": {"value": 14},
+ "y": {"scale": "y", "field": "lower_box_b"},
+ "y2": {"scale": "y", "field": "upper_box_b"}
+ }
+ }
+ },
+ {
+ "name": "layer_1_layer_1_marks",
+ "type": "rect",
+ "style": ["tick", "boxplot-median"],
+ "aria": false,
+ "from": {"data": "data_8"},
+ "encode": {
+ "update": {
+ "opacity": {"value": 0.7},
+ "fill": [
+ {
+ "test": "datum['lower_box_b'] >= datum['upper_box_b']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
+ "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\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
+ "yc": {"scale": "y", "field": "mid_box_b"},
+ "width": {"value": 14},
+ "height": {"value": 1}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "band",
+ "domain": {
+ "fields": [
+ {"data": "data_2", "field": "a"},
+ {"data": "data_4", "field": "a"},
+ {"data": "data_5", "field": "a"},
+ {"data": "data_7", "field": "a"},
+ {"data": "data_8", "field": "a"}
+ ],
+ "sort": true
+ },
+ "range": {"step": {"signal": "x_step"}},
+ "paddingInner": 0,
+ "paddingOuter": 0
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {
+ "fields": [
+ {"data": "data_2", "field": "b"},
+ {"data": "data_4", "field": "lower_whisker_b"},
+ {"data": "data_4", "field": "lower_box_b"},
+ {"data": "data_5", "field": "upper_box_b"},
+ {"data": "data_5", "field": "upper_whisker_b"},
+ {"data": "data_7", "field": "lower_box_b"},
+ {"data": "data_7", "field": "upper_box_b"},
+ {"data": "data_8", "field": "mid_box_b"}
+ ]
+ },
+ "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/boxplot_2D_vertical_single_per_group_color.png b/examples/compiled/boxplot_2D_vertical_single_per_group_color.png
new file mode 100644
index 0000000000..5abbf21f7d
Binary files /dev/null and b/examples/compiled/boxplot_2D_vertical_single_per_group_color.png differ
diff --git a/examples/compiled/boxplot_2D_vertical_single_per_group_color.svg b/examples/compiled/boxplot_2D_vertical_single_per_group_color.svg
new file mode 100644
index 0000000000..96a2e7ca0c
--- /dev/null
+++ b/examples/compiled/boxplot_2D_vertical_single_per_group_color.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/compiled/boxplot_2D_vertical_single_per_group_color.vg.json b/examples/compiled/boxplot_2D_vertical_single_per_group_color.vg.json
new file mode 100644
index 0000000000..d1313bdca4
--- /dev/null
+++ b/examples/compiled/boxplot_2D_vertical_single_per_group_color.vg.json
@@ -0,0 +1,320 @@
+{
+ "$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": "A", "b": 30}, {"a": "B", "b": 55}]
+ },
+ {
+ "name": "data_1",
+ "source": "source_0",
+ "transform": [
+ {
+ "type": "joinaggregate",
+ "as": ["lower_box_b", "upper_box_b"],
+ "ops": ["q1", "q3"],
+ "fields": ["b", "b"],
+ "groupby": ["a", "a"]
+ }
+ ]
+ },
+ {
+ "name": "data_2",
+ "source": "data_1",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "(datum[\"b\"] < datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"])) || (datum[\"b\"] > datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ },
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_3",
+ "source": "data_1",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "(datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]) <= datum[\"b\"]) && (datum[\"b\"] <= datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ },
+ {
+ "type": "aggregate",
+ "groupby": ["a"],
+ "ops": ["min", "max", "min", "max"],
+ "fields": ["b", "b", "lower_box_b", "upper_box_b"],
+ "as": [
+ "lower_whisker_b",
+ "upper_whisker_b",
+ "lower_box_b",
+ "upper_box_b"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "data_4",
+ "source": "data_3",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"lower_whisker_b\"]) && isFinite(+datum[\"lower_whisker_b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_5",
+ "source": "data_3",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"upper_box_b\"]) && isFinite(+datum[\"upper_box_b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_6",
+ "source": "source_0",
+ "transform": [
+ {
+ "type": "aggregate",
+ "groupby": ["a"],
+ "ops": ["q1", "q3", "median", "min", "max"],
+ "fields": ["b", "b", "b", "b", "b"],
+ "as": ["lower_box_b", "upper_box_b", "mid_box_b", "min_b", "max_b"]
+ }
+ ]
+ },
+ {
+ "name": "data_7",
+ "source": "data_6",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"lower_box_b\"]) && isFinite(+datum[\"lower_box_b\"])"
+ }
+ ]
+ },
+ {
+ "name": "data_8",
+ "source": "data_6",
+ "transform": [
+ {
+ "type": "filter",
+ "expr": "isValid(datum[\"mid_box_b\"]) && isFinite(+datum[\"mid_box_b\"])"
+ }
+ ]
+ }
+ ],
+ "signals": [
+ {"name": "x_step", "value": 20},
+ {"name": "width", "update": "bandspace(domain('x').length, 0, 0) * x_step"}
+ ],
+ "marks": [
+ {
+ "name": "layer_0_layer_0_marks",
+ "type": "symbol",
+ "style": ["point", "boxplot-outliers"],
+ "from": {"data": "data_2"},
+ "encode": {
+ "update": {
+ "opacity": {"value": 0.7},
+ "fill": {"value": "transparent"},
+ "stroke": {"scale": "color", "field": "a"},
+ "ariaRoleDescription": {"value": "point"},
+ "description": {
+ "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
+ },
+ "x": {"scale": "x", "field": "a", "band": 0.5},
+ "y": {"scale": "y", "field": "b"}
+ }
+ }
+ },
+ {
+ "name": "layer_0_layer_1_layer_0_marks",
+ "type": "rule",
+ "style": ["rule", "boxplot-rule"],
+ "aria": false,
+ "from": {"data": "data_4"},
+ "encode": {
+ "update": {
+ "stroke": {"value": "black"},
+ "tooltip": {
+ "signal": "{\"Upper Whisker of b\": format(datum[\"upper_whisker_b\"], \"\"), \"Lower Whisker of b\": format(datum[\"lower_whisker_b\"], \"\"), \"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "x": {"scale": "x", "field": "a", "band": 0.5},
+ "y": {"scale": "y", "field": "lower_whisker_b"},
+ "y2": {"scale": "y", "field": "lower_box_b"}
+ }
+ }
+ },
+ {
+ "name": "layer_0_layer_1_layer_1_marks",
+ "type": "rule",
+ "style": ["rule", "boxplot-rule"],
+ "aria": false,
+ "from": {"data": "data_5"},
+ "encode": {
+ "update": {
+ "stroke": {"value": "black"},
+ "tooltip": {
+ "signal": "{\"Upper Whisker of b\": format(datum[\"upper_whisker_b\"], \"\"), \"Lower Whisker of b\": format(datum[\"lower_whisker_b\"], \"\"), \"a\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "x": {"scale": "x", "field": "a", "band": 0.5},
+ "y": {"scale": "y", "field": "upper_box_b"},
+ "y2": {"scale": "y", "field": "upper_whisker_b"}
+ }
+ }
+ },
+ {
+ "name": "layer_1_layer_0_marks",
+ "type": "rect",
+ "style": ["bar", "boxplot-box"],
+ "from": {"data": "data_7"},
+ "encode": {
+ "update": {
+ "ariaRoleDescription": {"value": "box"},
+ "fill": {"scale": "color", "field": "a"},
+ "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\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "description": {
+ "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"lower_box_b\"], \"\")) + \"; upper_box_b: \" + (format(datum[\"upper_box_b\"], \"\")) + \"; 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\"], \"\"))"
+ },
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
+ "width": {"value": 14},
+ "y": {"scale": "y", "field": "lower_box_b"},
+ "y2": {"scale": "y", "field": "upper_box_b"}
+ }
+ }
+ },
+ {
+ "name": "layer_1_layer_1_marks",
+ "type": "rect",
+ "style": ["tick", "boxplot-median"],
+ "aria": false,
+ "from": {"data": "data_8"},
+ "encode": {
+ "update": {
+ "opacity": {"value": 0.7},
+ "fill": [
+ {
+ "test": "datum['lower_box_b'] >= datum['upper_box_b']",
+ "scale": "color",
+ "field": "a"
+ },
+ {"value": "white"}
+ ],
+ "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\": isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"]}"
+ },
+ "xc": {"scale": "x", "field": "a", "band": 0.5},
+ "yc": {"scale": "y", "field": "mid_box_b"},
+ "width": {"value": 14},
+ "height": {"value": 1}
+ }
+ }
+ }
+ ],
+ "scales": [
+ {
+ "name": "x",
+ "type": "band",
+ "domain": {
+ "fields": [
+ {"data": "data_2", "field": "a"},
+ {"data": "data_4", "field": "a"},
+ {"data": "data_5", "field": "a"},
+ {"data": "data_7", "field": "a"},
+ {"data": "data_8", "field": "a"}
+ ],
+ "sort": true
+ },
+ "range": {"step": {"signal": "x_step"}},
+ "paddingInner": 0,
+ "paddingOuter": 0
+ },
+ {
+ "name": "y",
+ "type": "linear",
+ "domain": {
+ "fields": [
+ {"data": "data_2", "field": "b"},
+ {"data": "data_4", "field": "lower_whisker_b"},
+ {"data": "data_4", "field": "lower_box_b"},
+ {"data": "data_5", "field": "upper_box_b"},
+ {"data": "data_5", "field": "upper_whisker_b"},
+ {"data": "data_7", "field": "lower_box_b"},
+ {"data": "data_7", "field": "upper_box_b"},
+ {"data": "data_8", "field": "mid_box_b"}
+ ]
+ },
+ "range": [{"signal": "height"}, 0],
+ "nice": true,
+ "zero": true
+ },
+ {
+ "name": "color",
+ "type": "ordinal",
+ "domain": {
+ "fields": [
+ {"data": "data_2", "field": "a"},
+ {"data": "data_7", "field": "a"},
+ {"data": "data_8", "field": "a"}
+ ],
+ "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": "a",
+ "labelAngle": 0,
+ "labelBaseline": "top",
+ "zindex": 0
+ },
+ {
+ "scale": "y",
+ "orient": "left",
+ "grid": false,
+ "title": "b",
+ "labelOverlap": true,
+ "tickCount": {"signal": "ceil(height/40)"},
+ "zindex": 0
+ }
+ ],
+ "legends": [
+ {
+ "stroke": "color",
+ "symbolType": "circle",
+ "title": "a",
+ "encode": {"symbols": {"update": {"opacity": {"value": 0.7}}}},
+ "fill": "color"
+ }
+ ]
+}
diff --git a/examples/compiled/boxplot_groupped.vg.json b/examples/compiled/boxplot_groupped.vg.json
index 71cd079b7d..2b0b85159b 100644
--- a/examples/compiled/boxplot_groupped.vg.json
+++ b/examples/compiled/boxplot_groupped.vg.json
@@ -240,7 +240,14 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Acceleration'] >= datum['upper_box_Acceleration']",
+ "scale": "color",
+ "field": "Origin"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
@@ -314,7 +321,8 @@
"domain": {
"fields": [
{"data": "data_1", "field": "Origin"},
- {"data": "data_6", "field": "Origin"}
+ {"data": "data_6", "field": "Origin"},
+ {"data": "data_7", "field": "Origin"}
],
"sort": true
},
diff --git a/examples/compiled/boxplot_minmax_2D_horizontal.vg.json b/examples/compiled/boxplot_minmax_2D_horizontal.vg.json
index b6a8859e67..1cfb790cf9 100644
--- a/examples/compiled/boxplot_minmax_2D_horizontal.vg.json
+++ b/examples/compiled/boxplot_minmax_2D_horizontal.vg.json
@@ -145,7 +145,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
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..3be74d5c6a 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
@@ -145,7 +145,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "orange"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "orange"}
+ ],
"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\"]}"
},
diff --git a/examples/compiled/boxplot_minmax_2D_vertical.vg.json b/examples/compiled/boxplot_minmax_2D_vertical.vg.json
index ebff85d15d..f8f5dfbde6 100644
--- a/examples/compiled/boxplot_minmax_2D_vertical.vg.json
+++ b/examples/compiled/boxplot_minmax_2D_vertical.vg.json
@@ -145,7 +145,14 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "scale": "color",
+ "field": "Species"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
@@ -195,7 +202,13 @@
{
"name": "color",
"type": "ordinal",
- "domain": {"data": "data_2", "field": "Species", "sort": true},
+ "domain": {
+ "fields": [
+ {"data": "data_2", "field": "Species"},
+ {"data": "data_3", "field": "Species"}
+ ],
+ "sort": true
+ },
"range": "category"
}
],
diff --git a/examples/compiled/boxplot_tooltip_aggregate.vg.json b/examples/compiled/boxplot_tooltip_aggregate.vg.json
index 3639739c61..f2597fbe5b 100644
--- a/examples/compiled/boxplot_tooltip_aggregate.vg.json
+++ b/examples/compiled/boxplot_tooltip_aggregate.vg.json
@@ -220,7 +220,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"tooltip": {"signal": "format(datum[\"mean_Body Mass (g)\"], \"\")"},
"xc": {"scale": "x", "field": "mid_box_Body Mass (g)"},
"yc": {"scale": "y", "field": "Species", "band": 0.5},
diff --git a/examples/compiled/boxplot_tooltip_not_aggregate.vg.json b/examples/compiled/boxplot_tooltip_not_aggregate.vg.json
index fdc830314a..f845845978 100644
--- a/examples/compiled/boxplot_tooltip_not_aggregate.vg.json
+++ b/examples/compiled/boxplot_tooltip_not_aggregate.vg.json
@@ -223,7 +223,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
diff --git a/examples/compiled/layer_boxplot_circle.vg.json b/examples/compiled/layer_boxplot_circle.vg.json
index bf1b80bc52..3186d3f671 100644
--- a/examples/compiled/layer_boxplot_circle.vg.json
+++ b/examples/compiled/layer_boxplot_circle.vg.json
@@ -187,7 +187,13 @@
"encode": {
"update": {
"opacity": {"value": 0.7},
- "fill": {"value": "white"},
+ "fill": [
+ {
+ "test": "datum['lower_box_people'] >= datum['upper_box_people']",
+ "value": "#4c78a8"
+ },
+ {"value": "white"}
+ ],
"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\"]}"
},
diff --git a/examples/compiled/vega_version b/examples/compiled/vega_version
index 79b12df42d..d3f82c401a 100644
--- a/examples/compiled/vega_version
+++ b/examples/compiled/vega_version
@@ -1 +1 @@
-vega: 5.27.0
+vega: 5.28.0
diff --git a/examples/specs/boxplot_2D_vertical_single_per_group.vl.json b/examples/specs/boxplot_2D_vertical_single_per_group.vl.json
new file mode 100644
index 0000000000..1c00ad7159
--- /dev/null
+++ b/examples/specs/boxplot_2D_vertical_single_per_group.vl.json
@@ -0,0 +1,14 @@
+{
+ "$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": "A", "b": 30}, {"a": "B", "b": 55}
+ ]
+ },
+ "mark": "boxplot",
+ "encoding": {
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "y": {"field": "b", "type": "quantitative"}
+ }
+}
diff --git a/examples/specs/boxplot_2D_vertical_single_per_group_color.vl.json b/examples/specs/boxplot_2D_vertical_single_per_group_color.vl.json
new file mode 100644
index 0000000000..793cffb7ff
--- /dev/null
+++ b/examples/specs/boxplot_2D_vertical_single_per_group_color.vl.json
@@ -0,0 +1,15 @@
+{
+ "$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": "A", "b": 30}, {"a": "B", "b": 55}
+ ]
+ },
+ "mark": "boxplot",
+ "encoding": {
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "color": {"field": "a", "type": "nominal"},
+ "y": {"field": "b", "type": "quantitative"}
+ }
+}
diff --git a/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json b/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json
index c7f8120a72..fecd2fe25e 100644
--- a/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_1D_horizontal_custom_mark_normalized.vl.json
@@ -269,6 +269,12 @@
"title": "Body Mass (g)",
"scale": {"zero": false}
},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json b/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json
index 7f5e5ba217..3346ac339f 100644
--- a/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_1D_horizontal_explicit_normalized.vl.json
@@ -209,6 +209,12 @@
"title": "Body Mass (g)",
"scale": {"zero": false}
},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json b/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json
index 7f5e5ba217..3346ac339f 100644
--- a/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_1D_horizontal_normalized.vl.json
@@ -209,6 +209,12 @@
"title": "Body Mass (g)",
"scale": {"zero": false}
},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_1D_invalid_normalized.vl.json b/examples/specs/normalized/boxplot_1D_invalid_normalized.vl.json
index ff48fdcb03..dce2524e3d 100644
--- a/examples/specs/normalized/boxplot_1D_invalid_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_1D_invalid_normalized.vl.json
@@ -196,6 +196,12 @@
"type": "quantitative",
"axis": {"labelAngle": 0}
},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_b'] >= datum['upper_box_b']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{"field": "max_b", "type": "quantitative", "title": "Max of b"},
{
diff --git a/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json b/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json
index 32161bd1e8..6a0640cc08 100644
--- a/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_1D_vertical_normalized.vl.json
@@ -209,6 +209,12 @@
"title": "Body Mass (g)",
"scale": {"zero": false}
},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json b/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json
index 427ef196b8..e7c86be774 100644
--- a/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_2D_horizontal_color_size_normalized.vl.json
@@ -221,6 +221,12 @@
},
"y": {"field": "Species", "type": "nominal"},
"size": {"value": 10},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "teal"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json b/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json
index 204779636f..ccd9dc76e3 100644
--- a/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_2D_horizontal_normalized.vl.json
@@ -217,6 +217,12 @@
"scale": {"zero": false}
},
"y": {"field": "Species", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json b/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json
index f8e447b54a..6acebbfc1b 100644
--- a/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_2D_vertical_normalized.vl.json
@@ -219,6 +219,14 @@
"scale": {"zero": false}
},
"x": {"field": "Species", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "field": "Species",
+ "type": "nominal",
+ "legend": null
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_2D_vertical_single_per_group_color_normalized.vl.json b/examples/specs/normalized/boxplot_2D_vertical_single_per_group_color_normalized.vl.json
new file mode 100644
index 0000000000..f33ab5ebd9
--- /dev/null
+++ b/examples/specs/normalized/boxplot_2D_vertical_single_per_group_color_normalized.vl.json
@@ -0,0 +1,203 @@
+{
+ "$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": "A", "b": 30}, {"a": "B", "b": 55}]
+ },
+ "layer": [
+ {
+ "transform": [
+ {
+ "joinaggregate": [
+ {"op": "q1", "field": "b", "as": "lower_box_b"},
+ {"op": "q3", "field": "b", "as": "upper_box_b"}
+ ],
+ "groupby": ["a", "a"]
+ }
+ ],
+ "layer": [
+ {
+ "transform": [
+ {
+ "filter": "(datum[\"b\"] < datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"])) || (datum[\"b\"] > datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ }
+ ],
+ "mark": {"type": "point", "style": "boxplot-outliers"},
+ "encoding": {
+ "y": {"field": "b", "type": "quantitative", "title": "b"},
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "color": {"field": "a", "type": "nominal"}
+ }
+ },
+ {
+ "transform": [
+ {
+ "filter": "(datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]) <= datum[\"b\"]) && (datum[\"b\"] <= datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ },
+ {
+ "aggregate": [
+ {"op": "min", "field": "b", "as": "lower_whisker_b"},
+ {"op": "max", "field": "b", "as": "upper_whisker_b"},
+ {"op": "min", "field": "lower_box_b", "as": "lower_box_b"},
+ {"op": "max", "field": "upper_box_b", "as": "upper_box_b"}
+ ],
+ "groupby": ["a", "a"]
+ }
+ ],
+ "layer": [
+ {
+ "mark": {"type": "rule", "aria": false, "style": "boxplot-rule"},
+ "encoding": {
+ "y": {
+ "field": "lower_whisker_b",
+ "type": "quantitative",
+ "title": "b"
+ },
+ "y2": {"field": "lower_box_b"},
+ "x": {
+ "field": "a",
+ "type": "nominal",
+ "axis": {"labelAngle": 0}
+ },
+ "tooltip": [
+ {
+ "field": "upper_whisker_b",
+ "type": "quantitative",
+ "title": "Upper Whisker of b"
+ },
+ {
+ "field": "lower_whisker_b",
+ "type": "quantitative",
+ "title": "Lower Whisker of b"
+ },
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ },
+ {
+ "mark": {"type": "rule", "aria": false, "style": "boxplot-rule"},
+ "encoding": {
+ "y": {
+ "field": "upper_box_b",
+ "type": "quantitative",
+ "title": "b"
+ },
+ "y2": {"field": "upper_whisker_b"},
+ "x": {
+ "field": "a",
+ "type": "nominal",
+ "axis": {"labelAngle": 0}
+ },
+ "tooltip": [
+ {
+ "field": "upper_whisker_b",
+ "type": "quantitative",
+ "title": "Upper Whisker of b"
+ },
+ {
+ "field": "lower_whisker_b",
+ "type": "quantitative",
+ "title": "Lower Whisker of b"
+ },
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "transform": [
+ {
+ "aggregate": [
+ {"op": "q1", "field": "b", "as": "lower_box_b"},
+ {"op": "q3", "field": "b", "as": "upper_box_b"},
+ {"op": "median", "field": "b", "as": "mid_box_b"},
+ {"op": "min", "field": "b", "as": "min_b"},
+ {"op": "max", "field": "b", "as": "max_b"}
+ ],
+ "groupby": ["a", "a"]
+ }
+ ],
+ "layer": [
+ {
+ "mark": {
+ "type": "bar",
+ "size": 14,
+ "orient": "vertical",
+ "ariaRoleDescription": "box",
+ "style": "boxplot-box"
+ },
+ "encoding": {
+ "y": {"field": "lower_box_b", "type": "quantitative", "title": "b"},
+ "y2": {"field": "upper_box_b"},
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "color": {"field": "a", "type": "nominal"},
+ "tooltip": [
+ {"field": "max_b", "type": "quantitative", "title": "Max of b"},
+ {
+ "field": "upper_box_b",
+ "type": "quantitative",
+ "title": "Q3 of b"
+ },
+ {
+ "field": "mid_box_b",
+ "type": "quantitative",
+ "title": "Median of b"
+ },
+ {
+ "field": "lower_box_b",
+ "type": "quantitative",
+ "title": "Q1 of b"
+ },
+ {"field": "min_b", "type": "quantitative", "title": "Min of b"},
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ },
+ {
+ "mark": {
+ "color": "white",
+ "type": "tick",
+ "size": 14,
+ "orient": "horizontal",
+ "aria": false,
+ "style": "boxplot-median"
+ },
+ "encoding": {
+ "y": {"field": "mid_box_b", "type": "quantitative", "title": "b"},
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_b'] >= datum['upper_box_b']",
+ "field": "a",
+ "type": "nominal"
+ }
+ },
+ "tooltip": [
+ {"field": "max_b", "type": "quantitative", "title": "Max of b"},
+ {
+ "field": "upper_box_b",
+ "type": "quantitative",
+ "title": "Q3 of b"
+ },
+ {
+ "field": "mid_box_b",
+ "type": "quantitative",
+ "title": "Median of b"
+ },
+ {
+ "field": "lower_box_b",
+ "type": "quantitative",
+ "title": "Q1 of b"
+ },
+ {"field": "min_b", "type": "quantitative", "title": "Min of b"},
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/examples/specs/normalized/boxplot_2D_vertical_single_per_group_normalized.vl.json b/examples/specs/normalized/boxplot_2D_vertical_single_per_group_normalized.vl.json
new file mode 100644
index 0000000000..dc2969b67a
--- /dev/null
+++ b/examples/specs/normalized/boxplot_2D_vertical_single_per_group_normalized.vl.json
@@ -0,0 +1,200 @@
+{
+ "$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": "A", "b": 30}, {"a": "B", "b": 55}]
+ },
+ "layer": [
+ {
+ "transform": [
+ {
+ "joinaggregate": [
+ {"op": "q1", "field": "b", "as": "lower_box_b"},
+ {"op": "q3", "field": "b", "as": "upper_box_b"}
+ ],
+ "groupby": ["a"]
+ }
+ ],
+ "layer": [
+ {
+ "transform": [
+ {
+ "filter": "(datum[\"b\"] < datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"])) || (datum[\"b\"] > datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ }
+ ],
+ "mark": {"type": "point", "style": "boxplot-outliers"},
+ "encoding": {
+ "y": {"field": "b", "type": "quantitative", "title": "b"},
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}}
+ }
+ },
+ {
+ "transform": [
+ {
+ "filter": "(datum[\"lower_box_b\"] - 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]) <= datum[\"b\"]) && (datum[\"b\"] <= datum[\"upper_box_b\"] + 1.5 * (datum[\"upper_box_b\"] - datum[\"lower_box_b\"]))"
+ },
+ {
+ "aggregate": [
+ {"op": "min", "field": "b", "as": "lower_whisker_b"},
+ {"op": "max", "field": "b", "as": "upper_whisker_b"},
+ {"op": "min", "field": "lower_box_b", "as": "lower_box_b"},
+ {"op": "max", "field": "upper_box_b", "as": "upper_box_b"}
+ ],
+ "groupby": ["a"]
+ }
+ ],
+ "layer": [
+ {
+ "mark": {"type": "rule", "aria": false, "style": "boxplot-rule"},
+ "encoding": {
+ "y": {
+ "field": "lower_whisker_b",
+ "type": "quantitative",
+ "title": "b"
+ },
+ "y2": {"field": "lower_box_b"},
+ "x": {
+ "field": "a",
+ "type": "nominal",
+ "axis": {"labelAngle": 0}
+ },
+ "tooltip": [
+ {
+ "field": "upper_whisker_b",
+ "type": "quantitative",
+ "title": "Upper Whisker of b"
+ },
+ {
+ "field": "lower_whisker_b",
+ "type": "quantitative",
+ "title": "Lower Whisker of b"
+ },
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ },
+ {
+ "mark": {"type": "rule", "aria": false, "style": "boxplot-rule"},
+ "encoding": {
+ "y": {
+ "field": "upper_box_b",
+ "type": "quantitative",
+ "title": "b"
+ },
+ "y2": {"field": "upper_whisker_b"},
+ "x": {
+ "field": "a",
+ "type": "nominal",
+ "axis": {"labelAngle": 0}
+ },
+ "tooltip": [
+ {
+ "field": "upper_whisker_b",
+ "type": "quantitative",
+ "title": "Upper Whisker of b"
+ },
+ {
+ "field": "lower_whisker_b",
+ "type": "quantitative",
+ "title": "Lower Whisker of b"
+ },
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "transform": [
+ {
+ "aggregate": [
+ {"op": "q1", "field": "b", "as": "lower_box_b"},
+ {"op": "q3", "field": "b", "as": "upper_box_b"},
+ {"op": "median", "field": "b", "as": "mid_box_b"},
+ {"op": "min", "field": "b", "as": "min_b"},
+ {"op": "max", "field": "b", "as": "max_b"}
+ ],
+ "groupby": ["a"]
+ }
+ ],
+ "layer": [
+ {
+ "mark": {
+ "type": "bar",
+ "size": 14,
+ "orient": "vertical",
+ "ariaRoleDescription": "box",
+ "style": "boxplot-box"
+ },
+ "encoding": {
+ "y": {"field": "lower_box_b", "type": "quantitative", "title": "b"},
+ "y2": {"field": "upper_box_b"},
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "tooltip": [
+ {"field": "max_b", "type": "quantitative", "title": "Max of b"},
+ {
+ "field": "upper_box_b",
+ "type": "quantitative",
+ "title": "Q3 of b"
+ },
+ {
+ "field": "mid_box_b",
+ "type": "quantitative",
+ "title": "Median of b"
+ },
+ {
+ "field": "lower_box_b",
+ "type": "quantitative",
+ "title": "Q1 of b"
+ },
+ {"field": "min_b", "type": "quantitative", "title": "Min of b"},
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ },
+ {
+ "mark": {
+ "color": "white",
+ "type": "tick",
+ "size": 14,
+ "orient": "horizontal",
+ "aria": false,
+ "style": "boxplot-median"
+ },
+ "encoding": {
+ "y": {"field": "mid_box_b", "type": "quantitative", "title": "b"},
+ "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_b'] >= datum['upper_box_b']",
+ "value": "#4c78a8"
+ }
+ },
+ "tooltip": [
+ {"field": "max_b", "type": "quantitative", "title": "Max of b"},
+ {
+ "field": "upper_box_b",
+ "type": "quantitative",
+ "title": "Q3 of b"
+ },
+ {
+ "field": "mid_box_b",
+ "type": "quantitative",
+ "title": "Median of b"
+ },
+ {
+ "field": "lower_box_b",
+ "type": "quantitative",
+ "title": "Q1 of b"
+ },
+ {"field": "min_b", "type": "quantitative", "title": "Min of b"},
+ {"field": "a", "type": "nominal"}
+ ]
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/examples/specs/normalized/boxplot_groupped_normalized.vl.json b/examples/specs/normalized/boxplot_groupped_normalized.vl.json
index b8e359d43d..668b0f1257 100644
--- a/examples/specs/normalized/boxplot_groupped_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_groupped_normalized.vl.json
@@ -222,6 +222,13 @@
},
"x": {"field": "Cylinders", "type": "nominal"},
"xOffset": {"field": "Origin", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Acceleration'] >= datum['upper_box_Acceleration']",
+ "field": "Origin",
+ "type": "nominal"
+ }
+ },
"tooltip": [
{
"field": "max_Acceleration",
diff --git a/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json b/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json
index 2e4c5232b2..3033c4bf40 100644
--- a/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_minmax_2D_horizontal_custom_midtick_color_normalized.vl.json
@@ -174,6 +174,12 @@
"scale": {"zero": false}
},
"y": {"field": "Species", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "upper_whisker_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json b/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json
index 0276d49ba5..2dc34b86b3 100644
--- a/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_minmax_2D_horizontal_normalized.vl.json
@@ -173,6 +173,12 @@
"scale": {"zero": false}
},
"y": {"field": "Species", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "upper_whisker_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json b/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json
index 2e73bc3735..fbea4bbf68 100644
--- a/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_minmax_2D_vertical_normalized.vl.json
@@ -174,6 +174,14 @@
"scale": {"zero": false}
},
"x": {"field": "Species", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "field": "Species",
+ "type": "nominal",
+ "legend": null
+ }
+ },
"tooltip": [
{
"field": "upper_whisker_Body Mass (g)",
diff --git a/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json b/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json
index a98791a2ab..3180a7c526 100644
--- a/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_tooltip_aggregate_normalized.vl.json
@@ -192,6 +192,12 @@
"title": "Mean of Body Mass (g)",
"type": "quantitative",
"field": "mean_Body Mass (g)"
+ },
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
}
}
}
diff --git a/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json b/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json
index 6284901903..e5259d3b63 100644
--- a/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json
+++ b/examples/specs/normalized/boxplot_tooltip_not_aggregate_normalized.vl.json
@@ -218,6 +218,12 @@
"scale": {"zero": false}
},
"y": {"field": "Species", "type": "nominal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_Body Mass (g)'] >= datum['upper_box_Body Mass (g)']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_Body Mass (g)",
diff --git a/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json b/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json
index e389345385..4b9038e964 100644
--- a/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json
+++ b/examples/specs/normalized/layer_boxplot_circle_normalized.vl.json
@@ -165,6 +165,12 @@
"title": "population"
},
"y": {"field": "age", "type": "ordinal"},
+ "color": {
+ "condition": {
+ "test": "datum['lower_box_people'] >= datum['upper_box_people']",
+ "value": "#4c78a8"
+ }
+ },
"tooltip": [
{
"field": "max_people",
diff --git a/src/compositemark/boxplot.ts b/src/compositemark/boxplot.ts
index fde30dfa8c..d6e37c9efd 100644
--- a/src/compositemark/boxplot.ts
+++ b/src/compositemark/boxplot.ts
@@ -136,7 +136,17 @@ export function normalizeBoxPlot(
const makeBoxPlotExtent = makeBoxPlotPart(encodingWithoutSizeColorAndContinuousAxis);
const makeBoxPlotBox = makeBoxPlotPart(encodingWithoutContinuousAxis);
- const makeBoxPlotMidTick = makeBoxPlotPart({...encodingWithoutSizeColorAndContinuousAxis, ...(size ? {size} : {})});
+ const defaultBoxColor = (isObject(config.boxplot.box) ? config.boxplot.box.color : config.mark.color) || '#4c78a8';
+ const makeBoxPlotMidTick = makeBoxPlotPart({
+ ...encodingWithoutSizeColorAndContinuousAxis,
+ ...(size ? {size} : {}),
+ color: {
+ condition: {
+ test: `datum['lower_box_${continuousAxisChannelDef.field}'] >= datum['upper_box_${continuousAxisChannelDef.field}']`,
+ ...(color || {value: defaultBoxColor})
+ }
+ }
+ });
const fiveSummaryTooltipEncoding: Encoding = getCompositeMarkTooltip(
[