Contributing

To add more functionality to canvas_ux, canvas_viz, or any component, first set up a dev environment. Then, packages can be updated and deployed. If your change could be useful to other users, please consider making a pull request.

Development Installation

1. Install JavaScript package managers.

Install Node and Yarn globally on your machine.

2. Create a Python environment.

With conda, using canvas as the environment name:

conda create -n canvas python=3.10
conda activate canvas

Or, instead using venv:

virtualenv --python /usr/local/opt/python/bin/python3 venv
source venv/bin/activate

3. Install Python dependencies.

Install Python dependences by running:

pip install -r requirements.txt

4. Install Canvas packages.

First, install the canvas_ux Python package.

scripts/dev-install.sh

Optionally, install all the widgets:

scripts/dev-install-widgets.sh

5. Build and watch for changes.

For the main canvas_ux package:

yarn dev

For canvas_viz:

cd canvas_viz
yarn watch

Optionally, for the widgets:

scripts/dev-watch-widgets.sh

Deployment Note

As all packages depend on canvas_viz, whenever canvas_viz is updated, all packages need to follow. To do that, you need to manually bump all _version.py files for all widgets and for the main Canvas package. Then, you can use:

scrips/dev-watch-widgets.sh