R leaflet in revealjs

Viewed 111

I am experimenting with reveal.js. I have pulled together a quick example to test this for a project. When I run the code: the map is not aligned, the legend is disproportionately large and there are these black grid lines?

None of these appear if I was to run this in console. Can anyone help resolve these questions?

Thanks in advance

---
title: "Untitled"
output: 
  revealjs::revealjs_presentation:
    self_contained: false
    reveal_plugins: ["notes", "search","chalkboard","menu","zoom"]
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```


## Slide with map

```{r, warning=FALSE,echo = FALSE, message=FALSE}
library(tmap)
library(leaflet)

data("World")
tmap_mode("view")
m<-tm_shape(World) +
    tm_polygons("HPI")

tmap_leaflet(m)
```

enter image description here

1 Answers

The issue seems to be with reveal.js or the interaction between reveal.js and leaflet, because the same code renders well with output: ioslides_presentation. If that is the case, maybe you could write an issue over on github.

with ioslides

slidy presentation

Related