Skip to content

Add cell.grid to box glyphs inside light cell rectangles#100

Merged
kassambara merged 2 commits into
masterfrom
feat/cell-grid
Jul 9, 2026
Merged

Add cell.grid to box glyphs inside light cell rectangles#100
kassambara merged 2 commits into
masterfrom
feat/cell-grid

Conversation

@kassambara

@kassambara kassambara commented Jul 9, 2026

Copy link
Copy Markdown
Owner

What

New argument cell.grid (default FALSE) draws a light rectangle around every cell, behind the glyphs, and drops the through-center gridlines. Sized glyphs (method = "circle" or scale.square = TRUE) then sit inside boxed cells instead of floating on the center gridlines. The border color is set with the companion cell.grid.col (default "grey90").

ggcorrplot(corr, method = "circle", cell.grid = TRUE)
ggcorrplot(corr, scale.square = TRUE, cell.grid = TRUE, outline.color = "white")

Has no effect on a full-tile square heatmap (method = "square" without scale.square), whose tiles already carry an outline.color border, so no second box is drawn and its gridlines are left intact. In a mixed layout every region is boxed except full-tile square regions.

Non-regression

  • Both arguments default to the current behavior; every pre-existing call produces identical output.
  • Appended at the end of the signature (positional binding intact); no existing argument name is a prefix of cell.grid/cell.grid.col.

Tests

  • tests/testthat/test-cell-grid.R: layer order (background tile before the glyph), no tile and unchanged theme for full-tile squares, cell.grid.col honored, gridlines blanked only when boxes are drawn, mixed-layout boxing, and the default (cell.grid = FALSE) producing identical output.
  • One vdiffr snapshot (cell grid circle).
  • R CMD check --as-cran: 0 errors / 0 warnings / 1 NOTE (dev-version incoming-feasibility only).

New argument cell.grid (default FALSE) draws a light rectangle around every
cell behind the glyphs and drops the through-center gridlines, so sized glyphs
(method = "circle" or scale.square = TRUE) sit inside boxed cells. The border
color is set with the companion cell.grid.col (default "grey90"). Has no effect
on a full-tile square heatmap, whose tiles already carry an outline.color
border. Existing calls are byte-identical.
The gridline blanking was applied whenever cell.grid = TRUE, including for a
full-tile square heatmap where no cell box is drawn to replace the gridlines.
On a lower/upper triangle that stripped the visible gridlines in the blank half,
contradicting the documented "no effect on a full-tile square heatmap". Blank
the panel grid only when a cell box was actually drawn (tracked per layout,
since a mixed layout always boxes the diagonal). Strengthen the no-op test to
assert the theme, not only the built data, and add gridlines to WORDLIST.
@kassambara kassambara merged commit db13b35 into master Jul 9, 2026
5 checks passed
@kassambara kassambara deleted the feat/cell-grid branch July 9, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant