Skip to content

Commit

Permalink
add jupiter notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
emil-balashov committed Dec 5, 2019
1 parent 89eb1b0 commit 0c12ce3
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions demo/process.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true,
"pycharm": {
"is_executing": false
}
},
"outputs": [
{
"data": {
"text/plain": "<graphviz.dot.Digraph at 0x10f2c92b0>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n -->\n<!-- Title: Invoice Process Pages: 1 -->\n<svg width=\"324pt\" height=\"316pt\"\n viewBox=\"0.00 0.00 324.00 316.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 312)\">\n<title>Invoice Process</title>\n<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-312 320,-312 320,4 -4,4\"/>\n<g id=\"clust1\" class=\"cluster\"><title>cluster_140237385408888</title>\n<polygon fill=\"none\" stroke=\"black\" points=\"74.9855,-89.735 74.9855,-307.735 315.985,-307.735 315.985,-89.735 74.9855,-89.735\"/>\n<text text-anchor=\"middle\" x=\"195.485\" y=\"-292.535\" font-family=\"Times,serif\" font-size=\"14.00\">Invoice Process</text>\n</g>\n<!-- draft -->\n<g id=\"node1\" class=\"node\"><title>draft</title>\n<ellipse fill=\"white\" stroke=\"black\" cx=\"263.224\" cy=\"-115.376\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"263.224\" y=\"-111.176\" font-family=\"Times,serif\" font-size=\"14.00\">draft</text>\n</g>\n<!-- 4522987472 -->\n<g id=\"node4\" class=\"node\"><title>4522987472</title>\n<polygon fill=\"lightgrey\" stroke=\"black\" points=\"129.675,-98.2677 129.675,-134.268 190.765,-134.268 190.765,-98.2677 129.675,-98.2677\"/>\n<text text-anchor=\"middle\" x=\"160.22\" y=\"-112.068\" font-family=\"Times,serif\" font-size=\"14.00\">approve</text>\n</g>\n<!-- draft&#45;&gt;4522987472 -->\n<g id=\"edge1\" class=\"edge\"><title>draft&#45;&gt;4522987472</title>\n<path fill=\"none\" stroke=\"black\" d=\"M236.161,-115.61C225.465,-115.703 212.939,-115.811 201.179,-115.913\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"201.076,-112.414 191.107,-116 201.137,-119.413 201.076,-112.414\"/>\n</g>\n<!-- 4523106432 -->\n<g id=\"node6\" class=\"node\"><title>4523106432</title>\n<polygon fill=\"lightgrey\" stroke=\"black\" points=\"208.809,-187.622 208.809,-223.622 262.809,-223.622 262.809,-187.622 208.809,-187.622\"/>\n<text text-anchor=\"middle\" x=\"235.754\" y=\"-201.422\" font-family=\"Times,serif\" font-size=\"14.00\">void</text>\n</g>\n<!-- draft&#45;&gt;4523106432 -->\n<g id=\"edge2\" class=\"edge\"><title>draft&#45;&gt;4523106432</title>\n<path fill=\"none\" stroke=\"black\" d=\"M257.807,-133.206C253.965,-145.854 248.731,-163.086 244.332,-177.567\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"240.866,-176.935 241.308,-187.52 247.564,-178.969 240.866,-176.935\"/>\n</g>\n<!-- paid -->\n<g id=\"node2\" class=\"node\"><title>paid</title>\n<ellipse fill=\"white\" stroke=\"black\" cx=\"164.224\" cy=\"-250.376\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"164.224\" y=\"-246.176\" font-family=\"Times,serif\" font-size=\"14.00\">paid</text>\n</g>\n<!-- void -->\n<g id=\"node3\" class=\"node\"><title>void</title>\n<ellipse fill=\"white\" stroke=\"black\" cx=\"281.224\" cy=\"-259.376\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"281.224\" y=\"-255.176\" font-family=\"Times,serif\" font-size=\"14.00\">void</text>\n</g>\n<!-- approved -->\n<g id=\"node8\" class=\"node\"><title>approved</title>\n<polygon fill=\"none\" stroke=\"black\" points=\"28.6781,-0.982333 28.6781,-36.9823 96.7679,-36.9823 96.7679,-0.982333 28.6781,-0.982333\"/>\n<text text-anchor=\"middle\" x=\"62.723\" y=\"-14.7823\" font-family=\"Times,serif\" font-size=\"14.00\">approved</text>\n</g>\n<!-- 4522987472&#45;&gt;approved -->\n<g id=\"edge4\" class=\"edge\"><title>4522987472&#45;&gt;approved</title>\n<path fill=\"none\" stroke=\"black\" d=\"M141.882,-97.9691C126.766,-82.886 105.155,-61.322 88.3314,-44.5352\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"90.5302,-41.7848 80.9792,-37.1989 85.5858,-46.7399 90.5302,-41.7848\"/>\n</g>\n<!-- 4522986800 -->\n<g id=\"node5\" class=\"node\"><title>4522986800</title>\n<polygon fill=\"lightgrey\" stroke=\"black\" points=\"82.8814,-162.717 82.8814,-198.717 200.751,-198.717 200.751,-162.717 82.8814,-162.717\"/>\n<text text-anchor=\"middle\" x=\"141.816\" y=\"-176.517\" font-family=\"Times,serif\" font-size=\"14.00\">send_to_customer</text>\n</g>\n<!-- sent -->\n<g id=\"node9\" class=\"node\"><title>sent</title>\n<polygon fill=\"none\" stroke=\"black\" points=\"-0.395785,-169.718 -0.395785,-205.718 53.6042,-205.718 53.6042,-169.718 -0.395785,-169.718\"/>\n<text text-anchor=\"middle\" x=\"26.3801\" y=\"-183.518\" font-family=\"Times,serif\" font-size=\"14.00\">sent</text>\n</g>\n<!-- 4522986800&#45;&gt;sent -->\n<g id=\"edge5\" class=\"edge\"><title>4522986800&#45;&gt;sent</title>\n<path fill=\"none\" stroke=\"black\" d=\"M82.86,-184.3C76.4933,-184.686 70.1485,-185.072 64.1371,-185.437\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"63.513,-181.968 53.7437,-186.069 63.9376,-188.956 63.513,-181.968\"/>\n</g>\n<!-- voided -->\n<g id=\"node7\" class=\"node\"><title>voided</title>\n<polygon fill=\"none\" stroke=\"black\" points=\"223.1,-34.3254 223.1,-70.3254 277.203,-70.3254 277.203,-34.3254 223.1,-34.3254\"/>\n<text text-anchor=\"middle\" x=\"250.152\" y=\"-48.1254\" font-family=\"Times,serif\" font-size=\"14.00\">voided</text>\n</g>\n<!-- 4523106432&#45;&gt;voided -->\n<g id=\"edge3\" class=\"edge\"><title>4523106432&#45;&gt;voided</title>\n<path fill=\"none\" stroke=\"black\" d=\"M237.511,-187.435C239.98,-161.043 244.579,-111.885 247.497,-80.7022\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"251.005,-80.7714 248.452,-70.4888 244.036,-80.1193 251.005,-80.7714\"/>\n</g>\n<!-- approved&#45;&gt;4522986800 -->\n<g id=\"edge6\" class=\"edge\"><title>approved&#45;&gt;4522986800</title>\n<path fill=\"none\" stroke=\"black\" d=\"M71.6422,-37.221C85.4679,-65.4927 112.162,-120.079 128.345,-153.171\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"125.271,-154.852 132.808,-162.297 131.559,-151.776 125.271,-154.852\"/>\n</g>\n</g>\n</svg>\n"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from IPython.display import display\n",
"from demo.process import InvoiceProcess\n",
"from django_logic.draw import get_graph_from_process\n",
"\n",
"\n",
"display(get_graph_from_process(InvoiceProcess, 'draft'))\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
},
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit 0c12ce3

Please sign in to comment.