grantmcdermott · GitHub

Merged

Merged

Conversation

@grantmcdermott

Pull request overview

This PR implements “smart” xlim/ylim override forms in tinyplot, adding support for scalar coverage (ensure a value is included), partial-NA limit pinning, and a "rev(erse)" keyword to reverse automatically computed axis limits (Fixes #616).

Changes:

  • Extend xlim/ylim parsing to support scalar inputs, length-2 partial NA, and "rev(erse)" keyword reversal.
  • Plumb new rev_x/rev_y flags through settings, limit computation, flip handling, and facet drawing (including free-scale facets).
  • Add snapshot tests and documentation/NEWS updates describing the new limit behaviors.

Reviewed changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
R/zzz.R Registers new rev_x/rev_y globals to satisfy R CMD check.
R/tinyplot.R Adds docs for new xlim/ylim forms; resolves "rev(erse)" into rev_x/rev_y settings.
R/lim.R Adds resolve_lim() and applies smart limit resolution; reverses finalized limits based on rev_x/rev_y.
R/flip.R Ensures rev_x/rev_y are swapped when flipping axes.
R/facet.R Threads rev_x/rev_y into facet window drawing; attempts to support reversed axes under free facets.
NEWS.md Documents the new “smart” x/ylim override forms.
man/tinyplot.Rd Updates rendered documentation for new xlim/ylim behaviors.
man/facet.Rd Documents new internal rev_x/rev_y parameters for draw_facet_window().
inst/tinytest/test-lim.R Adds snapshot tests covering scalar coverage, partial-NA pinning, and "reverse" (incl. free facets).
inst/tinytest/_tinysnapshot/lim_scalar_zero.svg New snapshot output for scalar coverage test.
inst/tinytest/_tinysnapshot/lim_reverse.svg New snapshot output for reverse keyword test.
inst/tinytest/_tinysnapshot/lim_reverse_free_facet.svg New snapshot output for reverse keyword with free facets.
inst/tinytest/_tinysnapshot/lim_partial_na.svg New snapshot output for partial-NA pinning test.
Files not reviewed (2)
  • man/facet.Rd: Generated file
  • man/tinyplot.Rd: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@grantmcdermott

@grantmcdermott

Open

Labels

None yet

Read the original on github.com ↗