feat: allow directional autosize fit with top-level size in eligible composed views#9769
Open
feat: allow directional autosize fit with top-level size in eligible composed views#9769
Conversation
fit-* to be used on opposite dimensions for view compositions (facet, repeat, concat)fit-* to be used on opposite dimensions for view compositions (facet, repeat, concat)
f5955ac to
2bd3cfc
Compare
Deploying vega-lite with
|
| Latest commit: |
2bd3cfc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ff92a493.vega-lite.pages.dev |
| Branch Preview URL: | https://fix-composed-fit-size-compat.vega-lite.pages.dev |
fit-* to be used on opposite dimensions for view compositions (facet, repeat, concat)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enables directional autosize fit (
fit-x/fit-y) with top-levelwidth/heightin composedVega-Lite specs where layout semantics make this valid.
Specifically:
vconcat/ one-column concat: allowfit-x+ top-levelwidthhconcat/ one-row concat: allowfit-y+ top-levelheightfit-x+ top-levelwidthfit-y+ top-levelheightIt also fixes size-signal propagation for these cases so compiled Vega actually binds child layout size to
the top-level fit dimension.
What changed
Spec + schema
concat,facet,repeat) so top-levelwidth/heightis accepted.
vega-lite-schema.json.Normalization / fit compatibility
Compile / layout-size propagation
children.length === columns) sofit-yworks forrepeat-column-like structures.
width/heightin compiled output where needed.Docs + examples
docs/view/size.mdto remove outdated limitation language and document directional composed-fitbehavior.
Tests
Validation
Ran full test suite locally:
vitest run test/npm run lintnpm run schemavitest run examples/npm run test:runtimeAll passing (runtime includes expected skipped animation test).