KevsRobots Learning Platform
By Kevin McAleer, 5 Minutes
You can now draw flowcharts, sequence diagrams, state diagrams, class diagrams, entity relationship diagrams, Gantt charts, timelines, pie charts, mind maps, Git graphs and quadrant charts, and style and share them all. That’s a seriously useful set of skills for documenting any project.
Here’s everything in one place to come back to.
| Diagram | First line |
|---|---|
| Flowchart | flowchart TD (or LR, BT, RL) |
| Sequence diagram | sequenceDiagram |
| State diagram | stateDiagram-v2 |
| Class diagram | classDiagram |
| Entity relationship | erDiagram |
| Gantt chart | gantt |
| Timeline | timeline |
| Pie chart | pie |
| Mind map | mindmap |
| Git graph | gitGraph |
| Quadrant chart | quadrantChart |
flowchart LR
a[Rectangle] --> b(Rounded)
b --> c([Stadium])
c --> d{Decision}
d -->|Yes| e[(Database)]
d -- No --> f((Circle))
f -.-> g[/Input or output/]
g ==> h[[Subroutine]]
flowchart LR
a[Rectangle] --> b(Rounded)
b --> c([Stadium])
c --> d{Decision}
d -->|Yes| e[(Database)]
d -- No --> f((Circle))
f -.-> g[/Input or output/]
g ==> h[[Subroutine]]
--> arrow, --- line, -.-> dotted, ==> thick, --x cross, --o circle, <--> both waysa -->|text| b or a -- text --> bsubgraph id [Title] … endclassDef name fill:#hex,stroke:#hex,color:#hex, then node:::name or class a,b nameend; add a space before IDs starting with o or x; quote labels with punctuationparticipant Pico or actor You; participant P as Long nameA->>B: request, B-->>A: reply, A-xB: lost, A-)B: no reply neededA->>+B and B-->>-A for activation barsNote right of A: text, Note over A,B: textloop, alt / else, opt … endautonumber numbers every message[*] --> First start, Last --> [*] endA --> B : event transitionstate "Long name" as Idstate Parent { ... } composite statestate pick <<choice>> decisionnote right of A … end noteclass Motor { +int speed +stop() } (methods have ())+ public, - private, # protectedParent <|-- Child inheritance, A *-- B composition, A o-- B aggregation, A --> B association, A ..> B dependencyA "1" *-- "2" B : label for numbers and labels<<abstract>> or <<interface>> annotationsA ||--o{ B : label (quote labels with spaces)|| exactly one, o| / |o zero or one, }| / |{ one or more, }o / o{ zero or moreENTITY { type name PK "comment" } with PK, FK, UK-- solid (identifying), .. dashed (non-identifying)dateFormat YYYY-MM-DD, section Name, Task :tag, id, start, length, tags done, active, crit, milestone; start with after id; excludes weekendsperiod : event : event, extra events on the next line starting with :"Label" : value, add showData to show valuesroot((Centre))commit id: "msg" tag: "v1", branch name, checkout name, merge namex-axis Low --> High, quadrant-1 top right, Point: [x, y] from 0 to 1---
title: My diagram
config:
theme: base
themeVariables:
primaryColor: "#ffd166"
lineColor: "#118ab2"
---
default, neutral, dark, forest, basethemeVariables only work properly with theme: base"#ffd166"%%{init: {"theme": "dark"}}%% on the first lineWhen a diagram won’t draw:
end.%% to find which line is the problem.Pick a project you’ve already built and give it three diagrams: one showing how it’s wired, one showing how it thinks, and one showing its history. Put them in its README, and share it with the community!
Quick quiz 1 of 3
Which first line starts a state diagram?
stateDiagram-v2 is the current version of the state diagram.Quick quiz 2 of 3
A diagram won’t draw and you can’t spot why. What’s a quick way to find the problem line?
Quick quiz 3 of 3
Which of these is a valid Gantt task?
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments