2017-04-11 22:24:55 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<title>Mermaid Quick Test Page</title>
|
|
|
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="mermaid">
|
|
|
|
graph TD
|
|
|
|
A[Christmas] -->|Get money| B(Go shopping)
|
|
|
|
B --> C{Let me think}
|
|
|
|
C -->|One| D[Laptop]
|
|
|
|
C -->|Two| E[iPhone]
|
|
|
|
C -->|Three| F[Car]
|
2017-12-03 03:45:55 +01:00
|
|
|
click A "index.html#link-clicked" "link test"
|
|
|
|
click B testClick "click test"
|
2018-03-14 21:36:10 +08:00
|
|
|
classDef someclass fill:#f96;
|
|
|
|
class A someclass;
|
2017-04-11 22:24:55 +08:00
|
|
|
</div>
|
2017-04-15 13:13:54 +08:00
|
|
|
|
2017-04-15 12:28:16 +08:00
|
|
|
<hr/>
|
2017-04-15 13:13:54 +08:00
|
|
|
|
|
|
|
<div class="mermaid">
|
2017-04-11 22:24:55 +08:00
|
|
|
sequenceDiagram
|
2018-03-13 10:54:39 +08:00
|
|
|
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?
|
2017-04-11 22:24:55 +08:00
|
|
|
</div>
|
2017-04-15 13:13:54 +08:00
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<div class="mermaid">
|
2017-04-11 22:24:55 +08:00
|
|
|
gantt
|
|
|
|
dateFormat YYYY-MM-DD
|
2018-03-13 14:01:44 +08:00
|
|
|
axisFormat %d/%m
|
2017-04-11 22:24:55 +08:00
|
|
|
title Adding GANTT diagram to mermaid
|
|
|
|
|
|
|
|
section A section
|
|
|
|
Completed task :done, des1, 2014-01-06,2014-01-08
|
|
|
|
Active task :active, des2, 2014-01-09, 3d
|
|
|
|
Future task : des3, after des2, 5d
|
|
|
|
Future task2 : des4, after des3, 5d
|
|
|
|
|
|
|
|
section Critical tasks
|
|
|
|
Completed task in the critical line :crit, done, 2014-01-06,24h
|
|
|
|
Implement parser and jison :crit, done, after des1, 2d
|
|
|
|
Create tests for parser :crit, active, 3d
|
|
|
|
Future task in critical line :crit, 5d
|
|
|
|
Create tests for renderer :2d
|
|
|
|
Add to mermaid :1d
|
|
|
|
|
|
|
|
section Documentation
|
|
|
|
Describe gantt syntax :active, a1, after des1, 3d
|
|
|
|
Add gantt diagram to demo page :after a1 , 20h
|
|
|
|
Add another diagram to demo page :doc1, after a1 , 48h
|
|
|
|
|
|
|
|
section Last section
|
|
|
|
Describe gantt syntax :after doc1, 3d
|
|
|
|
Add gantt diagram to demo page : 20h
|
|
|
|
Add another diagram to demo page : 48h
|
|
|
|
</div>
|
|
|
|
|
2017-04-16 17:30:40 +08:00
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<div class="mermaid">
|
2017-06-02 14:42:04 +08:00
|
|
|
gitGraph:
|
2017-04-16 17:30:40 +08:00
|
|
|
options
|
|
|
|
{
|
2017-06-02 14:42:04 +08:00
|
|
|
"nodeSpacing": 150,
|
2017-04-22 22:12:10 +08:00
|
|
|
"nodeRadius": 10
|
2017-04-16 17:30:40 +08:00
|
|
|
}
|
|
|
|
end
|
2017-06-02 14:42:04 +08:00
|
|
|
commit
|
|
|
|
branch newbranch
|
|
|
|
checkout newbranch
|
|
|
|
commit
|
|
|
|
commit
|
|
|
|
checkout master
|
|
|
|
commit
|
|
|
|
commit
|
|
|
|
merge newbranch
|
2017-04-16 17:30:40 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<div class="mermaid">
|
|
|
|
classDiagram
|
2017-06-02 14:42:04 +08:00
|
|
|
Class01 <|-- AveryLongClass : Cool
|
|
|
|
Class03 *-- Class04
|
|
|
|
Class05 o-- Class06
|
|
|
|
Class07 .. Class08
|
|
|
|
Class09 --> C2 : Where am i?
|
|
|
|
Class09 --* C3
|
|
|
|
Class09 --|> Class07
|
|
|
|
Class07 : equals()
|
|
|
|
Class07 : Object[] elementData
|
|
|
|
Class01 : size()
|
|
|
|
Class01 : int chimp
|
|
|
|
Class01 : int gorilla
|
|
|
|
Class08 <--> C2: Cool label
|
2017-04-16 17:30:40 +08:00
|
|
|
</div>
|
2017-09-10 22:29:37 +08:00
|
|
|
<script src="./mermaid.js"></script>
|
2017-04-11 22:24:55 +08:00
|
|
|
<script>
|
2018-03-13 21:17:32 +08:00
|
|
|
mermaid.initialize({
|
|
|
|
theme: 'forest',
|
|
|
|
logLevel: 3,
|
|
|
|
gantt: { axisFormat: '%m/%d/%Y' },
|
|
|
|
sequence: { actorMargin: 50 },
|
|
|
|
});
|
2017-04-11 22:24:55 +08:00
|
|
|
</script>
|
2017-12-03 03:45:55 +01:00
|
|
|
<script>
|
|
|
|
function testClick(nodeId) {
|
2017-12-26 20:58:54 +08:00
|
|
|
console.log("clicked", nodeId)
|
|
|
|
var originalBgColor = document.querySelector('body').style.backgroundColor
|
|
|
|
document.querySelector('body').style.backgroundColor = 'yellow'
|
2017-12-03 03:45:55 +01:00
|
|
|
setTimeout(function() {
|
2017-12-26 20:58:54 +08:00
|
|
|
document.querySelector('body').style.backgroundColor = originalBgColor
|
|
|
|
}, 100)
|
2017-12-03 03:45:55 +01:00
|
|
|
}
|
|
|
|
</script>
|
2017-04-11 22:24:55 +08:00
|
|
|
</body>
|
|
|
|
</html>
|