Skip to content

Migrate label geoms to the ggfittext fit_text_grob() constructor #108

Description

@wilkox

Goal

Migrate the label geoms off ggfittext's private grob internals onto its
public fit_text_grob() constructor (exported in ggfittext 0.11.0 —
wilkox/ggfittext#70).

Why this is a gate, not just cleanup

gggenes currently hand-rolls ggfittext's private grob. In R/compose_grob.R
the text branch constructs the ggfittext gTree directly:

grid::gTree(..., cl = "fittexttree")        # cartesian / flip
grid::gTree(..., cl = "fittexttreepolar")   # polar

This reaches into exactly the private contract that ggfittext 0.12.0 will
change
(0.12.0 carries the coord_radial() polar-label fix and, per its
milestone, "changes the (private) linear gTree contract, so lands after the
downstream-migration gate"). ggfittext 0.11.0 exists specifically as that gate:
downstream packages migrate onto fit_text_grob() before the internals move.

Consequently gggenes must migrate to fit_text_grob() before it can adopt
ggfittext 0.12.0 — i.e. before coord_radial() (#96) can be finalised.
Skipping this would mean the ggfittext bump that unblocks coord_radial
simultaneously breaks existing label rendering.

Scope

  • Replace both hand-rolled gTree constructions in R/compose_grob.R (the
    fittexttree and fittexttreepolar cases) with ggfittext::fit_text_grob().
  • Bump DESCRIPTION to Imports: ggfittext (>= 0.11.0) (coordinate with the
    ggplot2 floor review, Review and rationalise the declared ggplot2 version floor (DESCRIPTION says >= 2.2.1) #107).
  • Verify label rendering is unchanged (regenerate/inspect the vdiffr snapshots
    for every *_label geom across all coordinate systems).
  • Confirm the new build/draw smoke tests still pass.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions