matplotlib / matplotlib/ipympl
Follow-up to #343 - Embedding Static Plots
Nessuno ha ancora preso questa issue.
- Lingua principale
- Jupyter Notebook
- Stelle
- 1.7k
- Fork
- 234
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
#343 was a huge step forward for saving the state of plots in notebooks. But it doesn't truly reproduce the state of the notebook that the author was looking at for these two cases:
1. If widget state is saved then only a blank figure renders (https://github.com/matplotlib/ipympl/pull/343#issuecomment-920167467)
2. Any updates to the figure after the initial render are not saved in the notebook (https://github.com/matplotlib/ipympl/pull/343#issuecomment-921008926)
I think part 2 is very important to be able to tell a story using a notebook. e.g. If I make some plots with a slider, get them just so and then run nbconvert I don't think I would faithfully reproduce the state of the notebook as I was looking at it.
**Part 1** should be solvable if we include the PNG as part of the widget model
**Part 2** I think a reasonable tradeoff would be to only update the static plot whenever the notebook is saved. This would require the frontend of ipywidgets (jupyterlab-manager, and widgetsnbextension) to listen to notebook save signals and pass them to the ipympl frontend, which would in turn let the backend know to update the mimebundle.
@martinRenou how hard do you think the second one (saving) would be to fix? To me that feels like a very important thing to hit.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo come vengono gestiti i segnali di salvataggio del notebook in jupyterlab-manager e widgetsnbextension, quindi traccia il percorso dal frontend al backend di ipympl per l’aggiornamento del mimebundle. Controlla la gestione del modello del widget per il caso PNG. Il lavoro è completato quando lo stato salvato del widget viene renderizzato invece di mostrare una figura vuota e gli aggiornamenti successivi al rendering persistono durante il salvataggio del notebook e con nbconvert.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- jupyter, jupyter-notebook
- Ambito
- backend, frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100