R/get_d3_colourScale.R
get_d3_colourScale.Rd
This function converts a named vector with colors as the values to a format that can be passed to the colourScale =
.
get_d3_colourScale(namedvector)
a named character vector where the names are the levels and the values are the respective colors
a string
get_d3_colourScale(c("A" = "blue", "B" = "red"))
#> [1] "d3.scaleOrdinal() .domain([\"A\", \"B\"]) .range([\"blue\", \"red\"])"
# also see here: https://github.com/fbreitwieser/sankeyD3/issues/20#issuecomment-999624150