Repository navigation
Fix/g forest header row alignment - #1546
Open
gwangjinkim wants to merge 2 commits into
Open
gwangjinkim wants to merge 2 commits into
gwangjinkim wants to merge 2 commits into
Conversation
…verse#1543) The forest plot row positions subtracted a fixed offset that was only correct for a two-row table header, and the table's y-axis expansion was removed only in that case. Body row i is now always placed at `nrows_body - i + 1` and the y-axis expansion is removed unconditionally, so rows line up for any header height. Adds a snapshot-free regression test comparing the y positions of table rows and forest points for 1-, 2- and 3-row headers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu112DJEVzgWdVGVuiYj7x
…n agnostic Update the 19 g_forest snapshots for one-row-header tables: with the alignment fix only the y coordinates of the table text change (regenerated with Arial, the font the committed snapshots use). The forest_grob()/forest_viewport() tests nested a fixed number of expect_deprecated() calls, which breaks when the installed lifecycle version deduplicates repeated warnings from internal helpers. Collect all deprecation warnings instead and assert on the function under test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu112DJEVzgWdVGVuiYj7x
This branch has not been deployed
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.
Pull Request
Fixes #1543
Cause
g_forest()only handled a two-row table header correctly:as.numeric(nlines_hdr == 2), so a 3-row header shifted the points up by two rows.nlines_hdr == 2, so a 1-row header drifted slightly against the plot.Changes
R/g_forest.R: body rowiis now always drawn atnrows_body - i + 1, independent of the header height. The table's y-axis expansion is applied unconditionally.main, passes with the fix). Theforest_grob()/forest_viewport()deprecation tests now use acollect_deprecations()helper, because newerlifecycleversions deduplicate repeated warnings.g_forestsnapshots for one-row-header tables. Only the y coordinates of the table text change.Testing
test-g_forest.Rpasses (19/19, no warnings) with Arial installed and a UTF-8 locale.Note: with current
svglite(2.2.2) and this font setup, 25 graphics snapshot tests in other files fail identically on an unmodifiedmain. They are unrelated to this PR and are not touched here.