fix: multi-line facet panel strip labels for facet_grid and facet_wrap (#262) - #339
fix: multi-line facet panel strip labels for facet_grid and facet_wrap (#262)#339ANAMASGARD wants to merge 7 commits into
Conversation
Join multi-variable facet labels with newlines in R and render each line as an SVG tspan in draw_strip. Reuse build_strip for facet_wrap labelling. Update strip layout measurement and legacy wrap test.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #339 +/- ##
==========================================
+ Coverage 73.03% 73.07% +0.04%
==========================================
Files 164 164
Lines 8840 8887 +47
==========================================
+ Hits 6456 6494 +38
- Misses 2384 2393 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
thanks, can you please post a screenshot using the new code? |
|
Sir @tdhock I have posted screenshot using new code, please also review all the PR's I have raised (when you get time ) they all need review once done I can move forward , Thanks .
|
|
thanks. can you please revise so that the multi-line facet title does not go into the plotting area? (the height / width of the plotting area size needs to be a function of how many lines in the title) |
|
Sir @tdhock Follow-up on your overlap comment I have added geometry tests and fixed strip placement so multi-line titles stay in the strip band, not on the plot. CI was red on the test-only commit (expected), then green after the fix. |
|
please resolve conflict and post a new screenshot? |

Fixes #262 — animint2 currently joins multi-variable facet strip labels onto one line (

cyl: 4; am: 0). This PR makes them render on separate lines like ggplot2 does.Root cause
facet_gridR/z_facets.Rbuild_strip()"; "facet_wrapR/z_facets.RgetStrips.wrap()", "draw_strip()inanimint.jsrenders one flat<text>node — no<tspan>support today.Two-commit structure
Commit 1 (this commit) - failing test only
test-renderer1-facet-multiline.R<tspan>elements across 6 panels × 2 variables for bothfacet_gridandfacet_wraplength(labels) == 0(no tspans exist yet)Commit 2 — implementation
R/z_facets.R: changecollapse = "; "/", "->collapse = "\n"inst/htmljs/animint.js: split on\n, render each line as<tspan>