innovationOUtside / ipython_magic_blockdiag

IPython Magic for Displaying blockdiag family of diagrams in Jupyter notebooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ipython_magic_blockdiag

IPython Magic for Displaying blockdiag family of diagrams in Jupyter notebooks

Install from PyPy: pip install blockdiagMagic

Install from this repo as:

pip install --upgrade git+https://github.com/innovationOUtside/ipython_magic_blockdiag.git

(Use %pip install --upgrade git+https://github.com/innovationOUtside/ipython_magic_blockdiag.git from a notebook code cell.)

Binder

%load_ext blockdiag_magic

By defaul, PNG is generated.

Higher quality SVG is available, but in this magic, this requires inkscape. (The original blockdiag package was updated to use imagemagick for SVG rendering so this magic meeds updating to make use of that.)

%setdiagsvg
#Reset to png output with: %setdiagpng
#For inline png
#%setdiagpng
%%blockdiag
A -> B -> C;
B -> D;

Save file:

%%blockdiag -o myfile.svg

  top_page -> config -> config_edit -> config_confirm -> top_page;

Then render:

from IPython.display import SVG
SVG('myfile.svg')

About

IPython Magic for Displaying blockdiag family of diagrams in Jupyter notebooks


Languages

Language:Jupyter Notebook 66.6%Language:Python 33.4%