How to control popup's width for tmap-feature's popup in Rstudio?

I would like to control the width of a tmap-feature popup via Rstudio, how can I do that?

I can't view all of the text at one glance when I opened a saved html map made using tmap. The pop-up box is too small and I have to use the scroll bar.

TREND <- tm_shape(AUST_STE_POP) +

tm_layout(title = "Trends of Australian Population growth, 2013-2015", title.position = c("center", "top")) +

tm_polygons(id = "STE_NAME11", c("Population (2013)" = "2013", "Population (2014)"= "2014", "Population (2015)" = "2015"), style=c("pretty","pretty", "pretty"), palette=list("Purples", "Greens", "Blues"), title=c("2013 population", "2014 population", "2015 population")) +

tm_facets(as.layers = TRUE) + tm_view(alpha = 1, basemaps = "Esri.WorldTopoMap")

tmap_save(TREND, "TREND.html")

Having checked the source of view_tmap on GitHub I believe you do not have that much control over the width of a popup in {tmap}.

If the defaults do not suit your needs you may consider using the {leaflet} package directly, and thus gain the ability to set maxWidth, minWidth and maxHeight manually via options = popupOptions(...) argument of the addPolygons call.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.