matplotlib / matplotlib/ipympl

Resizing extends outside the bounds of the notebook

Aperta
#242 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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

Describe the issue

If you drag the resize handle outside the limits of the notebook and release the mouse you lose the ability to resize as the handle will be hidden:
wonky-resize

This is a consequence of using a window mouse move listener: https://github.com/matplotlib/ipympl/blob/6b44a6f90cf74b12cfcf930b440010984d8a9b4d/js/src/mpl_widget.js#L272

Maybe there could be a check that it won't be resized to be larger the layout (this.model.get('layout'))?

Versions

 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0]
ipympl version: 0.5.6
jupyter core     : 4.6.1
jupyter-notebook : 6.0.3
qtconsole        : 4.6.0
ipython          : 7.12.0
ipykernel        : 5.1.4
jupyter client   : 5.3.4
jupyter lab      : 2.1.5
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.4
traitlets        : 4.3.3
Known nbextensions:
  config dir: /home/ian/anaconda3/etc/jupyter/nbconfig
    notebook section
      jupyter-matplotlib/extension  enabled 
      - Validating: OK
      nbdime/index  enabled 
      - Validating: OK
      voila/extension  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
JupyterLab v2.1.5
Known labextensions:
   app dir: /home/ian/anaconda3/share/jupyter/lab
        @axlair/jupyterlab_vim v0.12.2  enabled  OK
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK
        @jupyter-widgets/jupyterlab-sidecar v0.5.0  enabled  OK
        @jupyterlab/git v0.20.0-rc.0  enabled  OK
        jupyter-matplotlib v0.7.2  enabled  OK
        jupyterlab_vim-system-clipboard-support v0.1.0  enabled  OK
        nbdime-jupyterlab v2.0.0  enabled  OK

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Leggi js/src/mpl_widget.js intorno alla riga 272 e riproduci il comportamento del resize-handle trascinando oltre i limiti del notebook. Esamina come il window mousemove listener usa this.model.get('layout'); il problema è risolto quando il rilascio al di fuori del notebook non lascia l’handle nascosto né impedisce ulteriori ridimensionamenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, jupyter
Ambito
frontend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.