For the colors you can just use a colors argument like this:
library(sunburstR)
library(tidyverse)
sequences <- read.csv(system.file("examples/visit-sequences.csv",package="sunburstR"),header = FALSE,stringsAsFactors = FALSE)[1:100,]
sunburst(sequences, percent=TRUE, count=TRUE,
colors = c("#111d4a","#ffcf99","#92140c","#1e1e24", "#fff8f0", "#0b7a750"))
Output:
For the font-size, you can do this by using htmlwidgets to add JavaScript code like in this post:
library(htmlwidgets)
sun <- sunburst(sequences, percent=TRUE, count=TRUE,
colors = c("#111d4a","#ffcf99","#92140c","#1e1e24", "#fff8f0", "#0b7a750"))
htmlwidgets::onRender(
sun,
"
function(el, x) {
d3.selectAll('.sunburst-legend text').attr('font-size', '30px');
}
"
)
Output:
