From e2d5601e5d806f6c7c0075ab51764bd3d5cb39a9 Mon Sep 17 00:00:00 2001 From: mingrammer Date: Fri, 14 Feb 2020 00:22:37 +0900 Subject: [PATCH] docs: update diagram options --- docs/diagram.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/diagram.md b/docs/diagram.md index 1489542..0b8589d 100644 --- a/docs/diagram.md +++ b/docs/diagram.md @@ -23,7 +23,7 @@ And if you run the above script with below command, ```shell $ python diagram.py -``` +``` It will generate an image file with single `EC2` node drawn as `simple_diagram.png` on your working directory, and open that created image file immediately. @@ -49,5 +49,21 @@ from diagrams.aws.compute import EC2 with Diagram("Simple Diagram", show=False): EC2("web") -``` - \ No newline at end of file +``` + +If you are familiar with Graphviz, you can customize the diagrams with Graphviz attribute config options. + +> `graph_attr`, `node_attr` and `edge_attr` are allowed. Here is a [reference link](https://www.graphviz.org/doc/info/attrs.html). + +```python +from diagrams import Diagram +from diagrams.aws.compute import EC2 + +graph_attr = { + "fontsize": 45, + "bgcolor": "transparent" +} + +with Diagram("Simple Diagram", show=False, graph_attr=graph_attr): + EC2("web") +```