Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#8338,#8126): make boxplot work with single value per group #8339

Merged
merged 8 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion examples/compiled/boxplot_1D_horizontal.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"], \"\")}"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"], \"\")}"
},
Expand Down
8 changes: 7 additions & 1 deletion examples/compiled/boxplot_1D_horizontal_explicit.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"], \"\")}"
},
Expand Down
8 changes: 7 additions & 1 deletion examples/compiled/boxplot_1D_invalid.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\"], \"\")}"
},
Expand Down
8 changes: 7 additions & 1 deletion examples/compiled/boxplot_1D_vertical.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"], \"\")}"
},
Expand Down
8 changes: 7 additions & 1 deletion examples/compiled/boxplot_2D_horizontal.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\"]}"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\"]}"
},
Expand Down
12 changes: 10 additions & 2 deletions examples/compiled/boxplot_2D_vertical.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\"]}"
},
Expand Down Expand Up @@ -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
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading