Diagram

  • True your code to beautiful diagrams
  1. Markmap
    • Markdown language to diagram
  2. Diagrams
    • Draw the cloud system architecture in Python code.
  3. DBML
    • Database Markup Language

1. Markmap

# markmap

## Links

- <https://markmap.js.org/>
- [GitHub](https://github.com/gera2ld/markmap)

## Related Projects

- [coc-markmap](https://github.com/gera2ld/coc-markmap)
- [gatsby-remark-markmap](https://github.com/gera2ld/gatsby-remark-markmap)

## Features

- links
- **strong** ~~del~~ *italic* ==highlight==
- multiline
  text
- `inline code`
-
    ```js
    console.log('code block');
    ```
- Katex
  - $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
  - [More Katex Examples](#?d=gist:gera2ld/af76a4c245b302206b16aec503dbe07b:katex.md)
- Now we can wrap very very very very long text based on `maxWidth` option
  • The above text will trun as below: SGV or HTML Image

2. Diagrams

  • Turn python code into cloud system architecture diagrams
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Grouped Workers", show=False, direction="TB"):
    ELB("lb") >> [EC2("worker1"),
                  EC2("worker2"),
                  EC2("worker3"),
                  EC2("worker4"),
                  EC2("worker5")] >> RDS("events")
  • The above text will trun as below: SGV or HTML Image

3. DBML - Database Markup Language

  • DBML comes with:
    • A free database visualiser at dbdiagram.io
    • A free database documentation builder at dbdocs.io
    • A command-line tool to help to convert SQL to DBML files and vice versa.
    • An open-source JS library (NPM package) for you to programmatically convert between DBML and SQL DDL.
  • DBML is being open-sourced on Github
Table User {
  ID integer
  email varchar
  FName varchar
}
Table Aadhar {
  ID integer
  aadhar_no integer
  user_id integer
}
Ref: "User"."ID" - "Aadhar"."user_id"  // one-to-one
Table Post {
  ID integer
  Title char
  user_id integer
}
Ref: ""Post"."user_id" > "User"."ID" // many-to-one
Table Publication {
  ID integer
  Heading varchar
}
Table Article {
  ID integer
  Title char
  publication_id integer 
}
Ref: "Publication"."ID" <> "Article"."publication_id"  // many-to-many
  • The above commands are used to create this table dbdiagram.io sample

4

https://app.eraser.io/dashboard/all