I'm having issues doing a treemap with plotly in R. This is my data :
structure(list(items = c("Actifs", "Inactifs", "En emploi", "Chômeurs",
"Halo du chômage", "Hors halo du chômage", "Recherche un emploi sans être disponible",
"Ne recherche pas d'emploi mais est disponible", "Ne recherche pas d'emploi et n'est pas disponible"
), parents = c("", "", "Actifs", "Actifs", "Inactifs", "Inactifs",
"Halo du chômage", "Halo du chômage", "Halo du chômage"), size = c("60",
"40", "40", "20", "10", "30", "2", "5", "3")), row.names = c(NA,
-9L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: 0x000002129c6c1ef0>)
This is my code :
g4EMP <- plot_ly(
data = data,
type = "treemap",
labels = ~items,
values = ~size,
parents = ~parents)
As the items added are 100% of their parents, I don't understand why it's not using the full parent's square. Per example 'En emploi' + 'Chômeurs' = 'Actifs'. Both squares of the item 'Actifs' are using the full length but not the full width. For the item 'Inactif' the behaviour is reversed : squares takes the full width but not the full length.
How can I make the treemap squares use the full space ?
Thanks a lot in advance.