voila-gridstack


Namevoila-gridstack JSON
Version 0.4.0 PyPI version JSON
download
home_page
Summary
upload_time2024-02-06 20:10:31
maintainer
docs_urlNone
authorVoila Development Team
requires_python>=3.8
licenseBSD License Copyright (c) 2018 Voila contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. c. Neither the name of the authors nor the names of the contributors to this package may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # voila-gridstack

A gridstack-based template for [![voila-gridstack](assets/voila.png)](https://github.com/voila-dashboards/voila).

<table>
<thead align="center" cellspacing="10">
  <tr>
    <th align="center" border="">Gitter channel</th>
    <th align="center" border="">Voila</th>
    <th align="center" border="">JupyterLab extension</th>
  </tr>
</thead>
<tbody>
  <tr background="#FFF">
    <td align="center">
      <a href="https://gitter.im/QuantStack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge">
        <img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the Gitter Chat"/>
      </a>
    </td>
    <td align="center">
      <a href="https://mybinder.org/v2/gh/voila-dashboards/voila-gridstack/stable?urlpath=voila/tree/examples/scotch_dashboard.ipynb">
        <img src="https://mybinder.org/badge_logo.svg" alt="Voila GridStack on Binder"/>
      </a>
    </td>
    <td align="center">
      <a href="https://mybinder.org/v2/gh/voila-dashboards/voila-gridstack/stable?urlpath=lab/tree/examples">
        <img src="https://mybinder.org/badge_logo.svg" alt="JupyterLab on Binder"/>
      </a>
    </td>
  </tr>
</tbody>
</table>

## Installation

`voila-gridstack` can be installed with the mamba package manager

```
mamba install -c conda-forge voila-gridstack
```

or from PyPI

```
pip install voila-gridstack
```

## Format

The template uses metadata defined in the notebook file (`.ipynb`) to configure the layout.
The specification of the metadata was defined by a now defunct project `jupyter-dashboards`.
The specification is described in `jupyter-dashboards`
[docs](https://jupyter-dashboards-layout.readthedocs.io/en/latest/metadata.html).

The voila renderer behaves as a "display-only renderer without authoring capabilitiy" as defined in
the specs. However, there are a few differences compared to the original implmentation:

- if no metadata is found in the notebook voilĂ  will render the notebook as `grid` layout,
- it can not persist the state of the cells (i.e. the re-configuration of the layout will
  be lost, when the user closes the voila page),
- if the cell does not contain view configuration for the particular view type (`grid` or
  `report`) or `hidden` attribute is not defined, voilĂ  will treat it as **visible**.

## Usage

To use the `gridstack` template, pass option `--template=gridstack` to the `voila` command line.

![voila-gridstack](assets/voila-gridstack.gif)

By default the position of cells in the dashboard will be fixed. If you want them to be draggable
and resizable, you can launch voila with the `show_handles` resource set to `True`:

```
voila --template=gridstack examples/ --VoilaConfiguration.resources="{'gridstack': {'show_handles': True}}"
```

Note, however, that the state of the dashboard can not be persisted in the notebook.

You can change the color scheme using the `theme` resource:

```
voila examples/ --template=gridstack --theme=dark
```

## Development

To install the template from source:

```bash
# 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
```

### Classic Notebook Extension

![voila-gridstack](assets/classic-extension.gif)

`voila-gridstack` provides an extension for the classic notebook to edit the gridstack layout from the notebook interface.

To install this extension in development mode:

```bash
# 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
```

Then edit the files in `voila-gridstack/static` and reload the page to see the changes.

### JupyterLab Extension

![voila-gridstack](assets/jupyterlab-gridstack.gif)

Note: You will need NodeJS to build the extension package.

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# 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
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
```

## License

We use a shared copyright model that enables all contributors to maintain the
copyright on their contributions.

This software is licensed under the BSD-3-Clause license. See the
[LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "voila-gridstack",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Voila Development Team",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ad/88/a65deca56336093a92d957fa98d800ef74609cdb504457cd105388a9d310/voila_gridstack-0.4.0.tar.gz",
    "platform": null,
    "description": "# voila-gridstack\n\nA gridstack-based template for [![voila-gridstack](assets/voila.png)](https://github.com/voila-dashboards/voila).\n\n<table>\n<thead align=\"center\" cellspacing=\"10\">\n  <tr>\n    <th align=\"center\" border=\"\">Gitter channel</th>\n    <th align=\"center\" border=\"\">Voila</th>\n    <th align=\"center\" border=\"\">JupyterLab extension</th>\n  </tr>\n</thead>\n<tbody>\n  <tr background=\"#FFF\">\n    <td align=\"center\">\n      <a href=\"https://gitter.im/QuantStack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n        <img src=\"https://badges.gitter.im/Join%20Chat.svg\" alt=\"Join the Gitter Chat\"/>\n      </a>\n    </td>\n    <td align=\"center\">\n      <a href=\"https://mybinder.org/v2/gh/voila-dashboards/voila-gridstack/stable?urlpath=voila/tree/examples/scotch_dashboard.ipynb\">\n        <img src=\"https://mybinder.org/badge_logo.svg\" alt=\"Voila GridStack on Binder\"/>\n      </a>\n    </td>\n    <td align=\"center\">\n      <a href=\"https://mybinder.org/v2/gh/voila-dashboards/voila-gridstack/stable?urlpath=lab/tree/examples\">\n        <img src=\"https://mybinder.org/badge_logo.svg\" alt=\"JupyterLab on Binder\"/>\n      </a>\n    </td>\n  </tr>\n</tbody>\n</table>\n\n## Installation\n\n`voila-gridstack` can be installed with the mamba package manager\n\n```\nmamba install -c conda-forge voila-gridstack\n```\n\nor from PyPI\n\n```\npip install voila-gridstack\n```\n\n## Format\n\nThe template uses metadata defined in the notebook file (`.ipynb`) to configure the layout.\nThe specification of the metadata was defined by a now defunct project `jupyter-dashboards`.\nThe specification is described in `jupyter-dashboards`\n[docs](https://jupyter-dashboards-layout.readthedocs.io/en/latest/metadata.html).\n\nThe voila renderer behaves as a \"display-only renderer without authoring capabilitiy\" as defined in\nthe specs. However, there are a few differences compared to the original implmentation:\n\n- if no metadata is found in the notebook voil\u00e0 will render the notebook as `grid` layout,\n- it can not persist the state of the cells (i.e. the re-configuration of the layout will\n  be lost, when the user closes the voila page),\n- if the cell does not contain view configuration for the particular view type (`grid` or\n  `report`) or `hidden` attribute is not defined, voil\u00e0 will treat it as **visible**.\n\n## Usage\n\nTo use the `gridstack` template, pass option `--template=gridstack` to the `voila` command line.\n\n![voila-gridstack](assets/voila-gridstack.gif)\n\nBy default the position of cells in the dashboard will be fixed. If you want them to be draggable\nand resizable, you can launch voila with the `show_handles` resource set to `True`:\n\n```\nvoila --template=gridstack examples/ --VoilaConfiguration.resources=\"{'gridstack': {'show_handles': True}}\"\n```\n\nNote, however, that the state of the dashboard can not be persisted in the notebook.\n\nYou can change the color scheme using the `theme` resource:\n\n```\nvoila examples/ --template=gridstack --theme=dark\n```\n\n## Development\n\nTo install the template from source:\n\n```bash\n# create a new `conda` environment\nconda create -n voila-gridstack -c conda-forge notebook python\n\n# activate the environment\nconda activate voila-gridstack\n\n# install the package in development mode\npython -m pip install -e .\n\n# start voila with the gridstack template\nvoila --template=gridstack\n```\n\n### Classic Notebook Extension\n\n![voila-gridstack](assets/classic-extension.gif)\n\n`voila-gridstack` provides an extension for the classic notebook to edit the gridstack layout from the notebook interface.\n\nTo install this extension in development mode:\n\n```bash\n# activate the environment\nconda activate voila-gridstack\n\n# link the local files\njupyter nbextension install --sys-prefix --symlink --overwrite --py voila_gridstack\n\n# enable the extension\njupyter nbextension enable --sys-prefix --py voila_gridstack\n\n# check the extension is installed and enabled\njupyter nbextension list\n\n# start the notebook\njupyter notebook\n```\n\nThen edit the files in `voila-gridstack/static` and reload the page to see the changes.\n\n### JupyterLab Extension\n\n![voila-gridstack](assets/jupyterlab-gridstack.gif)\n\nNote: You will need NodeJS to build the extension package.\n\nThe `jlpm` command is JupyterLab's pinned version of\n[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use\n`yarn` or `npm` in lieu of `jlpm` below.\n\n```bash\n# activate the environment\nconda activate voila-gridstack\n\n# install JupyterLab\nmamba install -c conda-forge jupyterlab\n\n# Install package in development mode\npip install -e .\n\n# Link your development version of the extension with JupyterLab\njupyter labextension develop . --overwrite\n\n# Rebuild extension TypeScript source after making changes\njlpm run build\n```\n\nYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.\n\n```bash\n# Watch the source directory in one terminal, automatically rebuilding when needed\njlpm run watch\n# Run JupyterLab in another terminal\njupyter lab\n```\n\n## License\n\nWe use a shared copyright model that enables all contributors to maintain the\ncopyright on their contributions.\n\nThis software is licensed under the BSD-3-Clause license. See the\n[LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "BSD License  Copyright (c) 2018 Voila contributors. All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  b. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  c. Neither the name of the authors nor the names of the contributors to this package may be used to endorse or promote products derived from this software without specific prior written permission.   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "",
    "version": "0.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/voila-dashboards/voila-gridstack/issues",
        "Homepage": "https://github.com/voila-dashboards/voila-gridstack",
        "Repository": "https://github.com/voila-dashboards/voila-gridstack"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b08dfe9137905fc70590a8856c719a9e951eb4616ced10b2d7c2cfda169a8f10",
                "md5": "8ff999bc8e46da44e943bbde4a31e46c",
                "sha256": "7fb60c2bc81a7630c965909560690221e97d6478b22aab33a37c720405d6ed92"
            },
            "downloads": -1,
            "filename": "voila_gridstack-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ff999bc8e46da44e943bbde4a31e46c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 285396,
            "upload_time": "2024-02-06T20:10:28",
            "upload_time_iso_8601": "2024-02-06T20:10:28.421268Z",
            "url": "https://files.pythonhosted.org/packages/b0/8d/fe9137905fc70590a8856c719a9e951eb4616ced10b2d7c2cfda169a8f10/voila_gridstack-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad88a65deca56336093a92d957fa98d800ef74609cdb504457cd105388a9d310",
                "md5": "9cd763e184b2fa689d91046b905ce3e7",
                "sha256": "1accf0dc584cdb988ca2b83f060bc7819bc774107796302e1feca6ab00e27a12"
            },
            "downloads": -1,
            "filename": "voila_gridstack-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9cd763e184b2fa689d91046b905ce3e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1043104,
            "upload_time": "2024-02-06T20:10:31",
            "upload_time_iso_8601": "2024-02-06T20:10:31.412840Z",
            "url": "https://files.pythonhosted.org/packages/ad/88/a65deca56336093a92d957fa98d800ef74609cdb504457cd105388a9d310/voila_gridstack-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-06 20:10:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "voila-dashboards",
    "github_project": "voila-gridstack",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "voila-gridstack"
}
        
Elapsed time: 0.27786s