Skip to content

Conversation

@ANAMASGARD
Copy link
Contributor

@ANAMASGARD ANAMASGARD commented Jan 4, 2026

Summary

Adds comprehensive regression tests for issue #279 to prevent reoccurrence of excessive spacing below facet_wrap plots when using custom height parameters.

Background

Issue #279 reported that when using facet_wrap() with a custom height parameter (different from the default 400px), excessive vertical spacing appeared below the faceted plots. The spacing did not scale proportionally with the custom height.

After thorough investigation and testing with version 2025.12.4, this issue appears to be resolved. These tests ensure it doesn't regress in future updates.

Changes

  • Added test-issue-279-facet-wrap-custom-height-spacing.R
  • 3 comprehensive test cases with 16 assertions
  • Tests cover:
    • Vertical facet layout (ncol=1) with 2x and 3x custom heights (800, 1200)
    • Grid layout (2×2, ncol=2) with 1.5x custom height (600)
    • Multiple height values (400, 600, 800, 1000, 1200) to verify proportionality

What the Tests Verify

The key verification is that height_proportion values remain identical across all custom heights:

  1. Custom height parameters are correctly stored in plot.json
  2. Panel layout structure (ROW/COL) remains consistent
  3. height_proportion values are identical regardless of custom height
    • These values control relative spacing between facets
    • If excessive spacing existed, these would differ with custom heights
    • Consistent proportions = correct proportional scaling ✓

Testing

  • All tests pass on current main branch :-
new-279

   Adds comprehensive test cases to verify that facet_wrap spacing
   scales proportionally with custom height parameter.

   Tests cover:
   - Vertical facet layout (ncol=1) with 2x and 3x custom heights
   - 2x2 grid layout with 1.5x custom height
   - Multiple height values to verify proportionality

   This ensures issue #279 (excessive spacing below facets) does not regress.

   All tests pass (16 assertions).

   Refs #279
@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.68%. Comparing base (68b074e) to head (e2211ad).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
+ Coverage   73.06%   77.68%   +4.62%     
==========================================
  Files         164      164              
  Lines        8758     8758              
  Branches        0      554     +554     
==========================================
+ Hits         6399     6804     +405     
+ Misses       2359     1954     -405     
Flag Coverage Δ
javascript 95.46% <ø> (+14.70%) ⬆️
r 69.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants