Skip to content

Problems with interactives (e.g. leaflet, plotly) in closeread? #161

Answered by jimjam-slam
agrogan1 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @agrogan1! The essential problem is that your interactive don't automatically fill the available space, and Quarto doesn't know what size to make them without guidance. I have two solutions; the latter is more consistent for what you want to achieve in my opinion (and I'll talk to @andrewpbray about whether it's something we might consider building in more widely).

Solution 1: knitr YAML options and .scale-to-fill

The most consistent way to size figures in my experience is with the out-width and out-height chunk options:

```{r}
#| label: fig-world
#| fig-cap: "Countries of the World"
#| out-width: 800px
#| out-height: 600px

# [figure code here]

If you set these to fixed units (eg. pi…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@agrogan1
Comment options

@jimjam-slam
Comment options

Answer selected by agrogan1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants