Diagramming as Code

Carl Chesser
@che55er | che55er.io

graphviz

License: Common Public License Version 1.0

                        
                            digraph G {
                                rankdir="LR"
                                db[shape="cylinder"];
                                a -> b -> db;
                                b -> c -> db;
                            }
                        
                    

Mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
๐Ÿ“„ License: MIT
โœจ Popular โœจ

Mermaid Example

                        
                        flowchart LR
                            a --> b --> id1[(d)]
                            b --> c
                            c --> id1[(d)]
                        
                    
                          %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
                          flowchart LR
                            a --> b --> id1[(d)]
                            b --> c
                            c --> id1[(d)]
                        

Mermaid

Support for many different types of diagrams.

๐Ÿช„

Mermaid Integrations

VSCode GitHub

Mermaid

Even understood by generative systems (ChatGPT).

Diagrams

๐Ÿ Python package
๐Ÿ“„ License: Mozilla
๐Ÿ”Œ Utilizes graphviz

Diagrams

                            
                                from diagrams import Diagram
                                from diagrams.aws.compute import EC2
                                from diagrams.aws.database import RDS
                                from diagrams.aws.network import ELB
                                
                                with diagrams.Diagram("services"):
                                    b_service = EC2("b")
                                    db = RDS("db") 
                                    ELB("a") >> b_service >> db
                                    b_service >> EC2("c") >> db
                            
                        

Diagrams

Large inventory of iconography.

D2

๐Ÿ“„ License: Mozilla

D2 - Example

                        
                            direction: right
                            a -> b -> db
                            b -> c -> db
                            db.shape: cylinder 
                        
                    

D2

Different styles with animated flows!

draw.io

โœ๏ธ Some visuals need manual manipulation.
๐Ÿ‘จโ€๐Ÿ’ป Can use draw.io Desktop + source control changes.
๐Ÿ“„ License: Apache License 2.0

draw.io - Advanced Imports

You can import diagrams through text and then edit!

โœ…

Recap

  • graphviz
  • Mermaid
  • Diagrams
  • D2
  • draw.io

Thank you! ๐ŸŽ‰

Carl Chesser
@che55er | che55er.io