|
1 | 1 | # jupyterlab-drawio |
2 | 2 |
|
3 | | -[](http://mybinder.org/v2/gh/QuantStack/jupyterlab-drawio/master?urlpath=lab) |
| 3 | +[](https://mybinder.org/v2/gh/QuantStack/jupyterlab-drawio/master?urlpath=lab) |
4 | 4 |
|
| 5 | +A JupyterLab extension for embedding drawio / mxgraph. |
5 | 6 |
|
6 | | -A JupyterLab extension for standalone integration of drawio / mxgraph into jupyterlab. |
7 | 7 |
|
8 | | -## Prerequisites |
9 | 8 |
|
10 | | -* JupyterLab |
| 9 | +## Requirements |
11 | 10 |
|
12 | | -## Installation |
| 11 | +* JupyterLab >= 3.0 |
| 12 | + |
| 13 | +## Install |
13 | 14 |
|
14 | 15 | ```bash |
15 | | -jupyter labextension install jupyterlab-drawio |
| 16 | +pip install jupyterlab-drawio |
16 | 17 | ``` |
17 | 18 |
|
18 | | -## Usage |
19 | 19 |
|
20 | | - |
| 20 | +## Contributing |
| 21 | + |
| 22 | +### Development install |
21 | 23 |
|
22 | | -## Development |
| 24 | +Note: You will need NodeJS to build the extension package. |
23 | 25 |
|
24 | | -For a development install (requires npm version 4 or later), do the following in the repository directory: |
| 26 | +The `jlpm` command is JupyterLab's pinned version of |
| 27 | +[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use |
| 28 | +`yarn` or `npm` in lieu of `jlpm` below. |
25 | 29 |
|
26 | 30 | ```bash |
27 | | -npm install |
28 | | -npm run build |
29 | | -jupyter labextension link . |
| 31 | +# Clone the repo to your local environment |
| 32 | +# Change directory to the jupyterlab-drawio directory |
| 33 | +# Install package in development mode |
| 34 | +pip install -e . |
| 35 | +# Link your development version of the extension with JupyterLab |
| 36 | +jupyter labextension develop . --overwrite |
| 37 | +# Rebuild extension Typescript source after making changes |
| 38 | +jlpm run build |
30 | 39 | ``` |
31 | 40 |
|
32 | | -To rebuild the package and the JupyterLab app: |
| 41 | +You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. |
33 | 42 |
|
34 | 43 | ```bash |
35 | | -npm run build |
36 | | -jupyter lab build |
| 44 | +# Watch the source directory in one terminal, automatically rebuilding when needed |
| 45 | +jlpm run watch |
| 46 | +# Run JupyterLab in another terminal |
| 47 | +jupyter lab |
37 | 48 | ``` |
38 | 49 |
|
39 | | -## License |
| 50 | +With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). |
| 51 | + |
| 52 | +By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: |
40 | 53 |
|
41 | | -The files herein, and especially the source code of mxgraph, is licensed under the Apache 2.0 License. |
42 | | -The copyright holders of draw.io / mxgraph is jgraph (http://www.jgraph.com). The original source code |
43 | | -vendored in this package is taken from: https://github.com/jgraph/mxgraph |
| 54 | +```bash |
| 55 | +jupyter lab build --minimize=False |
| 56 | +``` |
| 57 | + |
| 58 | +### Uninstall |
| 59 | + |
| 60 | +```bash |
| 61 | +pip uninstall jupyterlab-drawio |
| 62 | +``` |
0 commit comments