Skip to contents

Return a list of color breaks for Higchart maps

Usage

gtl_hc_color_axis(breaks, palette)

Arguments

breaks

The data with the breaks (using chopped data with santoku::santoku)

palette

A color palette that can take a numeric argument

Value

A list of lists to use in colorAxis' dataClasses argument

Examples

data <- seq(1, 20)
data_cut <- santoku::chop(data, breaks = c(5,10,15))
gtl_hc_color_axis(data_cut, rainbow)
#> [[1]]
#> [[1]]$color
#> [1] "#FF0000"
#> 
#> [[1]]$from
#> [1] "1"
#> 
#> [[1]]$to
#> [1] "5"
#> 
#> 
#> [[2]]
#> [[2]]$color
#> [1] "#80FF00"
#> 
#> [[2]]$from
#> [1] "5"
#> 
#> [[2]]$to
#> [1] "10"
#> 
#> 
#> [[3]]
#> [[3]]$color
#> [1] "#00FFFF"
#> 
#> [[3]]$from
#> [1] "10"
#> 
#> [[3]]$to
#> [1] "15"
#> 
#> 
#> [[4]]
#> [[4]]$color
#> [1] "#8000FF"
#> 
#> [[4]]$from
#> [1] "15"
#> 
#> [[4]]$to
#> [1] "20"
#> 
#>