Altair Jupyter Widget library that relies on VegaFusion for serverside calculations
Project description
Development Installation
Create a dev environment. The general approach here is that we use conda to install development dependencies from conda-forge, and then rely on the specifications in setup.py to handle the python runtime and test dependencies.
The development dependencies from conda-forge are managed with conda and conda-lock.
All you need is conda (or mamba) to start, conda-lock
will be installed with the command below.
Feel free to change vegafusion_jupyter_dev
to an environment name of your choosing, but make sure to change it in both commands
conda create --name vegafusion_jupyter_dev --file conda-linux-64-3.10.lock
conda activate vegafusion_jupyter_dev
Now add a development install of the vegafusion-python
package. This is a native Python package written in Rust.
maturin develop --release
install wasm-pack
Install wasm-pack
cargo install wasm-pack
Build vegafusion-wasm npm package
cd vegafusion-wasm
wasm-pack build --release
install runtime and test dependencies
cd python/vegafusion_jupyter
pip install -e ".[test]"
Making a change to development environment requirements
- Edit the dev-environment-3.X.yml file
- Update lock files with
$ conda-lock -f dev-environment-3.7.yml -p osx-64 -p linux-64 -p win-64 -k env --filename-template "conda-{platform}-3.7.lock"
$ conda-lock -f dev-environment-3.10.yml -p osx-64 -p linux-64 -p win-64 -k env --filename-template "conda-{platform}-3.10.lock"
- Update existing conda environment with
conda env update --file conda-linux-64.lock.yml --prune
,
Note: --prune
only handles removing transitive dependencies that are no longer needed. If a package is dropped from
dev-environment.yml
, it will need to be manually removed with conda
.
Autogenerated below
https://github.com/jtpio/jupyterlab-wasm-example
vegafusion
Altair Jupyter Widget library that relies on VegaFusion for serverside calculations
Installation
You can install using pip
:
pip install vegafusion_jupyter
If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable the nbextension:
jupyter nbextension enable --py [--sys-prefix|--user|--system] vegafusion_jupyter
Development Installation
Create a dev environment:
conda create -n vegafusion_jupyter-dev -c conda-forge nodejs yarn python jupyterlab
conda activate vegafusion_jupyter-dev
Install the python. This will also build the TS package.
pip install -e ".[test, examples]"
When developing your extensions, you need to manually enable your extensions with the notebook / lab frontend. For lab, this is done by the command:
jupyter labextension develop --overwrite .
yarn run build
For classic notebook, you need to run:
jupyter nbextension install --sys-prefix --symlink --overwrite --py vegafusion_jupyter
jupyter nbextension enable --sys-prefix --py vegafusion_jupyter
Note that the --symlink
flag doesn't work on Windows, so you will here have to run
the install
command every time that you rebuild your extension. For certain installations
you might also need another flag instead of --sys-prefix
, but we won't cover the meaning
of those flags here.
How to see your changes
Typescript:
If you use JupyterLab to develop then 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 widget.
# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab
After a change wait for the build to finish and then refresh your browser and the changes should take effect.
Python:
If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.
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 Distributions
Built Distribution
File details
Details for the file vegafusion_jupyter-0.0.1a1-py3-none-any.whl
.
File metadata
- Download URL: vegafusion_jupyter-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 8.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 913204c663b55534e72ece5a17686978fd47232aa92ddabf345b51b3265718da |
|
MD5 | 2682852c2af317b95f07977222fc56b4 |
|
BLAKE2b-256 | 8dfbcbbedaba6dfbe3822a3296b551d774af80ce9a8a3aa63806907c05e2c073 |