未提供项目描述
项目描述
voila-gridstack
Gitter频道 | Voila | JupyterLab扩展 |
---|---|---|
|
|
|
安装
voila-gridstack
可以用mamba包管理器安装
mamba install -c conda-forge voila-gridstack
或从PyPI安装
pip install voila-gridstack
格式
模板使用笔记本文件(.ipynb
)中定义的元数据来配置布局。元数据的规范由已停用的项目jupyter-dashboards
定义。规范在jupyter-dashboards
文档中描述。
Voila渲染器的行为与规范中定义的“仅显示渲染器,无创作能力”一致。然而,与原始实现相比,有一些差异
- 如果在笔记本中没有找到元数据,Voilà将渲染笔记本为
grid
布局, - 它不能持久化单元格的状态(即当用户关闭Voila页面时,布局的重新配置将丢失),
- 如果单元格不包含特定视图类型的视图配置(
grid
或report
)或未定义hidden
属性,Voilà将将其视为可见。
使用方法
要使用gridstack
模板,将选项--template=gridstack
传递给voila
命令行。
默认情况下,仪表板中单元格的位置是固定的。如果您想使它们可拖放和可调整大小,可以在设置show_handles
为True
的情况下启动Voila
voila --template=gridstack examples/ --VoilaConfiguration.resources="{'gridstack': {'show_handles': True}}"
请注意,仪表板的状态无法在笔记本中持久化。
您可以使用theme
资源更改配色方案
voila examples/ --template=gridstack --theme=dark
开发
要从源安装模板
# create a new `conda` environment
conda create -n voila-gridstack -c conda-forge notebook python
# activate the environment
conda activate voila-gridstack
# install the package in development mode
python -m pip install -e .
# start voila with the gridstack template
voila --template=gridstack
经典笔记本扩展
voila-gridstack
为经典笔记本提供了一个扩展,可以从笔记本界面编辑gridstack布局。
要开发模式下安装此扩展
# activate the environment
conda activate voila-gridstack
# link the local files
jupyter nbextension install --sys-prefix --symlink --overwrite --py voila_gridstack
# enable the extension
jupyter nbextension enable --sys-prefix --py voila_gridstack
# check the extension is installed and enabled
jupyter nbextension list
# start the notebook
jupyter notebook
然后编辑voila-gridstack/static
中的文件,并重新加载页面以查看更改。
JupyterLab扩展
注意:您需要NodeJS来构建扩展包。
jlpm
命令是JupyterLab的yarn
固定版本,与JupyterLab一起安装。您可以使用下面的yarn
或npm
代替jlpm
。
# activate the environment
conda activate voila-gridstack
# install JupyterLab
mamba install -c conda-forge jupyterlab
# 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
许可证
我们使用共享版权模式,允许所有贡献者保留其对贡献的版权。
本软件根据BSD-3-Clause许可证授权。有关详细信息,请参阅LICENSE文件。
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源代码发行版
voila_gridstack-0.4.0.tar.gz (1.0 MB 查看哈希值)
构建发行版
voila_gridstack-0.4.0-py3-none-any.whl (285.4 kB 查看哈希值)