demo | docs | install | build |
---|---|---|---|
[][binder] | [![build][workflow-badge]][workflow] ![coverage][cov-badge] |
Drawio diagrams for JupyterLab. Forked with ❤️ from QuantStack/jupyterlab-drawio.
Install · History · Roadmap · Contribute · Open Source
This is BETA software. Native drawio files created with these tools should work with any other drawio client, but any UI/API is liable to change at any time.
mamba install -c conda-forge ipydrawio # recommended, or...
conda install -c conda-forge ipydrawio # or...
pip install ipydrawio[all]
ipydrawio
--collaborative
flag, added in JupyterLab 3.1+ipydrawio-export
BEWARE: some heavy, maybe fragile dependencies,
mamba
recommendedmamba install -c conda-forge ipydrawio-export # recommended, or... conda install -c conda-forge ipydrawio-export # or... pip install ipydrawio ipydrawio-export
ipydrawio-mathjax
ⓡ: unavailable in RetroLab Ⓛ: unavailable in JupyterLite
Note | Screenshot/Example |
---|---|
Screenshot of drawio "minimal" UI with export options | [![poster-min]][poster-min] |
The beginning of an interactive computational poster | |
A mixed computational/creative roadmap for this project |
Please see the docs for full information
Diagram_ from the [Launcher][]
IPython
with ipydrawio.Diagram
application/x-drawio
MIME rendererNOTE: some of the built-in UI features of drawio don't work properly inside an IFrame in JupyterLab, and are difficult to robustly disable: please see Diagram options available in the Command Palette and various Main Menu menus.
Your default theme can be changed in the JupyterLab Main Menu:
The different themes have some advantages and disadvantages:
theme | default | full menu | layers | pages | light | dark | rough |
---|---|---|---|---|---|---|---|
atlas |
✔️ | ✔️ | ✔️ | ✔️ | |||
dark |
✔️ | ✔️ | ✔️ | ✔️ | |||
kennedy |
✔️ | ✔️ | ✔️ | ✔️ | |||
min |
✔️ | ✔️ | ✔️ | ✔️ | ⚙️ | ||
sketch |
✔️ | ✔️ | ⚙️ | ✔️ |
Note that
rough
will change how many shapes look
Use Advanced Settings to modify drawio embedding parameters
See the schema for full details of the (known) supported options as well as the upstream docs for all parameters, though IPyDrawio might not support them... yet.
ipydrawio-export
can generate print-quality PDF. This approach relies on a headless
browser, powered by @jgraph/draw-image-export2, puppeteer
, and nodejs
.
puppeteer
docker
, this can be a bit trial-and-errornodejs>=18,<19
from conda
or your system package manager
puppeteer
(and other arbitrary
dependencies with jlpm
for now when first usedpip install ipydrawio-export
or conda install -c conda-forge ipydrawio-export
For example to install all the dependencies:
conda install -yc conda-forge ipydrawio-export ipydrawio-mathjax
Optionally, pre-install the dependencies:
jupyter ipydrawio-export provision
By default this will install to
{JUPYTER_DATA_DIR}/ipydrawio_export
, but can be tuned with:
- the
$IPYDRAWIO_DATA_DIR
environment variableIPyDrawioExportManager.drawio_export_workdir
injupyter_config.json
Additionally, the (large) chromium browser download can be tuned with the
$IPYDRAWIO_PUPPETEER_CACHE_DIR
or$PUPPETEER_CACHE_DIR
environment variables.
Once installed, you can use the in-browser tools Export Diagram as PDF as well as the command line:
jupyter ipydrawio-export <name of document>
All files herein, unless otherwise noted, are free software licensed under Apache 2.0.
The copyright holders of this extension are the contributors to this repository.
Portions of the JupyterLab components are derived from QuantStack/jupyterlab-drawio.
The copyright holders of drawio and drawio-export is jgraph.
The original source code vendored in this package from:
Copyright 2023 ipydrawio contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[binder]: http://mybinder.org/v2/gh/deathbeds/ipydrawio/main?urlpath=lab/tree/docs/Poster.dio.svg
[workflow-badge]: https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg [workflow]: https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amain+workflow%3A.github%2Fworkflows%2Fci.yml
[cov-badge]: https://codecov.io/gh/deathbeds/ipydrawio/branch/main/graph/badge.svg?token=9B74VKHQDK
[documents]: https://github.com/deathbeds/ipydrawio/blob/main/docs/Diagram%20Document.ipynb [rich display]: https://github.com/deathbeds/ipydrawio/blob/main/docs/Diagram%20Rich%20Display.ipynb
[poster-min]: https://raw.githubusercontent.com/deathbeds/ipydrawio/main/docs/_static/images/poster.png
roadmap: https://nbviewer.jupyter.org/github/deathbeds/ipydrawio/blob/main/docs/ROADMAP.ipynb [command palette]: https://jupyterlab.readthedocs.io/en/stable/user/commands.html?highlight=command%20palette [launcher]: https://jupyterlab.readthedocs.io/en/stable/user/files.html?highlight=Launcher#creating-files-and-activities