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 4 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 69.14% 73.01% +3.87%
==========================================
Files 163 164 +1
Lines 6002 8873 +2871
==========================================
+ Hits 4150 6479 +2329
- Misses 1852 2394 +542
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) |

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>