Metadata-Version: 2.5
Name: jupyterlab_draw
Version: 0.3.0
Dynamic: Author
Dynamic: Author-email
Dynamic: Keywords
Dynamic: Project-URL
Summary: Infinite-canvas drawing pad for JupyterLab notebooks: pen, eraser, shapes, select/move/resize, paper backgrounds. Saves an editable .draw.json (the source of truth); a PNG picture is written only on request and inserted into the notebook. Double-click the drawing to edit it again.
License: BSD 3-Clause License
        
        Copyright (c) 2026, Mubeen
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# jupyterlab-draw

Infinite-canvas drawing pad for JupyterLab 4 notebooks.

- **Draw** button in the notebook toolbar (also in the Command Palette).
- Tools: select/move/resize, pan, pen (pencil cursor), eraser (eraser cursor), line, arrow,
  rectangle, ellipse, diamond, colour, width, fill, undo/redo/clear.
- **Infinite canvas**: horizontal + vertical scrollbars that keep growing, wheel / trackpad
  scrolling, Shift+wheel sideways, `Space`+drag or middle-mouse to pan, `Ctrl`+wheel to zoom.
- **Editable format**: every drawing is saved as `<notebook>_draw_<n>.draw.json`
  (each stroke/shape is its own object) next to `<notebook>_draw_<n>.png`.
- **Re-edit**: double-click the drawing in the notebook (or select its cell and press **Draw**) and the
  same objects re-open, ready to select, move, resize, recolour, delete or undo. *Save changes*
  overwrites the same files and refreshes the cell.
- **Save as image**: PNG button in the toolbar downloads the drawing (cropped to its content);
  JSON button downloads the editable `.draw.json`.
- Old drawings that only have a PNG still open: the picture is imported as one movable object.

Keyboard: `V` select, `H` pan, `P` pen, `E` eraser, `L` line, `A` arrow, `R` rect, `O` ellipse,
`D` diamond, `Del` delete, arrows nudge, `Ctrl+A` select all, `Ctrl+Z/Y` undo/redo, `Ctrl+S` save,
`Esc` deselect / close.

The eraser removes whole strokes/shapes (so everything stays editable).

## Install

```bash
pip install jupyterlab_draw-0.2.0-py3-none-any.whl
# restart JupyterLab (prebuilt extension, no `jupyter lab build` needed)
```

## Develop

```bash
pip install -e .
jupyter labextension develop . --overwrite
jlpm build
```
