No project description provided
Project description
jupyter_anywidget_graphviz
Jupyter anywidget
for rendering diagrams from .dot
language to SVG using Graphviz Wasm (hpcc-systems/hpcc-js-wasm
).
Install as:
pip install jupyter_anywidget_graphviz
Usage
This runs in a browser based Jupyter environment and uses the browser machinery to run the wasm application.
# Import package
from jupyter_anywidget_graphviz import graphviz_headless, graphviz_panel
# Create a headless widget
# - works in: Jupyter Lab, Jupyter Notebook, VS Code
g = graphviz_headless()
# Create a widget panel with a handle
# - uses jupyter sidecar (Jupyter Lab only)
#g = graphviz_panel()
# Load magic
%load_ext jupyter_anywidget_graphviz
We can now write dot
code in a magicked code cell (%%graphviz_magic WIDGET_HANDLE
):
%%graphviz_magic g
strict graph {
a -- b
a -- b
b -- a [color=blue]
}
The output is previewed in the UI panel, if rendered.
Retrieve the SVG diagram as WIDGET_HANDLE.svg
.
We can display the diagram in the notebook e.g. as:
from IPython.display import SVG
SVG(g.svg)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jupyter_anywidget_graphviz-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36903cd920b433a571e9710771fb3f441cb920db3dc9db3f52cbaf96d2a47620 |
|
MD5 | cf06bba913ebdde27163c31d73cf1dc3 |
|
BLAKE2b-256 | 2502f32e5f0744612fca676365a5461e74c862f2a1e6343ecf7083a78f234886 |
Close
Hashes for jupyter_anywidget_graphviz-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 221e8e4acb7104654f9f9437682097ba2867ce8e5a453251aa790dc9a1e5243d |
|
MD5 | eb94b939aeabdaf02315611586ab1b35 |
|
BLAKE2b-256 | fec882dc6501ae854108eb40d498a9fa9c1deb6ffc7c25adfc65e1d3f8f8b9cf |