mermaid/dist/index.html

121 lines
2.7 KiB
HTML
Raw Normal View History

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]
click A "index.html#link-clicked" "link test"
click B testClick "click test"
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
loop every day
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
end
</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
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>
2017-09-12 23:13:49 +08:00
mermaid.initialize({startOnLoad: true, theme: 'forest'});
2017-04-11 22:24:55 +08:00
</script>
<script>
function testClick(nodeId) {
console.log("clicked", nodeId);
var originalBgColor = document.querySelector('body').style.backgroundColor;
document.querySelector('body').style.backgroundColor = 'yellow';
setTimeout(function() {
document.querySelector('body').style.backgroundColor = originalBgColor;
}, 100);
}
</script>
2017-04-11 22:24:55 +08:00
</body>
</html>