Giter Site home page Giter Site logo

jupyter4science / scipy2024-jupyter-widgets-tutorial Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 6.0 2.04 MB

SciPy2024 Tutorial on "Building Complex Web Applications with Jupyter Notebooks"

License: Apache License 2.0

Jupyter Notebook 87.76% Python 12.02% Dockerfile 0.22%
jupyter-widgets pydantic-models pydantic-v2 ipyautoui

scipy2024-jupyter-widgets-tutorial's People

Contributors

juancab avatar mwcraig avatar nicole-brewer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

scipy2024-jupyter-widgets-tutorial's Issues

Change `os.path` calls with `pathlib.Path`

This is not a high priority but if there is time I'd like to replace the uses of os.path in the notebooks with pathlib instead. I've found pathlib easier to work with, and you get the / operator for combining path names.

Ideas for 2025

  • Replace matplotlib with bqplot
  • Put all of the nbdev directives into the notebook
  • Focus more on pain points/common errors initially
  • Tab based/multi-page app
  • Suggest coordinating/timing tutorials so that dashboarding doesn't overlap
  • Demo nbdev in smaller notebook before widgets (like one short function)

Rendering ipywidgets in Quarto

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.