0

Im trying to create a packing circle graph using the R package circlepacker. So far I haven't got any problems creating the graph but I would like to add all labels to be visible before clicking on each group.

For reference this is the tibble I'm using, the 10 most commun surnames in Spain. The objetive is to divide each surname by their fist letter according to the number of people with each first surname.

surnames

  Surname     Frist   Second Both  pathString            Letter
   <chr>       <dbl>   <dbl> <dbl> <chr>                 <chr>
 1 GARCIA    1455085 1474331 77030 Apellidos/G/GARCIA    G    
 2 RODRIGUEZ  927670  937892 41849 Apellidos/R/RODRIGUEZ R    
 3 GONZALEZ   924321  933269 40203 Apellidos/G/GONZALEZ  G    
 4 FERNANDEZ  905914  916827 49866 Apellidos/F/FERNANDEZ F    
 5 LOPEZ      868164  876446 33508 Apellidos/L/LOPEZ     L    
 6 MARTINEZ   830245  837004 37748 Apellidos/M/MARTINEZ  M    
 7 SANCHEZ    815181  825024 33504 Apellidos/S/SANCHEZ   S    
 8 PEREZ      776532  789741 25567 Apellidos/P/PEREZ     P    
 9 GOMEZ      491345  495202 13399 Apellidos/G/GOMEZ     G    
10 MARTIN     482916  481168 20294 Apellidos/M/MARTIN    M

This code works as expected.

population <- as.Node(surnames)
g <- circlepackeR(population,
             size = "Primero",
             color_min = "hsl(56,80%,80%)",
             color_max = "hsl(341,30%,40%)",
             width = 800,
             height = 800)
g
renderCirclepackeR(g, env = parent.frame(), quoted = F)
saveWidget(g, file="Paco.html")

The resulting widget works fine and I can save the overall image. enter image description here

However, I would like that all labels be visible before clicking on each circle in the widget and on the image. Any sugestions?

I've look everywhere to add the labels but don't know how.

Quinten
  • 35,235
  • 5
  • 20
  • 53

0 Answers0