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

Rendering ipywidgets in Quarto #12

Open
nicole-brewer opened this issue Jun 20, 2024 · 1 comment
Open

Rendering ipywidgets in Quarto #12

nicole-brewer opened this issue Jun 20, 2024 · 1 comment

Comments

@nicole-brewer
Copy link
Contributor

TLDR: I don't think it's possible to use server-side widgets using Jupyter Notebooks and Quarto. It may be possible to render basic widgets in a .qmd document instead, though there is confusion about which Jupyter widgets actually will work.

In the documentation, it appears that this should be possible

"Jupyter Widgets and htmlwidgets ... run entirely client-side so can be deployed within normal static HTML documents.

There are several issues that suggest that this documentation is somewhat misleading.

In quarto-dev/quarto-cli#6496, some people say that there is confusion because some, but not all of the client-side widgets seem to work. That point aside, the following working example was proposed:

---
format: html
---

```{python}
import ipywidgets as widgets
widgets.IntSlider()
```

and then calling the command quarto render example.qmd and opening the resulting file, example.html, in a browser tab.

This work for me as well when I put that code in a quarto markdown document (.qmd) only.

Screenshot 2024-06-19 at 7 11 22 PM

However, when I try the same example using a Jupyter Notebook, the code appears just the same, but the javascript widget doesn't appear.

Screenshot 2024-06-19 at 7 15 46 PM
@mwcraig
Copy link
Collaborator

mwcraig commented Jun 25, 2024

I think it would be worth adding something about the current state of affairs with Quarto. I know @JuanCab is finding there are issues with voici as well. Providing folks with an accurate state of affairs is useful, even if the state of affairs is that the tool doesn't quite do what it seems it might...

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

No branches or pull requests

2 participants