CoLoMoTo helper functions for Juypter integration
Project description
CoLoMoTo helper functions for Juypter integration
-------------------------------------------------
Provides helper functions for integration in the CoLoMoTo Jupyter notebook.
It currently provides:
* injection of menus and toolbars
* interactive file upload
* formatter for ``networkx`` graphs
See also https://github.com/colomoto/colomoto-docker
Quick usage guide
=================
.. code:: python
from colomoto_jupyter import IN_IPYHON, jupyter_setup
if IN_IPYTHON:
# menu specification (list of dict), optional
menu = [
{"name": "entry 1",
"snippet": ["code to be append to the current ceull"]},
"---", # separation
{"name": "submenu 1",
"sub-menu": [
{"name": "entry 2",
"snippet": ["code example"]},
]}
]
# toolbar specification (list of dict), optional
toolbar = [
{"name": "Label",
"setup": {
"icon": "fa-something",
"help": "tooltip text",
"handler": "javascript_function_1"}}
]
## additional javascript functions, optional
js_api = """
javascript_function_1: function () {
alert("plop");
},
javascript_function_2: function () {
alert("foo");
}
"""
jupyter_setup("mymodule",
label="My module",
color="blue", # for menu and toolbar
menu=menu,
toolbar=toolbar,
js_api=js_api)
See
`demo_tool.py<https://github.com/colomoto/colomoto-api/blob/master/colomoto_jupyter/demo_tool.py>`_ for a more complete usage example.
-------------------------------------------------
Provides helper functions for integration in the CoLoMoTo Jupyter notebook.
It currently provides:
* injection of menus and toolbars
* interactive file upload
* formatter for ``networkx`` graphs
See also https://github.com/colomoto/colomoto-docker
Quick usage guide
=================
.. code:: python
from colomoto_jupyter import IN_IPYHON, jupyter_setup
if IN_IPYTHON:
# menu specification (list of dict), optional
menu = [
{"name": "entry 1",
"snippet": ["code to be append to the current ceull"]},
"---", # separation
{"name": "submenu 1",
"sub-menu": [
{"name": "entry 2",
"snippet": ["code example"]},
]}
]
# toolbar specification (list of dict), optional
toolbar = [
{"name": "Label",
"setup": {
"icon": "fa-something",
"help": "tooltip text",
"handler": "javascript_function_1"}}
]
## additional javascript functions, optional
js_api = """
javascript_function_1: function () {
alert("plop");
},
javascript_function_2: function () {
alert("foo");
}
"""
jupyter_setup("mymodule",
label="My module",
color="blue", # for menu and toolbar
menu=menu,
toolbar=toolbar,
js_api=js_api)
See
`demo_tool.py<https://github.com/colomoto/colomoto-api/blob/master/colomoto_jupyter/demo_tool.py>`_ for a more complete usage example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
colomoto_jupyter-0.1.tar.gz
(7.1 kB
view details)
File details
Details for the file colomoto_jupyter-0.1.tar.gz
.
File metadata
- Download URL: colomoto_jupyter-0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86f44a0a7ce3303b8ac088baef8502c25e047722991ebf31f12c40809f2e0cd6 |
|
MD5 | 4ee7d86b8073fac9f2f71a2370db0e56 |
|
BLAKE2b-256 | be9bf1dba8bbd87d6efafa99237af20f205395af8d313c620c7c39d75b7235e7 |