Repository navigation
Release ssdtools 2.7.0, removing the ggtext dependency - #483
Merged
Merged
Conversation
fledge derived the entry from merge-commit subjects because the PR lookups 404'd: this repo is a fork of bcgov/ssdtools and the merge commits reference upstream PR numbers (bcgov#472, bcgov#478, bcgov#480, bcgov#481) that do not exist in poissonconsulting/ssdtools. That left four raw 'Merge pull request' bullets plus a duplicate of the 2.6.0.9002 entry. Replaced with the user-facing changes since v2.6.0.9002.
`ssd_label_comma_hc()` now returns plotmath expressions rather than markdown, so the hazard concentration axis label is bold on its own line without `ggtext::element_markdown()`. The hazard concentration is now matched on the formatted label, which fixes the label when `big.mark` or `decimal.mark` change the formatting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaces the plotmath expression with `ssd_element_text_hc()`, which computes the fontface vector from the labels at draw time and hands it to ggplot2's own `element_text()` path. Bolding the whole label is harmless because the first line is empty, so `ssd_label_comma_hc()` only has to prefix the value with a newline. This keeps the hazard concentration label exactly where `ggtext::element_markdown()` drew it, pixel for pixel, and unlike marquee the bold renders on every device rather than only on cairo and ragg. All the margin, justification and rotation handling stays in ggplot2. 18 of the 36 plot snapshots are byte-identical to the ggtext originals; the rest differ only by a one pixel shift of the ordinary label row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Remove dependency on ggtext (bcgov#482)
The pull request was branched from main, so the bullets landed under 2.6.0.9002. The changes are in 2.6.0.9003, which restores that section to what it is on main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Move the bcgov#482 NEWS bullets to 2.6.0.9003
This was referenced Aug 30, 2026
Version bumped from 2.6.0.9003 and the four development NEWS sections consolidated into a single 2.7.0 section. CRAN submission fixes: - Drop the Remotes field. ssddata 2.0.0 is on CRAN and the 2.6.0 submission carried no Remotes field either. - Re-document with the released roxygen2 8.1.0 rather than 8.0.0.9000. NAMESPACE is unchanged. - Add the missing space in "Posthuma et al. (2001)" in Description. - Fix an http URL in vignettes/references.bib. - Rewrite cran-comments.md, which was stale at 2.3.0. NEWS now records that VGAM moved from Suggests to Imports, so fitting the Gompertz distribution no longer prompts to install it. R CMD check --as-cran is clean and revdepcheck reports 0 new problems across GenHMM1d and serocalculator. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
R-devel notes calls to structure() using deprecated special names.
win-builder flagged the zero-length list test as the only occurrence:
Found calls to structure() using deprecated special names:
ssdtools/tests/testthat/test-hc.R (.Names: 1)
'.Names' should be changed to 'names'.
structure(list(), names = character(0)) is identical() to the .Names
form, so the test is unchanged in substance.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Prepare ssdtools 2.7.0 for CRAN
aazizish
approved these changes
Aug 31, 2026
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.
Releases ssdtools 2.7.0. Closes #482.
The 2.7.0 version bump and full CRAN release prep were added in poissonconsulting#192, so this PR now carries the whole release rather than the ggtext change alone.
Why this is time sensitive
On 22 August the CRAN team gave notice that ggtext is scheduled for archival on 2026-09-12, and that archiving it would necessitate archiving its strong reverse dependencies. ssdtools 2.6.0, the version currently on CRAN, has ggtext in
Imports. So 2.7.0 needs to be accepted, not merely submitted, before that date.Removing ggtext
ggtext had a single call site,
axis.text.x = ggtext::element_markdown()inssd_plot(), needed only becausessd_label_comma_hc()emitted markdown (<br>**x**) to put the hazard concentration break on its own line in bold.ssd_label_comma_hc()now prefixes the hazard concentration label with a newline rather than marking it up as markdown.ssd_element_text_hc()is a new exported theme element that draws multi-line labels in bold.ssd_plot()uses it foraxis.text.x.Imports, with nothing added in its place.The element is fifteen lines. It receives the whole label vector at draw time, computes the fontface vector from the labels, and hands it to ggplot2's own
element_text()path, wheregparrecyclesfontfaceacross labels. Bolding the whole label is harmless because its first line is empty. All margin, justification and rotation handling stays in ggplot2.ssd_element_text_hc()is exported so that callers ofssd_label_comma_hc()in their own plots have a replacement for the roleggtext::element_markdown()played.Bug fixed along the way
ssd_label_comma_hc()compared a formatted string against a coerced number, so anybig.markordecimal.markthat altered the formatting stopped the hazard concentration from being matched, leaving it unbolded and inline. It is now formatted with the same labeller before comparison.This was visible in a checked-in snapshot:
_snaps/ssd-plot/boron_decimark.pngpreviously rendered1-26plain and inline, colliding with the neighbouring0-1label.Appearance
Measured against the previous ggtext output, in the 400x400 snapshot:
png()18 of the 36 plot snapshots are byte-identical to the ggtext originals and so do not appear in the diff: all 6
autoplot, all 10plot-cdf,match-moments/cdfandssd-plot/boron_nohc. The 18 that changed are exactly the plots carrying a hazard concentration label, and differ only by a one pixel shift of the ordinary label row.Alternatives considered
marquee was tried and rejected: it ignores
<br>, collapses single newlines and drops a leading empty paragraph, so the label collides with its neighbour unless a visible placeholder holds the first line open, and bold renders only on cairo and ragg, not on the macOS quartz device thatgrDevices::png()defaults to. Vendoring ggtext was also rejected: it delegates togridtext::richtext_grob(), so it would swap ggtext for gridtext rather than removing the dependency, and would mean copying about 157 lines including two ggplot2-private helpers plus MIT attribution into an Apache-2.0 package.Caveat
The element relies on
element_grobS3 dispatch over ggplot2's S7 element classes, the same compatibility shim ggtext itself uses. If ggplot2 removes it this breaks, but it is fifteen lines under our own control.Release prep
Version bumped to 2.7.0 and the four development NEWS sections consolidated into one. CRAN submission fixes:
Remotes: open-AIMS/ssddataRemotesfield eitherConfig/roxygen2/version: 8.0.0.9000Description:Posthuma et al.(2001)->et al. (2001)tests/testthat/test-hc.Rstructure(list(), .Names = ...)->names =. R-devel notes the deprecated special name; the two forms areidentical()vignettes/references.bibhttpURL ->httpscran-comments.mdVGAM also moved from Suggests to Imports. In 2.6.0
sgompertz()opened withrlang::check_installed("VGAM"), which prompts interactively; that guard is gone, so VGAM is now a hard dependency and fitting the Gompertz distribution no longer prompts.Checks
r90452 ucrt):Status: OK, 0 notescheck-no-suggestsR CMD check --as-cran: 0 errors, 0 warnings, 0 notesrevdepcheck::revdep_check()against CRAN 2.6.0:GenHMM1d 0.2.6andserocalculator 1.4.1both clean. 0 new problems, 0 failuresurlchecker::url_check(): all 67 URLs pass🤖 Generated with Claude Code