Skip to content

feat: register_pattern() and friends (#108) - #109

Merged
trevorld merged 2 commits into
mainfrom
register-pattern
Oct 9, 2026
Merged

trevorld merged 2 commits into
mainfrom
register-pattern

Conversation

@trevorld

@trevorld trevorld commented Oct 9, 2026

Copy link
Copy Markdown
Owner
  • register_pattern() / unregister_pattern() register patterns owned by
    the calling package (or the user) instead of setting the
    ggpattern_geometry_funcs / ggpattern_array_funcs global options.
    Its defaults argument sets pattern-specific default parameter values,
    which the builtin patterns now use.
  • Patterns may be referred to by qualified names e.g. "gridpattern::stripe".
  • prefer_pattern() / unprefer_pattern() resolve name conflicts
    and conflicting_patterns() lists them.
  • registered_patterns(), has_pattern(), and local_pattern().
  • patternGrob() caches the pattern resolved at creation so redraws
    still work if the pattern is later unregistered or masked.
  • Tests no longer leave a locked default graphics device open.

closes #108

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

trevorld and others added 2 commits October 9, 2026 14:07
* `register_pattern()` / `unregister_pattern()` register patterns owned by
  the calling package (or the user) instead of setting the
  `ggpattern_geometry_funcs` / `ggpattern_array_funcs` global options.
  Its `defaults` argument sets pattern-specific default parameter values,
  which the builtin patterns now use.
* Patterns may be referred to by qualified names e.g. `"gridpattern::stripe"`.
* `prefer_pattern()` / `unprefer_pattern()` resolve name conflicts
  and `conflicting_patterns()` lists them.
* `registered_patterns()`, `has_pattern()`, and `local_pattern()`.
* `patternGrob()` caches the pattern resolved at creation so redraws
  still work if the pattern is later unregistered or masked.
* Tests no longer leave a locked default graphics device open.

closes #108

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trevorld
trevorld merged commit c2dbf16 into main Oct 9, 2026
4 checks passed
@trevorld
trevorld deleted the register-pattern branch October 9, 2026 22:12
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.

Feature: more robust registration of custom patterns (e.g. register_pattern())

1 participant