Creates ggplot2 theme arguments for axis borders and lines based on user inputs. This function handles axis styling through ggplot2 themes rather than plotly overlays, which provides better control especially when faceting is used.
Details
When faceting is enabled, panel borders are always shown for the full plot. When faceting is disabled:
If both axis.showline and axis.mirror are TRUE: Full panel border
If only axis.showline is TRUE: Axis lines on x and y axes only
Otherwise: No borders
Examples
input <- list(
axis.showline = TRUE, axis.mirror = TRUE,
axis.linecolor = "black", axis.linewidth = 1
)
create_ggplot_axis_style(input, isolate_fn = identity)
#> $panel.border
#> <ggplot2::element_rect>
#> @ fill : logi NA
#> @ colour : chr "black"
#> @ linewidth : num 1
#> @ linetype : NULL
#> @ linejoin : NULL
#> @ inherit.blank: logi FALSE
#>
#> $axis.line
#> <ggplot2::element_blank>
#>
#> $axis.ticks
#> <ggplot2::element_blank>
#>