Hi Nir,
I just notified one thing.
dt1 <- data.frame(
topic = c("", "" , "", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve"),
subtopic = c("Eve", "Seth", "Awan" , "b", "c", "sb", "x", "y","tr"),
n = c(23, 10, 14, 1, 12, 2, 6, 6, 4), new = c(12,21,12,2,1,2,1,3,4),
color_code = c("#004E42", "#007763", "#00997C","","","","","","")
)
If you look here. Eve is 23, and its sub topic values are sum to 23. But in the plots the entire box is not covering up. I referred the documentation but did not get. Sample code below
library(plotly)
dt1 <- data.frame(
topic = c("", "" , "", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve"),
subtopic = c("Eve", "Seth", "Awan" , "b", "c", "sb", "x", "y","tr"),
n = c(23, 10, 14, 1, 12, 2, 6, 6, 4), new = c(12,21,12,2,1,2,1,3,4),
color_code = c("#004E42", "#007763", "#00997C","","","","","","")
)
p <- plot_ly(
dt1,
type='treemap',
labels=~subtopic,
parents=~topic,
values= ~n,
# text = paste0(dt1$new),
marker=list(colors=dt1$color_code)
)
p