matplotlib / matplotlib/ipympl
ipympl does not work in JupyterLite
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 1.7k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
Describe the issue
Due to a dependency on tornado https://github.com/matplotlib/matplotlib/blob/c06e8709dde6504d396349c0c80ef019c88c3927/lib/matplotlib/backends/backend_webagg_core.py#L22, ipympl does not work in JupyterLite
We might be able to implement a custom Timer https://github.com/matplotlib/matplotlib/blob/c06e8709dde6504d396349c0c80ef019c88c3927/lib/matplotlib/backends/backend_webagg_core.py#L118 based entirely on asyncio (which works on JupyterLite).
Workaround
As a workaround, one could do
import sys
import types
sys.modules['tornado'] = types.ModuleType('tornadofake')
Disclaimer, I would not be held responsible for anything that would go wrong if you copy this code!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with matplotlib's lib/matplotlib/backends/backend_webagg_core.py, especially the tornado dependency near line 22 and the Timer around line 118. Check how ipympl reaches this backend in JupyterLite, then verify that the integration works there without tornado and that interactive timers still function using the available asyncio support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100