@maap-jupyterlab/ades-metrics-visualization-jupyter-extension v0.3.4
ades-metrics-visualization-jupyter-extension
Jupyter extension that visualizes ADES metrics.
Requirements
- JupyterLab >= 3.0
 
Install
To install the extension, execute:
pip install ades_metrics_visualization_jupyter_extensionUninstall
To remove the extension, execute:
pip uninstall ades_metrics_visualization_jupyter_extensionContributing
Development install
Note: You will need NodeJS to build the extension package.
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run buildThe
jlpmcommand is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.
The first command installs the dependencies that are specified in the
setup.py file and in package.json. Among the dependencies are also all the JupyterLab components that you want to use in your project.
It then runs the build script. In that step, the TypeScript code gets
converted to javascript using the compiler tsc and stored in a lib
directory. And a condensed form of the Javascript is copied in the Python
package (in the folder ades_metrics_visualization_jupyter_extension/labextension). This is the code that
would be installed by the user in JupyterLab.
The second command creates a symbolic link to the folder ades_metrics_visualization_jupyter_extension/labextension so that extension is installed in development mode in JupyterLab.
The third command allows you to update the Javascript code each time you modify your extension code.
Now, we can run the extension. Note by adding --watch, we just have to refresh the browser when the project is rebuilt.
jupyter lab --watchDevelopment uninstall
pip uninstall ades_metrics_visualization_jupyter_extensionIn development mode, you will also need to remove the symlink created by jupyter labextension develop
command. To find its location, you can run jupyter labextension list to figure out where the labextensions
folder is located. Then you can remove the symlink named ades-metrics-visualization-jupyter-extension within that folder.
File Structure Info
- Information about the extension:
README.mdcontains some instructionsLICENSEcontains your extension code license; BSD-3 Clause by default (but you can change it).
 - Extension code (those files are mandatory):
package.jsoncontains information about the extension such as dependenciestsconfig.jsoncontains information for the typescript compilationsrc/index.tsthis contains the actual code of your extensionstyle/folder contains style elements that you can use
 - Validation:
.prettierrcand.prettierignorespecify the code formatterprettierconfiguration.eslintrc.jsand.eslintignorespecify the code lintereslintconfiguration.github/workflows/build.ymlsets the continuous integration tests of the code using GitHub Actions
 - Packaging as a Python package:
setup.pycontains information about the Python package such as what to packagepyproject.tomlcontains the dependencies to create the Python packageMANIFEST.incontains list of non-Python files to include in the Python packageinstall.jsoncontains information retrieved by JupyterLab to help users know how to manage the packageades_metrics_visualization_jupyter_extensionfolder contains the final code to be distributed