Skip to content

fix: size and center quadrants using individual item bounds - #268

Open
WhyTan00 wants to merge 1 commit into
antvis:mainfrom
WhyTan00:fix/quadrant-variable-item-bounds
Open

WhyTan00 wants to merge 1 commit into
antvis:mainfrom
WhyTan00:fix/quadrant-variable-item-bounds

Conversation

@WhyTan00

Copy link
Copy Markdown

Summary

Quadrant layouts currently measure only the first item and use that size to position all four items. Different content or orientation-dependent item dimensions can overflow their quadrant or be centered incorrectly.

Measure the first four items with the same orientation props used for rendering, size default quadrants from their largest dimensions, and center each item using its own bounds. Explicit quadrant dimensions and empty-data behavior are preserved.

Related to #260 (quadrant layout portion). This complements #264, which changes list-grid. It does not address fixed-height item text, fixed-size cards, or pie-label collisions, so it should not close the broader issue.

Validation

  • Four new layout cases fail on the original implementation; six new cases pass after the fix.
  • Full unit suite: 92 files / 769 tests passed.
  • Source typecheck, test typecheck, targeted ESLint and formatting pass.
  • Full package build (ESM, CJS, UMD and size checks) passes.
  • Tests render synthetic SVG items and check their bounds and centers; no browser visual acceptance is claimed.

The test fixture type annotations were corrected after the full suite, then test typecheck and lint were rerun. No generated build output or dependencies are included.

Implementation and regression tests assisted by OpenAI Codex.

This branch has not been deployed

No deployments
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