Skip to content

feat: allow directional autosize fit with top-level size in eligible composed views#9769

Open
willium wants to merge 2 commits intomainfrom
fix-composed-fit-size-compat
Open

feat: allow directional autosize fit with top-level size in eligible composed views#9769
willium wants to merge 2 commits intomainfrom
fix-composed-fit-size-compat

Conversation

@willium
Copy link
Copy Markdown
Member

@willium willium commented Feb 25, 2026

Summary

This PR enables directional autosize fit (fit-x / fit-y) with top-level width / height in composed
Vega-Lite specs where layout semantics make this valid.

Specifically:

  • vconcat / one-column concat: allow fit-x + top-level width
  • hconcat / one-row concat: allow fit-y + top-level height
  • row facet: allow fit-x + top-level width
  • column facet: allow fit-y + top-level height
  • repeat row/column: supported via normalized concat equivalents

It 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

    • Include layout size mixins on composed specs (concat, facet, repeat) so top-level width/height
      is accepted.
    • Regenerate vega-lite-schema.json.
  • Normalization / fit compatibility

    • Extend fit compatibility logic beyond unit/layer for directional composed cases.
    • Keep warnings for incompatible container-size + autosize combinations.
  • Compile / layout-size propagation

    • Ensure composed models propagate parent-given size correctly.
    • Merge layout size for single-row wrapped concat (children.length === columns) so fit-y works for
      repeat-column-like structures.
    • Preserve explicit top-level numeric width/height in compiled output where needed.
  • Docs + examples

    • Update docs/view/size.md to remove outdated limitation language and document directional composed-fit
      behavior.
    • Add new examples for vconcat/hconcat/facet/repeat directional fit cases.
    • Regenerate normalized specs and compiled Vega/PNG/SVG outputs.
  • Tests

    • Add and update compile/layout-size tests for supported and unsupported directional-fit scenarios.
    • Add regression coverage for single-row wrapped concat height merge.
    • Update runtime snapshots impacted by expected composed layout changes.

Validation

Ran full test suite locally:

  • vitest run test/
  • npm run lint
  • npm run schema
  • vitest run examples/
  • npm run test:runtime

All passing (runtime includes expected skipped animation test).

@willium willium requested a review from a team as a code owner February 25, 2026 01:05
@willium willium changed the title All for fit-* to be used on opposite dimensions for view compositions (facet, repeat, concat) Allow for fit-* to be used on opposite dimensions for view compositions (facet, repeat, concat) Feb 25, 2026
@willium willium force-pushed the fix-composed-fit-size-compat branch from f5955ac to 2bd3cfc Compare February 25, 2026 01:48
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 25, 2026

Deploying vega-lite with  Cloudflare Pages  Cloudflare Pages

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

View logs

@willium willium changed the title Allow for fit-* to be used on opposite dimensions for view compositions (facet, repeat, concat) feat: allow directional autosize fit with top-level size in eligible composed views Feb 25, 2026
@willium willium changed the title feat: allow directional autosize fit with top-level size in eligible composed views feat: allow directional autosize fit with top-level size in eligible composed views Feb 25, 2026
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.

1 participant