IPython/Jupyter notebook magic for generating JS flowcharts.
Project description
flowchart_js_jp_proxy_widget
jp_proxy_widget class wrapper for flowchart.js
We can also script the production of the flowchart:
from jp_flowchartjs.jp_flowchartjs import FlowchartWidget
fcode='''
st=>start: Start
e=>end: End
op1=>operation: Generate
op2=>parallel: Evaluate
st(right)->op1(right)->op2
op2(path1, top)->op1
op2(path2, right)->e
'''
testEmbed = FlowchartWidget()
testEmbed.charter(fcode)
testEmbed
- return SVG embed:
testEmbed.embed_svg()
- return SVG data:
testEmbed.get_svg()
- return PNG embed:
testEmbed.embed_png()
- return PNG raw:
testEmbed.getpng()
- oneliner return SVG:
FlowchartWidget().charter(fcode, embed=True)
We can also define a really simple magic:
from IPython.core.magic import register_cell_magic
@register_cell_magic
def flowchart_magic(line, cell):
"Send code to simulator."
return FlowchartWidget().charter(cell, embed=True)
and then call as:
%%flowchart_magic
st=>start: Start
e=>end: End
op1=>operation: Generate
op2=>parallel: Evaluate
st(right)->op1(right)->op2
op2(path1, top)->op1
op2(path2, right)->e
If you import jp_flowchartjs.jp_flowchartjs
the magic will be available.
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
jp_flowchartjs-0.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for jp_flowchartjs-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71c8bd5391bbf1915c37d04431ef378799283bbcd56487a77b7a4c971b049dc1 |
|
MD5 | e65c4c03b0895ddc8934525ba28c61a0 |
|
BLAKE2b-256 | 2090b51befb21d604fdbaffff8185d2ef05ef1aa6a6daf61a4ebd58b5f61e50d |