fix: multi-line facet panel strip labels for facet_grid and facet_wrap (#262)#339
Open
ANAMASGARD wants to merge 3 commits into
Open
fix: multi-line facet panel strip labels for facet_grid and facet_wrap (#262)#339ANAMASGARD wants to merge 3 commits into
ANAMASGARD wants to merge 3 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.02% 73.01% -0.02%
==========================================
Files 164 164
Lines 8837 8870 +33
==========================================
+ Hits 6453 6476 +23
- Misses 2384 2394 +10
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:
|
Collaborator
|
thanks, can you please post a screenshot using the new code? |
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.
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>