Using codehover to display a map made in ggplot2

Here we use codehover to transform the following code into a html hoverable table with images bellow.

map <- ch_int(type = "incremental", div_tag_add = " class='column'") %>% 
  ch_row(text = "ggplot2::ggplot() + <br> <tab0> geom_sf(data = south_america_sf,</tab0>", img ="./IMG/1.png") %>% 
  ch_row(text = "<tab1> size = .3,</tab1>", img ="./IMG/2.png") %>% 
  ch_row(text = "<tab1> colour = 'gray30',</tab1>", img ="./IMG/3.png") %>% 
  ch_row(text = "<tab1> fill = 'gray80') +</tab1>", img ="./IMG/4.png") %>% 
  ch_row(text = "<tab0> geom_sf(data = br_sf,</tab0>", img ="./IMG/5.png") %>% 
  ch_row(text = "<tab1> aes(fill = (Diff)),</tab1>", img ="./IMG/6.png") %>% 
  ch_row(text = "<tab1> size = .3,</tab1>", img ="./IMG/7.png") %>% 
  ch_row(text = "<tab1> colour = 'black') +</tab1>", img ="./IMG/8.png") %>% 
  ch_row(text = "<tab0> coord_sf(xlim = c(-73, -35),</tab0>", img ="./IMG/9.png") %>% 
  ch_row(text = "<tab1> ylim = c(-33, 5)) + </tab1>", img ="./IMG/10.png") %>% 
  ch_row(text = "<tab0> scale_fill_steps(low = '#feebe2',</tab0>", img ="./IMG/11.png") %>% 
  ch_row(text = "<tab1> high = '#7a0177',", img ="./IMG/12.png") %>% 
  ch_row(text = "<tab1> name = 'Difference \n(white - black) \n(pp.%)') + </tab1>", img ="./IMG/13.png") %>% 
  ch_row(text = "<tab0> labs(title = 'Difference in escolarization rate betweeen black and white young \nadults in Brazilian States', </tab0>", img ="./IMG/14.png") %>% 
  ch_row(text = "<tab1> subtitle = 'In young adults (18 to 24 years old) what is the difference in the rate of formal education enrollment between black and white people?', </tab1>", img ="./IMG/15.png") %>% 
  ch_row(text = "<tab1> caption = 'Source: PNADCA 2019 - IBGE',</tab1>", img ="./IMG/16.png") %>% 
  ch_row(text = "<tab1> x = '', y = '') +</tab1>", img ="./IMG/17.png") %>%
  ch_row(text = "<tab0> ggspatial::annotation_scale(location = 'br') +</tab0>", img ="./IMG/19.png") %>%
  ch_row(text = "<tab0> ggspatial::annotation_north_arrow(location = 'br',</tab0>", img ="./IMG/20.png") %>%
  ch_row(text = "<tab1> pad_y = unit(0.3, 'in'),</tab1>", img ="./IMG/21.png") %>%
  ch_row(text = "<tab1> style = ggspatial::north_arrow_nautical())  +  </tab1>", img ="./IMG/22.png") %>%
  ch_row(text = "<tab0> annotate(geom = 'curve', x = -55, y = -20, xend = -60, yend = -20, </tab0>", img ="./IMG/23.png") %>%
  ch_row(text = "<tab1> curvature = .3, </tab1>", img ="./IMG/24.png") %>%
  ch_row(text = "<tab1> arrow = arrow(length = unit(2, 'mm'))) +</tab1>", img ="./IMG/25.png") %>% 
  ch_row(text = "<tab0> annotate(geom = 'text', x = -60, y = -20, <br> label = 'In Mato Grosso do Sul State 39 \nof white adults and 25 of \nyoung black adults are enrolled \nin formal education', </tab0>", img ="./IMG/26.png") %>% 
  ch_row(text = "<tab1> size = 3,hjust = 'right') +  </tab1>", img ="./IMG/27.png") %>% 
  ch_row(text = "<tab0> theme_bw() +</tab0>", img ="./IMG/28.png") %>%
  ch_row(text = "<tab0> theme(plot.title.position = 'plot', </tab0>", img ="./IMG/29.png") %>%
  ch_row(text = "<tab1> plot.title = element_text(face = 'bold', </tab1>", img ="./IMG/30.png") %>%
  ch_row(text = "<tab1> size = 18),</tab1>", img ="./IMG/31.png") %>%
  ch_row(text = "<tab1> plot.subtitle = element_text(size = 9),  </tab1>", img ="./IMG/32.png") %>%
  ch_row(text = "<tab1> panel.background = element_rect(fill = 'lightblue'))</tab1>", img ="./IMG/33.png") %>%
  ch_out(img = "./IMG/1.png", div_tag_add = " class='column'") 
htmltools::HTML(map)
ggplot2::ggplot() +
geom_sf(data = south_america_sf,
size = .3,
colour = 'gray30',
fill = 'gray80') +
geom_sf(data = br_sf,
aes(fill = (Diff)),
size = .3,
colour = 'black') +
coord_sf(xlim = c(-73, -35),
ylim = c(-33, 5)) +
scale_fill_steps(low = '#feebe2',
high = '#7a0177',
name = 'Difference (white - black) (pp.%)') +
labs(title = 'Difference in escolarization rate betweeen black and white young adults in Brazilian States',
subtitle = 'In young adults (18 to 24 years old) what is the difference in the rate of formal education enrollment between black and white people?',
caption = 'Source: PNADCA 2019 - IBGE',
x = '', y = '') +
ggspatial::annotation_scale(location = 'br') +
ggspatial::annotation_north_arrow(location = 'br',
pad_y = unit(0.3, 'in'),
style = ggspatial::north_arrow_nautical()) +
annotate(geom = 'curve', x = -55, y = -20, xend = -60, yend = -20,
curvature = .3,
arrow = arrow(length = unit(2, 'mm'))) +
annotate(geom = 'text', x = -60, y = -20,
label = 'In Mato Grosso do Sul State 39 of white adults and 25 of young black adults are enrolled in formal education',
size = 3,hjust = 'right') +
theme_bw() +
theme(plot.title.position = 'plot',
plot.title = element_text(face = 'bold',
size = 18),
plot.subtitle = element_text(size = 9),
panel.background = element_rect(fill = 'lightblue'))