@@ -668,11 +668,9 @@ gg2list <- function(p, width = NULL, height = NULL,
668
668
" \\ *\\ s+degree[ ]?[\\ *]?" , " °" ,
669
669
gsub(" \" " , " " , tickData [[" degree_label" ]])
670
670
)
671
- # Downstream logic expects the 'break positions' to be on 0-1 scale
671
+ # Downstream logic expects these 'break positions' to be on 0-1 scale
672
672
# (which is then rescaled back to the data scale)
673
- rng [[paste0(xy , " .major" )]] <- scales :: rescale(
674
- tickData [[paste0(xy , " _start" )]]
675
- )
673
+ rng [[paste0(xy , " .major" )]] <- scales :: rescale(tickData [[paste0(xy , " _start" )]])
676
674
677
675
# If it doesn't already exist (for this panel),
678
676
# generate graticule (as done in, CoordSf$render_bg)
@@ -787,9 +785,11 @@ gg2list <- function(p, width = NULL, height = NULL,
787
785
# set scaleanchor/scaleratio if these are fixed coordinates
788
786
# the logic here is similar to what p$coordinates$aspect() does,
789
787
# but the ratio is scaled to the data range by plotly.js
790
- fixed_coords <- c(" CoordSf" , " CoordFixed" , " CoordMap" , " CoordQuickmap" )
791
- is_fixed <- isFALSE(p $ coordinates $ is_free())
792
- if (inherits(p $ coordinates , fixed_coords ) || is_fixed ) {
788
+ is_fixed <- inherits(
789
+ p $ coordinates ,
790
+ c(" CoordSf" , " CoordFixed" , " CoordMap" , " CoordQuickmap" )
791
+ )
792
+ if (is_fixed || isFALSE(p $ coordinates $ is_free())) {
793
793
axisObj $ scaleanchor <- anchor
794
794
ratio <- p $ coordinates $ ratio %|| % 1
795
795
axisObj $ scaleratio <- if (xy == " y" ) ratio else 1 / ratio
0 commit comments