architecture-beta
group api(cloud)[API]
service db(database)[Database] in api
service disk1(disk)[Storage] in api
service server(server)[Server] in api
service gateway(internet)[Gateway]
db:L -- R:server
disk1:T -- B:server
gateway:R --> L:server
architecture-beta
title Complex Architecture
group edge(cloud)[Edge]
group platform(server)[Platform]
group data(database)[Data]
group observability(disk)[Observability] in platform
service gateway(internet)[Gateway] in edge
service web(internet)[Web App] in edge
service api(server)[API] in edge
service auth(server)[Auth] in edge
service core(server)[Core] in platform
service cache(disk)[Cache] in platform
service queue(server)[Queue] in platform
junction hub in platform
service db(database)[Main DB] in data
service search(disk)[Search] in data
service metrics(disk)[Metrics] in observability
service logs(disk)[Logs] in observability
gateway:R --> L:web
web:R --> L:api
api:R -- L:auth
api{group}:B -[jwt]- T:core{group}
core:L -- R:queue
core:R -- L:cache
core:B -- T:hub
hub:R -- L:metrics
metrics:R -- L:logs
core{group}:R -[sql]- L:db{group}
db:B -- T:search
cache{group}:B -[replicate]- R:db{group}
block-beta
columns 2
block
id2["I am a wide one"]
id1
end
id["Next row"]
block-beta
columns 3
A["Square Block"]
B("Rounded Block")
C{"Diamond"}
block:container
columns 2
D["Nested 1"]
E["Nested 2"]
end
space
F(["Stadium"])
G --> A
B --> C
D -- "labeled" --> E
classDef blue fill:#66f,stroke:#333,stroke-width:2px;
class A blue
style B fill:#f9F,stroke:#333,stroke-width:4px
C4Context
title System Context diagram for Internet Banking System
Enterprise_Boundary(b0, "BankBoundary") {
Person(customer, "Banking Customer", "A customer of the bank")
System(banking, "Internet Banking System", "Allows customers to view accounts")
}
System_Ext(email, "E-mail System", "External e-mail system")
Rel(customer, banking, "Uses")
Rel(banking, email, "Sends e-mails", "SMTP")
C4Container
title Container diagram for Internet Banking System
System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system")
Person(customer, "Customer", "A customer of the bank, with personal bank accounts")
Container_Boundary(c1, "Internet Banking") {
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality")
Container(api, "API Application", "Java, Spring MVC", "Provides banking functionality via JSON/HTTPS API")
ContainerDb(db, "Database", "Oracle", "Stores user data, accounts, transactions")
ContainerQueue(queue, "Message Broker", "RabbitMQ", "Handles async messaging")
}
Rel(customer, spa, "Uses", "HTTPS")
Rel(spa, api, "Makes API calls to", "JSON/HTTPS")
Rel(api, db, "Reads from and writes to", "JDBC")
Rel(api, queue, "Sends messages to")
Rel(email_system, customer, "Sends e-mails to")
has
Animal
+int age
+String gender
+isMammal()
+mate()
Duck
+String beakColor
+swim()
+quack()
Fish
-int sizeInFeet
-canEat()
Zebra
+bool is_wild
+run()
Egg
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
Duck "1" *-- "many" Egg : has
Application
-config: Config
-logger: Logger
+start()
+stop()
+getStatus() : Status
Config
-settings: Map
+get(key) : any
+set(key, value)
+load(path)
Logger
-level: LogLevel
-outputs: Output[]
+debug(msg)
+info(msg)
+warn(msg)
+error(msg)
Router
-routes: Route[]
-middleware: Middleware[]
+addRoute(route)
+use(middleware)
+handle(request) : Response
Route
+path: string
+method: HttpMethod
+handler: Handler
«interface»
Middleware
+process(req, next) : Response
AuthMiddleware
-tokenService: TokenService
+process(req, next) : Response
RateLimitMiddleware
-limit: int
-window: Duration
+process(req, next) : Response
«interface»
Handler
+handle(request) : Response
UserController
-userService: UserService
+getUser(id) : User
+createUser(data) : User
+updateUser(id, data) : User
+deleteUser(id) : void
UserService
-repository: UserRepository
-cache: Cache
+findById(id) : User
+save(user) : User
+delete(id) : void
«interface»
UserRepository
+find(id) : User
+save(user) : User
+delete(id) : void
classDiagram
class Application {
-config: Config
-logger: Logger
+start()
+stop()
+getStatus() Status
}
class Config {
-settings: Map
+get(key) any
+set(key, value)
+load(path)
}
class Logger {
-level: LogLevel
-outputs: Output[]
+debug(msg)
+info(msg)
+warn(msg)
+error(msg)
}
class Router {
-routes: Route[]
-middleware: Middleware[]
+addRoute(route)
+use(middleware)
+handle(request) Response
}
class Route {
+path: string
+method: HttpMethod
+handler: Handler
}
class Middleware {
<<interface>>
+process(req, next) Response
}
class AuthMiddleware {
-tokenService: TokenService
+process(req, next) Response
}
class RateLimitMiddleware {
-limit: int
-window: Duration
+process(req, next) Response
}
class Handler {
<<interface>>
+handle(request) Response
}
class UserController {
-userService: UserService
+getUser(id) User
+createUser(data) User
+updateUser(id, data) User
+deleteUser(id) void
}
class UserService {
-repository: UserRepository
-cache: Cache
+findById(id) User
+save(user) User
+delete(id) void
}
class UserRepository {
<<interface>>
+find(id) User
+save(user) User
+delete(id) void
}
Application --> Config
Application --> Logger
Application --> Router
Router --> Route
Router --> Middleware
AuthMiddleware ..|> Middleware
RateLimitMiddleware ..|> Middleware
Route --> Handler
UserController ..|> Handler
UserController --> UserService
UserService --> UserRepository
places
contains
includes
CUSTOMER
string
name
string
PK
string
address
ORDER
int
orderNumber
PK
date
orderDate
string
status
LINE-ITEM
PRODUCT
int
id
PK
string
name
float
price
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
PRODUCT ||--o{ LINE-ITEM : includes
CUSTOMER {
string name
string email PK
string address
}
ORDER {
int orderNumber PK
date orderDate
string status
}
PRODUCT {
int id PK
string name
float price
}
places
contains
references
belongs_to
contains
has
ships_to
paid_by
CUSTOMER
uuid
id
PK
string
UK
string
name
string
phone
date
created_at
boolean
active
ORDER
uuid
id
PK
uuid
customer_id
FK
decimal
total
string
status
date
ordered_at
date
shipped_at
ORDER_ITEM
uuid
id
PK
uuid
order_id
FK
uuid
product_id
FK
int
quantity
decimal
price
PRODUCT
uuid
id
PK
string
sku
UK
string
name
text
description
decimal
price
int
stock
boolean
available
PRODUCT_CATEGORY
uuid
product_id
PK,FK
uuid
category_id
PK,FK
CATEGORY
uuid
id
PK
string
name
UK
uuid
parent_id
FK
int
sort_order
ADDRESS
uuid
id
PK
uuid
customer_id
FK
string
type
string
street
string
city
string
state
string
zip
string
country
PAYMENT
uuid
id
PK
uuid
order_id
FK
string
method
decimal
amount
string
status
date
processed_at
erDiagram
CUSTOMER ||--o{ ORDER : places
CUSTOMER {
uuid id PK
string email UK
string name
string phone
date created_at
boolean active
}
ORDER ||--|{ ORDER_ITEM : contains
ORDER {
uuid id PK
uuid customer_id FK
decimal total
string status
date ordered_at
date shipped_at
}
ORDER_ITEM }|--|| PRODUCT : references
ORDER_ITEM {
uuid id PK
uuid order_id FK
uuid product_id FK
int quantity
decimal price
}
PRODUCT ||--o{ PRODUCT_CATEGORY : belongs_to
PRODUCT {
uuid id PK
string sku UK
string name
text description
decimal price
int stock
boolean available
}
CATEGORY ||--o{ PRODUCT_CATEGORY : contains
CATEGORY {
uuid id PK
string name UK
uuid parent_id FK
int sort_order
}
PRODUCT_CATEGORY {
uuid product_id PK,FK
uuid category_id PK,FK
}
CUSTOMER ||--o{ ADDRESS : has
ADDRESS {
uuid id PK
uuid customer_id FK
string type
string street
string city
string state
string zip
string country
}
ORDER ||--|| ADDRESS : ships_to
ORDER ||--o| PAYMENT : paid_by
PAYMENT {
uuid id PK
uuid order_id FK
string method
decimal amount
string status
date processed_at
}
Data Layer
Microservices
API Gateway
Frontend Layer
Valid
Invalid
Cache Hit
Cache Miss
Web Interface
Mobile App
CLI Tool
Authentication
Rate Limiter
Redis Cache
User Service
Order Service
Payment Service
Notification Service
PostgreSQL
Elasticsearch
Message Queue
Reject Request
Return Response
Email Worker
SMS Worker
flowchart TB
subgraph Frontend["Frontend Layer"]
UI[Web Interface]
Mobile[Mobile App]
CLI[CLI Tool]
end
subgraph API["API Gateway"]
Auth{Authentication}
Rate[Rate Limiter]
Cache[(Redis Cache)]
end
subgraph Services["Microservices"]
UserSvc[User Service]
OrderSvc[Order Service]
PaymentSvc[Payment Service]
NotifySvc[Notification Service]
end
subgraph Data["Data Layer"]
DB[(PostgreSQL)]
Search[(Elasticsearch)]
Queue[(Message Queue)]
end
UI --> Auth
Mobile --> Auth
CLI --> Auth
Auth -->|Valid| Rate
Auth -->|Invalid| Reject[Reject Request]
Rate --> Cache
Cache -->|Cache Hit| Response[Return Response]
Cache -->|Cache Miss| UserSvc
UserSvc --> DB
UserSvc --> Search
OrderSvc --> DB
OrderSvc --> Queue
PaymentSvc --> DB
PaymentSvc --> NotifySvc
NotifySvc --> Queue
Queue --> EmailWorker[Email Worker]
Queue --> SMSWorker[SMS Worker]
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Planning
Requirements :a1, 2024-01-01, 7d
Design :a2, after a1, 5d
section Development
Backend :crit, b1, after a2, 10d
Frontend :b2, after a2, 8d
API Integration :b3, after b1, 3d
section Testing
Unit Tests :c1, after b2, 3d
QA :c2, after b3, 5d
gantt
title Product Launch Timeline
dateFormat YYYY-MM-DD
todayMarker off
section Research
Market Analysis :done, research1, 2024-01-01, 14d
User Interviews :done, research2, 2024-01-08, 21d
Competitor Review :done, research3, after research1, 10d
section Design
Wireframes :done, design1, after research2, 14d
Visual Design :done, design2, after design1, 21d
Prototype :active, design3, after design2, 14d
User Testing :design4, after design3, 10d
section Development
Backend API :dev1, after design1, 42d
Frontend MVP :dev2, after design2, 35d
Integration :dev3, after dev1, 14d
Performance Tuning :dev4, after dev3, 7d
section Testing
Unit Tests :test1, after dev2, 14d
Integration Tests :test2, after dev3, 10d
UAT :test3, after test2, 14d
Bug Fixes :done, crit, test4, after test3, 7d
section Launch
Beta Release :milestone, launch1, after test3, 1d
Marketing Prep :launch2, after design4, 21d
Public Launch :crit, launch3, after test4, 1d
Post-Launch Support :launch4, after launch3, 30d
section Markers
Q2 Start :vert, q2start, 2024-04-01, 1d
gitGraph
commit id:"A"
commit id:"B"
branch feature
checkout feature
commit id:"C"
checkout main
commit id:"D"
merge feature
gitGraph
commit id:"A"
commit id:"B"
branch feature
checkout feature
commit id:"C"
commit id:"D"
checkout main
commit id:"E"
merge feature
branch hotfix
checkout hotfix
commit id:"F"
checkout main
merge hotfix
commit id:"G"
branch release
checkout release
commit id:"H"
commit id:"I"
checkout main
merge release
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
journey
title E-Commerce User Journey
section Discovery
Visit homepage: 5: Customer
Search for product: 4: Customer
Browse categories: 3: Customer
section Selection
View product details: 5: Customer
Read reviews: 4: Customer
Compare prices: 3: Customer
Add to cart: 5: Customer
section Checkout
Review cart: 4: Customer
Enter shipping info: 3: Customer, System
Select payment method: 4: Customer
Complete purchase: 5: Customer, System
section Post-Purchase
Receive confirmation: 5: System
Track shipment: 4: Customer
Receive delivery: 5: Customer
Todo
In Progress
Create Documentation
Create Blog about the new diagram
Create renderer for all cases
kanban
id1[Todo]
docs[Create Documentation]
blog[Create Blog about the new diagram]
id2[In Progress]
id6[Create renderer for all cases]
Todo
In progress
Ready for deploy
Ready for test
Done
Can't reproduce
Create Documentation
Create Blog about the new diagram
Create renderer so that it works in all cases. We also add some extra text here for testing purposes.
Design grammar
knsv
Create parsing tests
MC-2038
K.Sveidqvist
define getData
Title of diagram is more than 100 chars when user duplicates diagram
MC-2036
Update DB function
MC-2037
knsv
Weird flickering in Firefox
kanban
id1[Todo]
docs[Create Documentation]
blog[Create Blog about the new diagram]
id7[In progress]
id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes.]
id8[Design grammar]@{ assigned: 'knsv' }
id9[Ready for deploy]
id10[Ready for test]
id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
id11[Done]
id5[define getData]
id2[Title of diagram is more than 100 chars when user duplicates diagram]@{ ticket: MC-2036, priority: 'Very High'}
id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }
id12[Can't reproduce]
id13[Weird flickering in Firefox]
mindmap
Origins
Long history
Research
On effectiveness
On Automatic creation
Tools
Pen and paper
Mermaid
mindmap
root((mindmap))
Origins
Long history
Research
On effectiveness
On Automatic creation
Tools
Pen and paper
Mermaid
mindmap
Origins
Long history
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness
and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid
I am a cloud
I am a bang
mindmap
root((mindmap))
Origins
Long history
::icon(fa fa-book)
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness<br/>and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid
cloud)I am a cloud(
bang))I am a bang((
packet
title Simple Packet
0-7: "Header"
8-15: "Length"
16-31: "Data"
packet
title TCP Packet Structure
0-15: "Source Port"
16-31: "Destination Port"
32-63: "Sequence Number"
64-95: "Acknowledgment Number"
96-99: "Data Offset"
100-105: "Reserved"
106: "URG"
107: "ACK"
108: "PSH"
109: "RST"
110: "SYN"
111: "FIN"
112-127: "Window"
128-143: "Checksum"
144-159: "Urgent Pointer"
160-191: "(Options and Padding)"
192-255: "Data"
pie title Project Distribution
"Development" : 40
"Testing" : 25
"Documentation" : 15
"Design" : 20
No issues detected
pie showData
title Cloud Infrastructure Costs
"Compute (EC2/GKE)" : 35
"Storage (S3/GCS)" : 18
"Database (RDS)" : 22
"Networking" : 8
"CDN & Edge" : 6
"Monitoring" : 5
"Security" : 4
"Other" : 2
No issues detected
quadrantChart
title Reach and Engagement
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
quadrantChart
title Analytics and Business Intelligence Platforms
x-axis Completeness of Vision --> x-axis-2
y-axis Ability to Execute --> y-axis-2
quadrant-1 Leaders
quadrant-2 Challengers
quadrant-3 Niche Players
quadrant-4 Visionaries
Microsoft: [0.75, 0.75] radius: 10
Salesforce: [0.55, 0.60] radius: 8
SAP: [0.70, 0.65]
IBM: [0.51, 0.40]
Oracle: [0.65, 0.55]
Qlik: [0.60, 0.45]
Tableau: [0.68, 0.72]
SAS: [0.45, 0.58]
MicroStrategy: [0.50, 0.50]
Alteryx: [0.35, 0.42]
Sisense: [0.30, 0.35]
ThoughtSpot: [0.25, 0.45]
Domo: [0.20, 0.30]
Looker: [0.55, 0.52]
Amazon: [0.80, 0.68] color: #ff9900
Google: [0.72, 0.60] color: #4285f4
radar-beta
title Skills Assessment
axis Coding, Testing, Design
axis Review["Code Review"], Docs["Documentation"]
curve TeamA["Team Alpha"]{
Coding 4, Testing 3,
Design 3, Review 4,
Docs 2
}
curve TeamB["Team Beta"]{3, 4, 4, 3, 5}
showLegend true
ticks 5
max 5
graticule polygon
radar-beta
title Programming Language Comparison
axis Performance, Ecosystem, Safety
axis Learning["Learning Curve"], Tooling, Community
curve rust["Rust"]{
Performance 5, Ecosystem 4,
Safety 5, Learning 2,
Tooling 5, Community 4
}
curve python["Python"]{
Performance 2, Ecosystem 5,
Safety 3, Learning 5,
Tooling 4, Community 5
}
curve go["Go"]{
Performance 4, Ecosystem 4,
Safety 4, Learning 4,
Tooling 5, Community 4
}
curve cpp["C++"]{5, 5, 2, 1, 3, 4}
showLegend true
ticks 5
max 5
min 0
graticule circle
<<satisfies>>
<<traces>>
<<contains>>
<<verifies>>
<<Requirement>>
test_req
ID: 1
Text: the test text.
Risk: High
Verification: Test
<<Functional Requirement>>
test_req2
ID: 1.1
Text: the second test text.
Risk: Low
Verification: Inspection
<<Performance Requirement>>
test_req3
ID: 1.2
Text: the third test text.
Risk: Medium
Verification: Demonstration
<<Element>>
test_entity
Type: simulation
<<Element>>
test_entity2
Type: word doc
Doc Ref: reqs/test_entity
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
functionalRequirement test_req2 {
id: 1.1
text: the second test text.
risk: low
verifymethod: inspection
}
performanceRequirement test_req3 {
id: 1.2
text: the third test text.
risk: medium
verifymethod: demonstration
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_entity2 - verifies -> test_req
<<satisfies>>
<<traces>>
<<contains>>
<<contains>>
<<derives>>
<<refines>>
<<verifies>>
<<Requirement>>
test_req
ID: 1
Text: the test text.
Risk: High
Verification: Test
<<Functional Requirement>>
test_req2
ID: 1.1
Text: the second test text.
Risk: Low
Verification: Inspection
<<Performance Requirement>>
test_req3
ID: 1.2
Text: the third test text.
Risk: Medium
Verification: Demonstration
<<Interface Requirement>>
test_req4
ID: 1.2.1
Text: the fourth test text.
Risk: Medium
Verification: Analysis
<<Physical Requirement>>
test_req5
ID: 1.2.2
Text: the fifth test text.
Risk: Medium
Verification: Analysis
<<Design Constraint>>
test_req6
ID: 1.2.3
Text: the sixth test text.
Risk: Medium
Verification: Analysis
<<Element>>
test_entity
Type: simulation
<<Element>>
test_entity2
Type: word doc
Doc Ref: reqs/test_entity
<<Element>>
test_entity3
Type: test suite
Doc Ref: github.com/all_the_tests
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
functionalRequirement test_req2 {
id: 1.1
text: the second test text.
risk: low
verifymethod: inspection
}
performanceRequirement test_req3 {
id: 1.2
text: the third test text.
risk: medium
verifymethod: demonstration
}
interfaceRequirement test_req4 {
id: 1.2.1
text: the fourth test text.
risk: medium
verifymethod: analysis
}
physicalRequirement test_req5 {
id: 1.2.2
text: the fifth test text.
risk: medium
verifymethod: analysis
}
designConstraint test_req6 {
id: 1.2.3
text: the sixth test text.
risk: medium
verifymethod: analysis
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
element test_entity3 {
type: "test suite"
docRef: github.com/all_the_tests
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_req3 - contains -> test_req4
test_req4 - derives -> test_req5
test_req5 - refines -> test_req6
test_entity3 - verifies -> test_req5
sankey-beta Revenue,Salaries,40 Revenue,Operations,25 Revenue,Marketing,15 Revenue,R&D,12 Revenue,Profit,8
sequenceDiagram
participant A as Alice
participant B as Bob
participant C as Server
A->>B: Hello Bob!
B-->>A: Hi Alice!
Note over A,B: Authentication
A->>+C: Login request
C-->>-A: Token
A->>B: How are you?
B-->>A: I'm good, thanks!
Note right of B: Bob thinks
sequenceDiagram
autonumber
participant User
participant Browser
participant API
participant Auth
participant DB
participant Queue
Note over User,Queue: E-Commerce Checkout Flow
User->>Browser: Click Checkout
activate Browser
Browser->>+API: POST /checkout
Note right of API: Validate cart items
API->>+Auth: Verify session
Auth->>DB: Query user
DB-->>Auth: User record
Auth-->>-API: Session valid
alt Cart Empty
API-->>Browser: Error: Empty cart
Browser-->>User: Show error
else Cart Valid
API->>+DB: Reserve inventory
par Process Payment
API->>Queue: Queue payment job
Queue-->>API: Job queued
and Send Notifications
API--)Queue: Queue email confirmation
end
DB-->>-API: Inventory reserved
loop Retry up to 3 times
API->>Queue: Check payment status
Queue-->>API: Payment pending
end
Note over API,Queue: Payment confirmed
API-->>-Browser: Order confirmed
Browser-->>User: Show confirmation
end
deactivate Browser
start
stop
error
reset
Idle
Running
Error
stateDiagram-v2
[*] --> Idle
Idle --> Running : start
Running --> Idle : stop
Running --> Error : error
Error --> Idle : reset
Error --> [*]
Start Job
Ready
Active
Validation
ResourceAlloc
Validating
Init
Done
stateDiagram-v2
%% State diagram with composite states, fork/join, and nested composites
direction TB
[*] --> Idle
state Idle {
[*] --> Ready
Ready --> Active: Start Job
}
%% Fork and join for parallel processing
state fork_state <<fork>>
state join_state <<join>>
Idle --> fork_state
fork_state --> Validation
fork_state --> ResourceAlloc
Validation --> join_state
ResourceAlloc --> join_state
join_state --> Processing
state Processing {
[*] --> Validating
Validating --> Executing
state Executing {
[*] --> Init
Init --> Done
}
}
Valid
Invalid
1 hour
Start Job
Worker Available
Success
Error
Pause Request
Resume
Cancel Request
Reset
Retry
Reset
Ready
Validating
Queued
Failed
Initializing
Executing
Finalizing
Completed
WaitingResume
Timeout
Cancelled
stateDiagram-v2
[*] --> Idle
state Idle {
[*] --> Ready
Ready --> Processing: Start Job
}
state Processing {
[*] --> Validating
Validating --> Queued: Valid
Validating --> Failed: Invalid
Queued --> Running: Worker Available
Running --> Completed: Success
Running --> Failed: Error
Running --> Paused: Pause Request
state Running {
[*] --> Initializing
Initializing --> Executing
Executing --> Finalizing
Finalizing --> [*]
}
}
state Paused {
[*] --> WaitingResume
WaitingResume --> Timeout: 1 hour
}
Paused --> Running: Resume
Paused --> Cancelled: Cancel Request
Timeout --> Cancelled
Completed --> Idle: Reset
Failed --> Idle: Retry
Cancelled --> Idle: Reset
Completed --> [*]
Cancelled --> [*]
treemap-beta
"Category A"
"Item A1": 10
"Item A2": 20
"Category B"
"Item B1": 15
"Item B2": 25
treemap-beta
"Company Budget"
"Engineering":::engineering
"Frontend": 300000
"Backend": 400000
"DevOps": 200000
"Marketing":::marketing
"Digital": 250000
"Print": 100000
"Events": 150000
"Sales":::sales
"Direct": 500000
"Channel": 300000
classDef engineering fill:#6b9bc3,stroke:#333;
classDef marketing fill:#c36b9b,stroke:#333;
classDef sales fill:#c3a66b,stroke:#333;
xychart-beta
title "Monthly Sales"
x-axis [Jan, Feb, Mar, Apr, May, Jun]
y-axis "Sales (units)" 0 --> 100
bar [20, 35, 45, 62, 78, 91]
line [15, 30, 40, 55, 70, 85]
xychart-beta
title "Website Analytics"
x-axis [Mon, Tue, Wed, Thu, Fri, Sat, Sun]
y-axis "Visitors (thousands)" 0 --> 50
bar [12, 18, 25, 22, 30, 45, 42]
line [10, 15, 20, 18, 25, 40, 38]
line [8, 12, 18, 15, 22, 35, 30]
Yes
No
Start
Decision
Action 1
Action 2
End
Round
Subroutine
Database
Circle
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
E --> F([Round])
F --> G[[Subroutine]]
G --> H[(Database)]
H o--o I((Circle))
Edge Types
All Shapes
Main Flow
Yes
No
Rectangle
Rounded
Diamond Decision
Stadium
Subroutine
Cylinder DB
Circle
Asymmetric
Parallelogram
Reverse Para
Trapezoid
Inv Trapezoid
Hexagon
Double Circle
O
P
Q
R
S
T
U
V
W
flowchart TB
subgraph main [Main Flow]
A[Rectangle] --> B(Rounded)
B --> C{Diamond Decision}
C -->|Yes| D([Stadium])
C -->|No| E[[Subroutine]]
D --> F[(Cylinder DB)]
E --> F
end
subgraph shapes [All Shapes]
G((Circle)) --> H>Asymmetric]
H --> I[/Parallelogram/]
I --> J[\Reverse Para\]
J --> K[/Trapezoid\]
K --> L[\Inv Trapezoid/]
L --> M{{Hexagon}}
M --> N(((Double Circle)))
end
subgraph edges [Edge Types]
O --> P
O --- Q
O -.- R
O -.-> S
O ==> T
O <--> U
O x--x V
O o--o W
end
F --> G
N --> O
pie title Project Distribution
"Development" : 40
"Testing" : 25
"Documentation" : 15
"Design" : 20
No issues detected
sequenceDiagram
participant A as Alice
participant B as Bob
participant C as Server
A->>B: Hello Bob!
B-->>A: Hi Alice!
Note over A,B: Authentication
A->>+C: Login request
C-->>-A: Token
A->>B: How are you?
B-->>A: I'm good, thanks!
Note right of B: Bob thinks
has
Animal
+int age
+String gender
+isMammal()
+mate()
Duck
+String beakColor
+swim()
+quack()
Fish
-int sizeInFeet
-canEat()
Zebra
+bool is_wild
+run()
Egg
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
Duck "1" *-- "many" Egg : has
start
stop
error
reset
Idle
Running
Error
stateDiagram-v2
[*] --> Idle
Idle --> Running : start
Running --> Idle : stop
Running --> Error : error
Error --> Idle : reset
Error --> [*]
places
contains
includes
CUSTOMER
string
name
string
PK
string
address
ORDER
int
orderNumber
PK
date
orderDate
string
status
LINE-ITEM
PRODUCT
int
id
PK
string
name
float
price
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
PRODUCT ||--o{ LINE-ITEM : includes
CUSTOMER {
string name
string email PK
string address
}
ORDER {
int orderNumber PK
date orderDate
string status
}
PRODUCT {
int id PK
string name
float price
}
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Planning
Requirements :a1, 2024-01-01, 7d
Design :a2, after a1, 5d
section Development
Backend :crit, b1, after a2, 10d
Frontend :b2, after a2, 8d
API Integration :b3, after b1, 3d
section Testing
Unit Tests :c1, after b2, 3d
QA :c2, after b3, 5d
<<satisfies>>
<<traces>>
<<contains>>
<<verifies>>
<<Requirement>>
test_req
ID: 1
Text: the test text.
Risk: High
Verification: Test
<<Functional Requirement>>
test_req2
ID: 1.1
Text: the second test text.
Risk: Low
Verification: Inspection
<<Performance Requirement>>
test_req3
ID: 1.2
Text: the third test text.
Risk: Medium
Verification: Demonstration
<<Element>>
test_entity
Type: simulation
<<Element>>
test_entity2
Type: word doc
Doc Ref: reqs/test_entity
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
functionalRequirement test_req2 {
id: 1.1
text: the second test text.
risk: low
verifymethod: inspection
}
performanceRequirement test_req3 {
id: 1.2
text: the third test text.
risk: medium
verifymethod: demonstration
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_entity2 - verifies -> test_req
<<satisfies>>
<<traces>>
<<contains>>
<<contains>>
<<derives>>
<<refines>>
<<verifies>>
<<Requirement>>
test_req
ID: 1
Text: the test text.
Risk: High
Verification: Test
<<Functional Requirement>>
test_req2
ID: 1.1
Text: the second test text.
Risk: Low
Verification: Inspection
<<Performance Requirement>>
test_req3
ID: 1.2
Text: the third test text.
Risk: Medium
Verification: Demonstration
<<Interface Requirement>>
test_req4
ID: 1.2.1
Text: the fourth test text.
Risk: Medium
Verification: Analysis
<<Physical Requirement>>
test_req5
ID: 1.2.2
Text: the fifth test text.
Risk: Medium
Verification: Analysis
<<Design Constraint>>
test_req6
ID: 1.2.3
Text: the sixth test text.
Risk: Medium
Verification: Analysis
<<Element>>
test_entity
Type: simulation
<<Element>>
test_entity2
Type: word doc
Doc Ref: reqs/test_entity
<<Element>>
test_entity3
Type: test suite
Doc Ref: github.com/all_the_tests
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
functionalRequirement test_req2 {
id: 1.1
text: the second test text.
risk: low
verifymethod: inspection
}
performanceRequirement test_req3 {
id: 1.2
text: the third test text.
risk: medium
verifymethod: demonstration
}
interfaceRequirement test_req4 {
id: 1.2.1
text: the fourth test text.
risk: medium
verifymethod: analysis
}
physicalRequirement test_req5 {
id: 1.2.2
text: the fifth test text.
risk: medium
verifymethod: analysis
}
designConstraint test_req6 {
id: 1.2.3
text: the sixth test text.
risk: medium
verifymethod: analysis
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
element test_entity3 {
type: "test suite"
docRef: github.com/all_the_tests
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_req3 - contains -> test_req4
test_req4 - derives -> test_req5
test_req5 - refines -> test_req6
test_entity3 - verifies -> test_req5
pie title NETFLIX
"Time spent looking for movie" : 90
"Time spent watching it" : 10
No issues detected
pie title What Voldemort doesn't have?
"FRIENDS" : 2
"FAMILY" : 3
"NOSE" : 45
No issues detected
sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
Bob-->Alice: Checking with John...
Alice->John: Yes... John, how are you?
Link text
Square Rect
Circle
Round Rect
Rhombus
graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
A
Two line
edge comment
Odd shape
Rounded
square
shape
Diamond with
line break
Rounded square shape
Square shape
Circle shape
Inner / circle
and some odd
special characters
Really long text with linebreak
in an Odd shape
,.?!+-*ز
Cyrillic
Circle shape Начало
graph TB
sq[Square shape] --> ci((Circle shape))
subgraph A
od>Odd shape]-- Two line<br/>edge comment --> ro
di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape)
di==>ro2(Rounded square shape)
end
e --> od3>Really long text with linebreak<br>in an Odd shape]
e((Inner / circle<br>and some odd <br>special characters)) --> f(,.?!+-*ز)
cyr[Cyrillic]-->cyr2((Circle shape Начало))
classDef green fill:#9f6,stroke:#333,stroke-width:2px
classDef orange fill:#f96,stroke:#333,stroke-width:4px
class sq,e green
class di orange
sequenceDiagram
loop Daily query
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
end
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop HealthCheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts<br/>prevail...
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
sequenceDiagram
participant web as Web Browser
participant blog as Blog Service
participant account as Account Service
participant mail as Mail Service
participant db as Storage
Note over web,db: The user must be logged in to submit blog posts
web->>+account: Logs in using credentials
account->>db: Query stored accounts
db->>account: Respond with query result
alt Credentials not found
account->>web: Invalid credentials
else Credentials found
account->>-web: Successfully logged in
Note over web,db: When the user is authenticated, they can now submit new posts
web->>+blog: Submit new post
blog->>db: Store post data
par Notifications
blog--)mail: Send mail to blog subscribers
blog--)db: Store in-site notifications
and Response
blog-->>-web: Successfully posted
end
end
timeline
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2005 : YouTube
2006 : Twitter
timeline
title Timeline of Industrial Revolution
section 17th-20th century
Industry 1.0 : Machinery, Water power, Steam power
Industry 2.0 : Electricity, Internal combustion engine, Mass production
Industry 3.0 : Electronics, Computers, Automation
section 21st century
Industry 4.0 : Internet, Robotics, Internet of Things
Industry 5.0 : Artificial intelligence, Big data, 3D printing
timeline
title England's History Timeline
section Stone Age
7600 BC : Britain's oldest known house was built in Orkney, Scotland
6000 BC : Sea levels rise and Britain becomes an island.
section Bronze Age
2300 BC : People arrive from Europe and settle in Britain.
: New styles of pottery and ways of burying the dead appear.
2200 BC : The last major building works are completed at Stonehenge.
: The first metal objects are made in Britain.
sankey-beta sourceNode,targetNode,10
sankey-beta a,b,8 b,c,8 c,d,8
sankey-beta a,b,8 b,c,8 c,d,8 d,e,8 x,c,4 c,y,4
sankey-beta Bio-conversion,Liquid,0.597 Bio-conversion,Losses,26.862 Bio-conversion,Solid,280.322 Bio-conversion,Gas,81.144
sankey-beta "Biofuel imports",Liquid,35 "Heating and cooling",Residential,79.329 "District heating","Heating and cooling, commercial",22.505
sankey-beta Bio-conversion,Losses,26.862 Bio-conversion,Solid,280.322 Bio-conversion,Gas,81.144
sankey-beta Pumped heat,"Heating and cooling, homes",193.026 Pumped heat,"Heating and cooling, commercial",70.672
sankey-beta Pumped heat,"Heating and cooling, ""homes""",193.026 Pumped heat,"Heating and cooling, ""commercial""",70.672
sankey-beta Agricultural 'waste',Bio-conversion,124.729 Bio-conversion,Liquid,0.597 Bio-conversion,Losses,26.862 Bio-conversion,Solid,280.322 Bio-conversion,Gas,81.144 Biofuel imports,Liquid,35 Biomass imports,Solid,35 Coal imports,Coal,11.606 Coal reserves,Coal,63.965 Coal,Solid,75.571 District heating,Industry,10.639 District heating,Heating and cooling - commercial,22.505 District heating,Heating and cooling - homes,46.184 Electricity grid,Over generation / exports,104.453 Electricity grid,Heating and cooling - homes,113.726 Electricity grid,H2 conversion,27.14 Electricity grid,Industry,342.165 Electricity grid,Road transport,37.797 Electricity grid,Agriculture,4.412 Electricity grid,Heating and cooling - commercial,40.858 Electricity grid,Losses,56.691 Electricity grid,Rail transport,7.863 Electricity grid,Lighting & appliances - commercial,90.008 Electricity grid,Lighting & appliances - homes,93.494 Gas imports,Ngas,40.719 Gas reserves,Ngas,82.233 Gas,Heating and cooling - commercial,0.129 Gas,Losses,1.401 Gas,Thermal generation,151.891 Gas,Agriculture,2.096 Gas,Industry,48.58 Geothermal,Electricity grid,7.013 H2 conversion,H2,20.897 H2 conversion,Losses,6.242 H2,Road transport,20.897 Hydro,Electricity grid,6.995 Liquid,Industry,121.066 Liquid,International shipping,128.69 Liquid,Road transport,135.835 Liquid,Domestic aviation,14.458 Liquid,International aviation,206.267 Liquid,Agriculture,3.64 Liquid,National navigation,33.218 Liquid,Rail transport,4.413 Marine algae,Bio-conversion,4.375 Ngas,Gas,122.952 Nuclear,Thermal generation,839.978 Oil imports,Oil,504.287 Oil reserves,Oil,107.703 Oil,Liquid,611.99 Other waste,Solid,56.587 Other waste,Bio-conversion,77.81 Pumped heat,Heating and cooling - homes,193.026 Pumped heat,Heating and cooling - commercial,70.672 Solar PV,Electricity grid,59.901 Solar Thermal,Heating and cooling - homes,19.263 Solar,Solar Thermal,19.263 Solar,Solar PV,59.901 Solid,Agriculture,0.882 Solid,Thermal generation,400.12 Solid,Industry,46.477 Thermal generation,Electricity grid,525.531 Thermal generation,Losses,787.129 Thermal generation,District heating,79.329 Tidal,Electricity grid,9.452 UK land based bioenergy,Bio-conversion,182.01 Wave,Electricity grid,19.013 Wind,Electricity grid,289.366