You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the tmap package within a Distill blog-site. Basically I am trying to render two interactive HTML maps side-by-side, like so.
But instead, it looks like this, no matter what I do.
I originally thought this was a problem with tmap but the images render fine if I run the code chunk in RStudio. It also renders fine in a default R Markdown HTML document. The first image above was from a default R Markdown HTML document. It is worth noting that if I set tmap_mode("plot") instead of tmap_mode("view") the plots do render side-by-side in the Distill blog, but of course they are no longer interactive. Any thought? Thanks!
Reproducible example.
library(tmap)
library(tmaptools)
data("World")
tmap_mode("view")
facets <- c("life_exp", "inequality")
tmp_tmap <- tm_shape(World) +
tm_polygons(facets) +
tm_facets(ncol = 2, sync = TRUE, nrow = 1)
tmap_leaflet(tmp_tmap, show = FALSE)
# Or calling the the tmap object directly
tmp_tmap
The text was updated successfully, but these errors were encountered:
This happens with tmap_mode("view") because 2 leaflet maps are outputed whereas with tmap_plot() only one image is outputed where the two plots are merged in the tmap plot creating process. (there is only one png file inserted in the document).
So this is a limitation in distill due to the feature of layout for figures.
I'll leave this open as a feature request to see if we can offer an option to opt-out a layout for htmlwidget and support this (where width attributes is used to organize the grid layout).
Hi there
I am using the tmap package within a Distill blog-site. Basically I am trying to render two interactive HTML maps side-by-side, like so.
But instead, it looks like this, no matter what I do.
I originally thought this was a problem with
tmap
but the images render fine if I run the code chunk in RStudio. It also renders fine in a default R Markdown HTML document. The first image above was from a default R Markdown HTML document. It is worth noting that if I settmap_mode("plot")
instead oftmap_mode("view")
the plots do render side-by-side in the Distill blog, but of course they are no longer interactive. Any thought? Thanks!Reproducible example.
The text was updated successfully, but these errors were encountered: