Fix/252 polygon holes subgroup#326
Conversation
Refactor polygon rendering to use d3.nest for subgroup aesthetics and GeoJSON with evenodd fill rule.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #326 +/- ##
==========================================
- Coverage 73.01% 69.13% -3.89%
==========================================
Files 164 163 -1
Lines 8835 6000 -2835
==========================================
- Hits 6451 4148 -2303
+ Misses 2384 1852 -532
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tdhock
left a comment
There was a problem hiding this comment.
can you also please post screenshots of the test cases?
| path.list <- getNodeSet(html, '//g[contains(@class,"geom")]//path') | ||
| expect_true(length(path.list) >= 1) | ||
| d.vals <- sapply(path.list, function(node) xmlGetAttr(node, "d")) | ||
| expect_true( |
There was a problem hiding this comment.
can you please avoid expect_true, and use expect_ something more specific like equal?
|
|
I tried this small-scale real data application, https://github.com/tdhock/hicream-viz/blob/main/data-2025-10-09/figure-pixels-chr1-Cluster73-fix.R and this PR works!
top: this PR. |
|
here is a rendered animint using this PR https://tdhock.github.io/2026-05-22-HiC-pixels-chr1-Cluster73-subgroup/ and the same animint which does not render correctly using current master https://tdhock.github.io/2026-05-22-HiC-pixels-chr1-Cluster73-bad/ this is evidence of a successful implementation, great work, thanks very much Nishita! |
|
currently there is only one clickID in tests. are these tests strong enough to fail on current master? the issue #252 had a screenshot of master drawing the test case like this: |
| library(testthat) | ||
| library(animint2) | ||
| library(XML) | ||
| context("Polygon holes via subgroup aesthetic") | ||
| tests_init() |
There was a problem hiding this comment.
please delete all this from test files
| ## hole_and_mid: outer ring + hole + island (3 subgroups) | ||
| ## only_hole: outer ring + hole (2 subgroups) | ||
| ## no_hole: outer ring only (1 subgroup) | ||
| make.full.data <- function(){ |
There was a problem hiding this comment.
it is not necessary (and potentially confusing) to create a function if you only call it once.
| 0,1,0,0,1,0, | ||
| 0,1,1,1,1,0, | ||
| 0,0,0,0,0,0), 6, 6, byrow=TRUE) | ||
| res <- isoband::isobands( |
There was a problem hiding this comment.
we should use contourLines() instead of isobands() so we can avoid adding a dependency.
yes, we can do that. I'll add some more tests. |
Thank you @tdhock , I surely update the tests based on the feedbacks and correct the naming of the tests. |
|
actually can you please just close this PR and port your new JS code to #328 ? |
|
please do keep those review comments in mind for future PRs though. |








Closes #252
creating pr from branch instead of from fork