-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure size behavior change in 1.5? Missing img-fluid
class.
#10259
Comments
Thanks for the report. We kindly ask for your cooperation in our issue resolution process. Please allow us the opportunity to review your initial report before opening additional discussions or issues. Often, the matter may involve complex factors that require comprehensive analysis. In addition, this report does not follow the template and does not contain sufficient information. |
I used the 'make an issue from this discussion' link, which does not show any template. This is very reproducible. Inspect any quarto 1.5 generated qmd file with a python generated image in a cell. The cell images are missing the ---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document.
```{python}
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
plt.figure(figsize=(16, 8))
plt.plot(x, y)
plt.show()
```
|
I know but you did not put back the example and did not let us the time to take a look.
We received your query within the discussion you first opened. It was unnecessary to raise a separate issue to inquire about the same matter roughly 24 hours after initiating the discussion. |
Discussions Q&A felt more for "How do I do this?" This felt more like a bug/issue, not a discussion, especially once I found the lua code for the If there was a "move" button, I would have used that instead. I'm happy to close the discussion if helpful. |
I'm sorry, I can't reproduce the claim.
|
My apologies, @cscheid. I witnessed the behavior change (dropping the Here is a better reproduction, using plotnine. ---
title: Example of Img Fluid
---
### What's happening
```{python}
import pandas as pd
from plotnine import ggplot, geom_point, aes, theme
df = pd.DataFrame()
df['x'] = [1, 2, 3, 4, 5]
df['y'] = [1, 4, 9, 16, 25]
(ggplot() + geom_point(df, aes(x='x', y='y')) + theme(figure_size=(16, 8)))
```
And here is the terminal output.
and then with Quarto 1.5, the terminal output, now the
|
Ah-ha! That's it. Specifically f835a76 I need to read those issues to understand what I should be doing for retina, because my approach had been to render in python at large pixel size and let img-fluid squish it back down to the width of my post (Which I think should look good at high or low DPI monitors). But, I need to read more on other ways to handle retina. (Though the 2X assumption is not quite right; for some iOS devices, it might be 3X.) For now, I can use |
Discussed in #10245
This really seems like a bug/issue than a discussion, since any 1.5 rendered image you can see the missing
img-float
class. I think the question I have is: should images (theimg
tag) in Quarto created by cell blocks have theimg-fluid
bootstrap class or not? They did in 1.4, they don't in 1.5.x.I think something might be inserting
height
into the img tag that wasn't present in 1.4, and the lua code that adds the responsiveness doesn't work if height is set.Originally posted by astrowonk July 8, 2024
Description
According to the Quarto documentation:
And in Quarto 1.4 when I use Safari to inspect a figure created by python code, I see two classes on the img :
class="img-fluid figure-img"
where theimg-fluid
bootstrap class imposes this style of:This seems consistent with the documentation.
In Quarto 1.5, the same document when rendered the
img
tag created does not have theimg-fluid
class, and large images appear larger than the page with horizontal scroll bars. I can restore the behavior I want by setting my own css to be:but I'm not sure that behavior change in 1.5 was intended?
The text was updated successfully, but these errors were encountered: