annotation_raster()/_custom()
respond to scale transformations
#6182
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.
This PR aims to fix #3120 and is incompatible with #3121.
Briefly, it uses the panel parameters to transform the corners of the rectangle used for annotation placement.
To recap some discussion in #3121. The scales should affect the annotation, but not vice versa (i.e., we don't want to train scales on annotations) #3121 (comment). The approach of encoding the corners coordinates as aesthetics did affect the scales, so that approach was unsuitable. Instead it was proposed to keep them as parameters and transform them in the drawing stage #3121 (comment). In addition, it was proposed to have data agnostic placement as well #3121 (comment). #3121 was waiting for #3116 to get implemented, but as this hasn't happened in 5 years, I felt it was time to forge ahead.
This PR implements transformed parameters, so scales are not trained by annotations. In addition, the
I()
mechanism (#5477) is used for data agnostic placement of annotations.Some examples; plain annotation:
Reversed x:
AsIs coordinates:
Created on 2024-11-12 with reprex v2.1.1