Tldraw for Jupyter
Project description
Jupyter Tldraw
A tldraw whiteboard as a Jupyter widget, built with anywidget.
Install & run
uv run --with jupyterlab --with tldraw jupyter lab
Examples
Three example notebooks are included:
| Notebook | Widget | What it shows |
|---|---|---|
basic.ipynb |
TldrawWidget |
A plain tldraw canvas embedded in a cell. |
monkey.ipynb |
MonkeyWidget |
A 🐒 emoji on the canvas; its x / y are synced as traitlets, so you can .observe(...) the position from Python. |
stroke.ipynb |
StrokeWidget |
Captures the currently-drawn freehand stroke as a [[x, y], ...] list in Python via the stroke traitlet. |
Minimal usage:
from tldraw import TldrawWidget
t = TldrawWidget()
t
Developer setup
- Clone the repo
npm iuv syncnpm run dev(esbuild watchesjs/*.jsxand rebuilds bundles intosrc/tldraw/static/)uv run jupyter lab
Hot module reload
Put this at the top of any dev notebook, before importing the widget:
%env ANYWIDGET_HMR=1
%load_ext autoreload
%autoreload 2
ANYWIDGET_HMR=1 makes anywidget watch the _esm / _css files; %autoreload 2 does the same on the Python side. Combined with npm run dev, edits to js/*.jsx swap into the running widget without re-running the cell.
anywidget reads
ANYWIDGET_HMRat import time — if you forgot to set it first, restart the kernel once.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tldraw-5.0.0.tar.gz.
File metadata
- Download URL: tldraw-5.0.0.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3198ba6b02930373678573c2393f56f0907ce165adbf07690dc684d88670e88e
|
|
| MD5 |
ec8722f67a22fee4106d2fb2cab897ad
|
|
| BLAKE2b-256 |
83fd196b915ce8b7feb776877a40ff56aed4cc09cbd15c171dccd805b7f28b52
|
File details
Details for the file tldraw-5.0.0-py3-none-any.whl.
File metadata
- Download URL: tldraw-5.0.0-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33d96129bbac87a44d5c9776adafdb230009a661a1ef856819b231484b22a605
|
|
| MD5 |
45cec56c0bcab25a94e1fb4c91670337
|
|
| BLAKE2b-256 |
ed2eff70e67749531ab54307a8f79496c241867aa7cd8bfcca94835f5eff0fd9
|