Static Interactive Figures for Jupyter Notebooks
Generate interactive figures in Jupyter which solely depend on JavaScript and can be exported to static HTML webpages. Forked from https://github.com/jakevdp/ipywidgets-static
See HTML example here
Install:
pip install staticinteract
I really liked the functionality provided by the, now abandoned, project ipywidgets-static. Contrary to what it is stated in the original repo, iPython's ipywidgets do not provide the same functionality of ipywidgets-static (as far as I know, that is). Specifically, iPython's ipywigets depend on an active Jupyter kernel to work. Thus, interactive figures do not work in situations where there isn't any kernel to support them, such as when displaying the notebook as a webpage after converting it to HTML.
I find it very useful to be able to maintain interactivity of figures in HTML-displayed notebooks. For instance, to share scientific results with colleagues. For this reason I have added some new features to the original project and made it into this package so it's easier to install.
These are the main additions:
- First, I updated the code to be compatible with python 3 since I do not use python 2, and it's doomed to disappear anyways.
- I added the possibility to store the generated images in a folder instead of embedding them in the notebook. Embedding the images within the notebook makes sense for small interactive plots, i.e., ones which do not generate many images. However, in larger ones the notebook gets soon saturated with embedded images, it's slow to load or simply won't load properly. To solve this issue, images can now be stored outside the notebook, as png files, and are imported to the notebook when called by the interactive plot.
- In the previous version, StaticInteract would write the same JavaScript code to the notebook cell where it was called. I find this repetitive and unnecessary, moreover prone to errors due to declaring more than once the same JavaScript variables when multiple interactive plots are done in a single notebook. To solve this issue, this part of JavaScript code is now embedded in the notebook only at the beginning, when the module is imported.
NOTE: The notebook needs to be trusted for interactive figures to work, since untrusted notebooks do not run embedded JavaScript code. Once the Notebook is exported to HTML, interactive figures will continue to work.
Metadata
Release files for staticinteract 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| staticinteract-0.0.3.tar.gz | 7.1 kB | Without provenance | Details for staticinteract-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| staticinteract-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for staticinteract-0.0.3-py3-none-any.whl |
Total release size: 15.0 kB
Release files / staticinteract-0.0.3.tar.gz
| Download URL | staticinteract-0.0.3.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1133ddd7cfebf0100056502840bf117bbef3ba44ea2253e3272f8fd837b42bd2
|
|
BLAKE2b-256 checksum How to use checksums |
af69c142ca9b8d2a2ca2a118717100831cd2bae368a2a453774071bf28ddb7c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.6.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
|
Release files / staticinteract-0.0.3-py3-none-any.whl
| Download URL | staticinteract-0.0.3-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
766354601fa7a5b2287af66620ceb6ad8a0e3032710ca1dcf52273ebb4beb91a
|
|
BLAKE2b-256 checksum How to use checksums |
aaa9ae13b841e06f2890fe1bc03b59c7e39e2689799e24de09ea8c831266c8db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.6.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
|
Security for staticinteract 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.