quarto-dev / quarto-dev/quarto-cli

`fig-align: center` for leaflet in revealjs

Open
#8,053 1 comment 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Dec 28, 2023.

enhancement revealjs themes
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

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>
```


:::
:::

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.