Hello,
I have been trying to plot my data using sunburst in a Shiny app, however the example (below) has a manually specified structure, which is not possible for me to code as part of a shiny visualisation. I have to do it programmatically, but even using tidyr::nest does not help as it does not allow the same name to multiple hierarchies. Is there another data format that I could use.
The example is below:
df <- tibble(
name = c("earth", "mars", "venus"), value = c(30, 40, 30), # 1st level
itemStyle = tibble(color = c(NA, 'red', 'blue')), # embedded styles, optional
children = list(
tibble(name = c("land", "ocean"), value = c(10,20), # 2nd level
children = list(
tibble(name = c("forest", "river"), value = c(3,7)), # 3rd level
tibble(name = c("fish", "kelp"), value = c(10,5),
children = list(
tibble(name = c("shark", "tuna"), value = c(2,6)), # 4th level
NULL # kelp
))
)),
tibble(name = c("crater", "valley"), value = c(20,20)),
NULL # venus
)
)
for example, how would one convert the following data frame in a data structure accepted by e_sunburst programmatically?
df = data.frame(labels = c("Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"),
parents = c("", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"),
values = c(10, 14, 12, 10, 2, 6, 6, 4, 4))
This issue is as important as e_sunburst as one cannot use these great visualisations otherwise!
Hello,
I have been trying to plot my data using sunburst in a Shiny app, however the example (below) has a manually specified structure, which is not possible for me to code as part of a shiny visualisation. I have to do it programmatically, but even using tidyr::nest does not help as it does not allow the same name to multiple hierarchies. Is there another data format that I could use.
The example is below:
for example, how would one convert the following data frame in a data structure accepted by e_sunburst programmatically?
This issue is as important as e_sunburst as one cannot use these great visualisations otherwise!