diff --git a/graphviz_python.ipynb b/graphviz_python.ipynb new file mode 100644 index 0000000..d42aa84 --- /dev/null +++ b/graphviz_python.ipynb @@ -0,0 +1,66 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "source": [ + "!pip install graphviz -Uq\n", + "\n", + "\n", + "import graphviz\n", + "\n", + "g = graphviz.Digraph('G', engine='fdp')\n", + "\n", + "g.node('A')\n", + "g.node('B')\n", + "\n", + "with g.subgraph(name='cluster0') as c0:\n", + " c0.edge('f', 'g')\n", + " c0.edge('q', 'f')\n", + " # c0.edge('f', 'A')\n", + "\n", + "g.edge('B', 'cluster0')\n", + "\n", + "g" + ], + "outputs": [ + { + "output_type": "execute_result", + "data": { + "image/svg+xml": "\n\n\n\n\n\nG\n\n\ncluster0\n\n\n\n\nA\n\nA\n\n\n\nB\n\nB\n\n\n\n\nB->__0:cluster0\n\n\n\n\n\nf\n\nf\n\n\n\ng\n\ng\n\n\n\nf->g\n\n\n\n\n\nq\n\nq\n\n\n\nq->f\n\n\n\n\n\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ], + "metadata": {} + } + ], + "metadata": { + "orig_nbformat": 4, + "language_info": { + "name": "python", + "version": "3.9.4", + "mimetype": "text/x-python", + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "pygments_lexer": "ipython3", + "nbconvert_exporter": "python", + "file_extension": ".py" + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3.9.4 64-bit ('py3': conda)" + }, + "interpreter": { + "hash": "5ddcf14c786c671500c086f61f0b66d0417d6c58ff12753e346e191a84f72b84" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file