Interactive graph in jupyterlab-rise presentation
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
調査の方向性
まず、jupyterlab-rise を使用して JupyterLab で最小限の notebook を実行し、ここに記載されているコマンドとバージョンを使って ipympl 0.9.8、ipympl 0.9.0、ipywidgets 7.8.5 を比較します。RISE と widget 統合のどちらが静的 PNG へのフォールバックと連続的な再描画ループを引き起こしているのかを追跡します。完了の条件は、過剰な CPU 使用率なしにプレゼンテーションでインタラクティブなプロットが維持されることです。
索引モデルが issue の本文から書いたものです。
説明
For a lecture, I produced a slide deck in jupyter lab with interactive graphs and presented it as a slide show with jupyterlab-rise. With the latest version of ipympl, the slide show only gives a static graph. Sadly I cannot reproduce the working setup I used last year, which makes it hard to investigate.
Minimal example notebook:
%matplotlib widget
import matplotlib.pyplot as plt
plt.plot([1,2,3], [4,5,6])
with ipympl 0.9.8
Opening the notebook with uv run --with ipympl==0.9.8 --with matplotlib==3.10.8 --with matplotlib-inline==0.2.1 --with jupyterlab_rise jupyter lab (the latest versions as of now) and running the cell gives a working interactive plot, but when opening the presentation, it shows a static image instead:
(You can tell that the right plot in the screenshot misses the resize handler, I can also tell that it is a plain <img> tag with a png data URL instead of a <canvas>, which seems to be the fallback option.)
ipympl 0.9.3 already shows the same behavior of falling back to a static image, but 0.9.0 is different:
with ipympl 0.9.0
Opening the notebook with uv run --with ipympl==0.9.0 --with matplotlib'<'3.7 --with matplotlib-inline==0.1.7 --with jupyterlab_rise jupyter lab and running the cell gives a working interactive plot, but when opening the presentation, CPU usage goes up to 100%, the two plots constantly redraw and become unusuable:
After countless tries, I once saw the redrawing resolve, with both plots becoming partly usable: I could hover over either of the plots and have the coordinates be displayed beneath, but as soon as I tried drawing a Zoom rectangle, it went into a busy loop again. It seems there is some race condition that can stop the redrawing if lucky.
with ipywidgets 7.8.5
Downgrading ipywidgets instead of ipympl also works, with the same busy loop problem as with ipympl 0.9.0. Downgrading ipywidgets has the advantage that ipympl, matplotlib and matplotlib-inline can be kept at the most recent version:
uv run --with ipympl==0.9.8 --with matplotlib==3.10.8 --with matplotlib-inline==0.2.1 --with jupyterlab_rise --with ipywidgets==7.8.5 jupyter lab
Versions
For the first example, these are the versions:
python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.__version__)" && jupyter --version && jupyter nbextension list && jupyter labextension list
-->
3.12.3 (main, Nov 6 2025, 13:44:16) [GCC 13.3.0]
ipympl version: 0.9.0
Selected Jupyter core packages...
IPython : 8.38.0
ipykernel : 7.1.0
ipywidgets : 7.8.5
jupyter_client : 8.8.0
jupyter_core : 5.9.1
jupyter_server : 2.17.0
jupyterlab : 4.5.2
nbclient : 0.10.4
nbconvert : 7.16.6
nbformat : 5.10.4
notebook : 7.5.2
qtconsole : not installed
traitlets : 5.14.3
JupyterLab v4.5.2
/home/.../jupyter/labextensions
jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
jupyter-matplotlib v0.11.0 enabled OK
jupyterlab-rise v0.43.1 enabled OK (python, jupyterlab_rise)
@jupyterlab/mathjax3-extension v4.3.0 enabled X (python, jupyterlab-mathjax3)
@jupyter-notebook/lab-extension v7.5.2 enabled OK
@jupyter-widgets/jupyterlab-manager v3.1.11 enabled OK (python, jupyterlab_widgets)
The following extensions may be outdated or specify dependencies that are incompatible with the current version of jupyterlab:
@jupyterlab/mathjax3-extension
If you are a user, check if an update is available for these packages.
If you are a developer, re-run with `--verbose` flag for more details.
(I assume mathjax3 is not the issue here since the plot works fine outside of RISE.)
I'm not sure whether this behavior is due to ipympl or jupyterlab-rise. I assume that RISE is to blame for showing the static fallback PNG, but I'm not so sure about the 100% CPU usage / busy loop. I'd be happy about any hints on what could be a working combination of versions, or any hints on how to work around the endless redrawing, if this rings a bell with anybody. I'm also happy to do further investigations if helpful.
- 主要言語
- Jupyter Notebook
- スター
- 1.7k
- フォーク
- 234
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matplotlib/ipympl のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
matplotlib/ipympl#623 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
matplotlib/ipympl#622 · コメント 13 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
matplotlib/ipympl#611 · コメント 4 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
matplotlib/ipympl#609 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
matplotlib/ipympl#602 · コメント 1 件 ·
matplotlib/ipympl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
eknowledger/toolbench#101 · コメント 1 件 ·
-
comp/dashboard P3 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100