Skip to content

fig-align: center for leaflet in revealjs #8053

@cderv

Description

@cderv

From https://community.rstudio.com/t/center-align-leaflet-htmlwidget-quarto-revealjs/178362

---
format: revealjs
---

## htmlwidget not centered

```{r}
#| label: leaflet-map
#| fig-align: center
#| fig-width: 4

library(leaflet)

leaflet() %>% 
  addTiles()
```

image

this is not centered...

should it work ? 🤔

Or just unssuported option silently ignored ?

Intermediate md
---
format: revealjs
keep-md: true
---



## htmlwidget not centered


::: {.cell layout-align="center"}
::: {.cell-output-display}


```{=html}
<div class="leaflet html-widget html-fill-item" id="htmlwidget-5965e865d730b27e718d" style="width:384px;height:480px;"></div>
<script type="application/json" data-for="htmlwidget-5965e865d730b27e718d">{"x":{"options":{"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}}},"calls":[{"method":"addTiles","args":["https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",null,null,{"minZoom":0,"maxZoom":18,"tileSize":256,"subdomains":"abc","errorTileUrl":"","tms":false,"noWrap":false,"zoomOffset":0,"zoomReverse":false,"opacity":1,"zIndex":1,"detectRetina":false,"attribution":"&copy; <a href=\"https://openstreetmap.org/copyright/\">OpenStreetMap<\/a>,  <a href=\"https://opendatacommons.org/licenses/odbl/\">ODbL<\/a>"}]}]},"evals":[],"jsHooks":[]}</script>
```


:::
:::

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestrevealjsIssues with the revealjs formatthemesRelated to HTML theming or any other style related issue (like highlight-style)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions