用于渲染Crystal Toolkit Scene JSON文件的JupyterLab扩展。
项目描述
晶体工具包扩展
用于渲染Crystal Toolkit Scene JSON文件的JupyterLab扩展。
需求
- JupyterLab >= 3.0
安装
pip install crystaltoolkit-extension
贡献
开发安装
注意:您将需要NodeJS来构建扩展包。
jlpm
命令是JupyterLab附带版本的控制yarn。您可以在以下代码中使用yarn
或npm
代替jlpm
。
# Clone the repo to your local environment
# Change directory to the crystaltoolkit-extension directory
# 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 build
您可以在不同的终端中同时监视源目录并运行JupyterLab,以监视扩展源的变化并自动重新构建扩展。
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
当运行监视命令时,每次保存的更改都将立即在本地构建并可供您正在运行的JupyterLab使用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟以重建扩展)。
默认情况下,jlpm run build
命令为此扩展生成源映射,以便使用浏览器开发工具进行调试。要为JupyterLab核心扩展也生成源映射,您可以运行以下命令
jupyter lab build --minimize=False
卸载
pip uninstall crystaltoolkit-extension