Mermaid 學習筆記
每一種圖的語法都不太一樣,請先確認需要的圖再進行撰寫
Flowchart
flowchart TD
Entry[入口] --> checkMoney{檢查餘額}
checkMoney --> |Money >= 100| Success[成功]
checkMoney --> |Money < 100| Failed[失敗]
Requirement Diagram
requirementDiagram
requirement MainPage {
id: mainpage
text: "主要活動頁面"
risk: High
verifymethod: Inspection
}
requirement SorryPage {
id: sorrypage
text: "錯誤頁面"
risk: High
verifymethod: Inspection
}
functionalRequirement CheckEventTime {
id: check event time
text: "檢查活動時間"
risk: High
verifymethod: Test
}
element EventTime {
type: DateFormat
docref: "define/eventtime"
}
MainPage - contains -> CheckEventTime
CheckEventTime - verifies -> EventTime
CheckEventTime - derives -> SorryPage
Class Diagram
classDiagram
class Animal {
+String name
+Number age
+run() void
}
class Dog {
+bite()
}
class Zoo {
+List~Animal~ animals
+add(newAnimal) void
+remove(targetAnimal) void
}
%% Dog 繼承 Animal
Dog --|> Animal
%% Zoo 依賴 Animal
Zoo ..> Animal
PieChart
pie title WeeklyReport
"Working" : 80
"Toilet" : 5
"Sleeping" : 15