Conversation
Introduce discrete arrow palette and rendering for swim arrows: add pal_arrows(), draw_key_swim_arrow(), scale_arrow_discrete() and format.swim_arrow(), and extend GeomSwimArrow to support per-row arrow aesthetics (colour, fill, type) and custom arrow heads. Update NAMESPACE to export the new S3 method and scale, bump RoxygenNote to 7.3.3, and adjust documentation (show.legend behavior, ggplot2 references, and scale_marker_discrete docs) to reflect the new features and legend semantics.
Introduce discrete arrow scale and defaults, and refactor arrow handling in geom_swim_arrow. - Add scale_arrow_discrete() and related defaults (.default_arrow_colours, .default_arrow_fills, .default_arrow_types, .default_arrow_limits) in R/scale_arrow.R and export them via NAMESPACE; include generated Rd docs. - Update pal_arrows to use the new default arrow values when arguments are omitted. - Move format.swim_arrow implementation into the new file. - Fix draw_key_swim_arrow fill fallback and mark it internal, adding @Keywords internal. - Add extract_arrow_aesthetics() helper to centralize extraction of arrow fields and simplify GeomSwimArrow$draw_panel: use the helper, enforce a single arrow type per layer, and ensure proper fill/colour handling. These changes enable a reusable scale for arrow aesthetics, consolidate defaults, and simplify arrow aesthetic extraction and rendering.
Lots of edits and updates!
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.
Description
This PR introduces a number of changes listed below. In summary, users now have the ability to add arrows to the ggswim legend to clarify what they mean.
Proposed Changes
List changes below in bullet format:
geom_swim_arrow():pal_arrows()internal function addeddraw_key_swim_arrow()definedextract_arrow_aesthetics()convenience function addedscale_arrow_discrete()added to align withscale_marker_discrete()scale_arrow_discrete()Screenshots
If applicable, add screenshots to help explain the proposed changes
Issue Addressed
Closes #67
PR Checklist
Before submitting this PR, please check and verify below that the submission meets the below criteria:
.RDS) updated underinst/testdata/create_test_data.Rusethis::use_version()Code Review
This section to be used by the reviewer and developers during Code Review after PR submission
Code Review Checklist