依赖于VegaFusion进行服务器端计算的Altair Jupyter Widget库
项目描述
VegaFusion Jupyter
此目录包含 vegafusion-jupyter
包。有关使用此包在Jupyter环境中显示由VegaFusion提供的Altair可视化的文档,请参阅 https://vegafusion.io。
以下内容由Jupyter Widget cookiecutter自动生成
vegafusion-jupyter
依赖于VegaFusion进行服务器端计算的Altair Jupyter Widget库
安装
您可以使用 pip
安装
pip install vegafusion_jupyter
如果您使用的是Jupyter Notebook 5.2或更早版本,您可能还需要启用nbextension
jupyter nbextension enable --py [--sys-prefix|--user|--system] vegafusion_jupyter
开发安装
创建开发环境
conda create -n vegafusion_jupyter-dev -c conda-forge nodejs yarn python jupyterlab
conda activate vegafusion_jupyter-dev
安装python。这将还会构建TS包。
pip install -e ".[test, examples]"
在开发您的扩展时,您需要手动使用笔记本/实验室前端启用您的扩展。对于实验室,这通过以下命令完成
jupyter labextension develop --overwrite .
yarn run build
对于经典笔记本,您需要运行
jupyter nbextension install --sys-prefix --symlink --overwrite --py vegafusion_jupyter
jupyter nbextension enable --sys-prefix --py vegafusion_jupyter
请注意,--symlink
标志在Windows上不起作用,因此您每次重建扩展时都必须运行 install
命令。对于某些安装,您可能还需要另一个标志代替 --sys-prefix
,但这里不会介绍这些标志的含义。
如何查看您的更改
Typescript
如果您使用 JupyterLab 进行开发,那么您可以在不同的终端中同时监视源目录并运行 JupyterLab,以便监视扩展源的变化并自动重建小部件。
# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab
更改后,请等待构建完成,然后刷新浏览器,更改应生效。
Python
如果您更改了 Python 代码,则需要重新启动笔记本内核才能使其生效。