Skip to content

fix(writer): boxplot produces invalid Vega-Lite spec#449

Merged
teunbrand merged 1 commit into
posit-dev:mainfrom
cpsievert:fix/boxplot-invalid-vegalite
May 18, 2026
Merged

fix(writer): boxplot produces invalid Vega-Lite spec#449
teunbrand merged 1 commit into
posit-dev:mainfrom
cpsievert:fix/boxplot-invalid-vegalite

Conversation

@cpsievert
Copy link
Copy Markdown
Collaborator

Summary

  • Skip the boxplot stat's internal "type" aesthetic when building Vega-Lite encoding channels — it's structural (consumed during data preparation), not a visual channel.
  • Strip the y2 encoding on whisker/box layers down to just {"field": ...} — secondary position channels don't accept axis, scale, type, or stack.
  • Add a schema-validated boxplot test (the existing test_geom_boxplot only checked \!json.is_empty()).

Closes #448

Test plan

  • New test_boxplot_schema_validation validates output against VL v6 JSON Schema
  • All 22 boxplot tests pass
  • Full workspace test suite passes (4 pre-existing spatial failures from network issues only)

Skip the boxplot stat's internal "type" aesthetic when building
Vega-Lite encoding channels and strip the y2 encoding on whisker/box
layers down to just the field reference. Add a schema-validated
boxplot test.

Closes posit-dev#448
@thomasp85 thomasp85 requested a review from teunbrand May 18, 2026 18:24
Copy link
Copy Markdown
Collaborator

@teunbrand teunbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@teunbrand teunbrand merged commit 400009d into posit-dev:main May 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Boxplot produces invalid Vega-Lite: type encoding channel leaks into output

2 participants