IPython Magic Functions
Install:
%install_ext https://raw.githubusercontent.com/bornio/ipython-magic/master/gvmagic.py
%load_ext gvmagic- Graphviz Magics (
gvmagic.py):%dot,%dotstr,%dotobj,%dotobjs
%dot- line/cell magic converts raw input to GraphvizdotSVG output.%dotstr- line magic converts string input to GraphvizdotSVG output.%dotobj- line magic converts object withto_dotmethod to GraphvizdotSVG output.%dotobjs- line magic converts sequence of objects withto_dotmethod to GraphvizdotSVG output.
Examples:
%dot digraph G { a -> b; a -> c }
%%dot digraph G {
a -> b;
b -> c;
}
%dotstr "digraph G { a -> b; a -> c }"
%dotobj dotobj.to_dot()
%dotobjs dotojb[0].to_dot(), dotobj[1].to_dot(), ...