Skip to contents

This helper returns a named list describing how to draw the connecting segment between two x positions. It intentionally uses the same output shape as style_segment_alpha_gradient() so plotting code can treat both styles uniformly.

Usage

style_segment(alpha, n = 300)

Arguments

alpha

Segment alpha (opacity) as a single numeric value between 0 and 1.

n

Number of interpolation points when using ggforce::geom_link().

Value

A named list with elements alpha_1, alpha_2, gamma, n.

Examples

# Constant-alpha segment
style_segment(alpha = 0.25)
#> $alpha_1
#> [1] 0.25
#> 
#> $alpha_2
#> [1] 0.25
#> 
#> $gamma
#> [1] 1
#> 
#> $n
#> [1] 300
#>