0

On this page, I found an interesting plot:

enter image description here

Is it possible to do something similar or exactly? (Combination between treemap and ggraph library).

cdcarrion
  • 574
  • 6
  • 22

1 Answers1

0

You can get a similar appearance with the voronoiTreemap package:

library(voronoiTreemap)

vor <- data.frame(h1 = 'World', 
                  h2 = c('Europe', 'Europe', "Europe",
                         'America', 'America', 'America', 'America',
                         'Asia', 'Asia', 'Asia', 'Asia', 'Asia', 'Asia',
                         'Africa', 'Africa', 'Africa'),
                  h3 = c("UK", "France", "Germany",
                         "USA", "Mexico", "Canada", "Brazil",
                         "China", "India", "S Korea", "Japan", "Thailand",
                         "Malaysia", "Egypt", "South Africa", "Nigeria"),
                  color = rep(c("pink", "steelblue", "#96f8A0", "yellow"),
                              times = c(3, 4, 6, 3)),
                  weight = c(12, 10, 15, 40, 5, 7, 9, 45, 30, 20, 20, 6, 9,
                             8, 10, 5),
                  codes = c("UK", "France", "Germany",
                            "USA", "Mexico", "Canada", "Brazil",
                            "China", "India", "S Korea", "Japan", "Thailand",
                            "Malaysia", "Egypt", "South Africa", "Nigeria"))

vt <- vt_input_from_df(vor)

vt_d3(vt_export_json(vt))

enter image description here

Allan Cameron
  • 147,086
  • 7
  • 49
  • 87