Skip to content
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

Fix Plotly require.js config mechanism #155

Merged
merged 9 commits into from
Jun 19, 2024
Merged

Fix Plotly require.js config mechanism #155

merged 9 commits into from
Jun 19, 2024

Conversation

jkrumbiegel
Copy link
Collaborator

Quarto expects the preamble for a Plotly plot using require.js to exist in a cell only once. So we keep track whether a PlotlyBase plot has already been displayed, and only if not, we expand the plot into two cells, the preamble and the plot's html.

The fix on the quarto side is not in a prerelease, yet, but locally I confirmed that this works with latest master:

---
engine: julia
keep-md: true
---

```{julia}
using PlotlyJS

plot(rand(10,4))
```

and another plot

```{julia}
plot(cumsum(randn(100)))
```
image

@MichaelHatherly MichaelHatherly linked an issue Jun 18, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Files Patch % Lines
...ookWorker/ext/QuartoNotebookWorkerPlotlyBaseExt.jl 0.00% 19 Missing ⚠️
...ebookWorker/ext/QuartoNotebookWorkerPlotlyJSExt.jl 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jkrumbiegel jkrumbiegel merged commit a56f555 into main Jun 19, 2024
8 of 9 checks passed
@jkrumbiegel jkrumbiegel deleted the jk/plotly branch June 19, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PlotlyJS not working for HTML output
2 participants