2020-08-16 08:45:44 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link
|
|
|
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
|
|
|
rel="stylesheet"
|
|
|
|
/>
|
|
|
|
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
|
|
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
/* background: rgb(221, 208, 208); */
|
2021-09-16 20:43:10 +02:00
|
|
|
/* background:#333; */
|
2020-08-16 08:45:44 +02:00
|
|
|
font-family: 'Arial';
|
2021-04-26 19:08:16 +02:00
|
|
|
/* font-size: 18px !important; */
|
2021-09-18 08:03:34 +02:00
|
|
|
width: 100%;
|
2022-02-03 19:54:24 +01:00
|
|
|
display: flex;
|
2020-08-16 08:45:44 +02:00
|
|
|
}
|
|
|
|
h1 { color: grey;}
|
2021-05-16 08:36:30 +02:00
|
|
|
.mermaid2,.mermaid3 {
|
2020-08-16 08:45:44 +02:00
|
|
|
display: none;
|
|
|
|
}
|
2021-01-21 21:20:35 +01:00
|
|
|
.mermaid svg {
|
2021-04-26 19:08:16 +02:00
|
|
|
/* font-size: 18px !important; */
|
2021-01-21 21:20:35 +01:00
|
|
|
}
|
2020-08-16 08:45:44 +02:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-01-21 17:17:31 +01:00
|
|
|
|
2022-04-28 18:45:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-03 19:54:24 +01:00
|
|
|
<div class="mermaid" style="width: 50%;">
|
2022-05-10 17:45:16 +02:00
|
|
|
graph TD
|
|
|
|
A -->|000| B
|
|
|
|
B -->|111| C
|
2022-04-28 18:45:18 +02:00
|
|
|
|
2022-05-10 17:45:16 +02:00
|
|
|
linkStyle 1 stroke:#ff3,stroke-width:4px,color:red;
|
2022-04-28 18:45:18 +02:00
|
|
|
</div>
|
2022-01-21 17:17:31 +01:00
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
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: 5: Me
|
|
|
|
</div>
|
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
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_req <- copies - test_entity2
|
|
|
|
</div>
|
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
erDiagram
|
|
|
|
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
|
|
|
|
CUSTOMER ||--o{ ORDER : places
|
|
|
|
CUSTOMER ||--o{ INVOICE : "liable for"
|
|
|
|
DELIVERY-ADDRESS ||--o{ ORDER : receives
|
|
|
|
INVOICE ||--|{ ORDER : covers
|
|
|
|
ORDER ||--|{ ORDER-ITEM : includes
|
|
|
|
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
|
|
|
|
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
|
|
|
|
</div>
|
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
graph TB
|
|
|
|
subgraph One
|
|
|
|
a1-->a2-->a3
|
|
|
|
end
|
|
|
|
</div>
|
2022-01-28 14:45:43 +01:00
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
gantt
|
|
|
|
dateFormat YYYY-MM-DD
|
|
|
|
axisFormat %d/%m
|
|
|
|
title Adding GANTT diagram to mermaid
|
|
|
|
excludes weekdays 2014-01-10
|
|
|
|
|
|
|
|
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 Clickable
|
|
|
|
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
|
|
|
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
|
|
|
Calling a Callback with args :cl3, after cl1, 3d
|
|
|
|
|
|
|
|
click cl1 href "https://mermaid-js.github.io/mermaid/#/"
|
|
|
|
click cl2 call clickByGantt()
|
|
|
|
click cl3 call clickByGantt("test1", test2, test3)
|
|
|
|
|
|
|
|
section Last section
|
|
|
|
Describe gantt syntax :after doc1, 3d
|
|
|
|
Add gantt diagram to demo page : 20h
|
|
|
|
Add another diagram to demo page : 48h
|
|
|
|
</div>
|
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
classDiagram
|
|
|
|
Class01 <|-- AveryLongClass : Cool
|
|
|
|
Class09 --> C2 : Where am i?
|
|
|
|
Class09 --* C3
|
|
|
|
Class09 --|> Class07
|
|
|
|
Class07 : equals()
|
|
|
|
Class07 : Object[] elementData
|
|
|
|
Class01 : size()
|
|
|
|
Class01 : int chimp
|
|
|
|
Class01 : int gorilla
|
|
|
|
class Class10 {
|
|
|
|
int id
|
|
|
|
size()
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
<div class="mermaid2" style="width: 100%;">
|
2022-01-21 17:17:31 +01:00
|
|
|
stateDiagram
|
|
|
|
[*] --> S1
|
|
|
|
state "Some long name" as S1
|
|
|
|
</div>
|
|
|
|
<div class="mermaid2" style="width: 100%;">
|
|
|
|
classDiagram
|
|
|
|
Animal "1" <|-- Duck
|
|
|
|
Animal <|-- Fish
|
|
|
|
Animal <--o 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()
|
|
|
|
}
|
2022-01-20 19:37:52 +01:00
|
|
|
</div>
|
2021-06-06 11:37:23 +02:00
|
|
|
|
2020-08-16 08:45:44 +02:00
|
|
|
<script src="./mermaid.js"></script>
|
|
|
|
<script>
|
|
|
|
mermaid.parseError = function (err, hash) {
|
2021-12-05 00:28:40 +01:00
|
|
|
// console.error('Mermaid error: ', err);
|
|
|
|
};
|
2020-08-16 08:45:44 +02:00
|
|
|
mermaid.initialize({
|
2021-09-16 20:43:10 +02:00
|
|
|
// theme: 'dark',
|
2022-01-28 14:45:43 +01:00
|
|
|
// theme: 'forest',
|
2022-01-21 17:17:31 +01:00
|
|
|
// arrowMarkerAbsolute: true,
|
2020-08-16 08:45:44 +02:00
|
|
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
2022-01-21 17:17:31 +01:00
|
|
|
flowchart: {
|
|
|
|
nodeSpacing: 10,
|
|
|
|
curve: 'cardinal',
|
|
|
|
htmlLabels: true,
|
2022-05-10 17:45:16 +02:00
|
|
|
// defaultRenderer: 'dagre-d3',
|
2022-01-21 17:17:31 +01:00
|
|
|
},
|
|
|
|
class: {
|
2022-05-10 17:45:16 +02:00
|
|
|
// defaultRenderer: 'dagre-d3',
|
2022-01-28 14:45:43 +01:00
|
|
|
htmlLabels: true,
|
2022-01-21 17:17:31 +01:00
|
|
|
},
|
2020-08-16 08:45:44 +02:00
|
|
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
2022-04-28 18:45:18 +02:00
|
|
|
// sequence: {
|
|
|
|
// actorFontFamily: 'courier',
|
|
|
|
// actorMargin: 50,
|
|
|
|
// showSequenceNumbers: false,
|
|
|
|
// // hideUnusedParticipants: true,
|
|
|
|
// // forceMenus: true,
|
|
|
|
// },
|
|
|
|
// // sequenceDiagram: { actorMargin: 300, forceMenus: false }, // deprecated
|
2021-04-26 19:08:16 +02:00
|
|
|
// fontFamily: '"times", sans-serif',
|
|
|
|
// fontFamily: 'courier',
|
2021-12-05 00:28:40 +01:00
|
|
|
state: {
|
2021-04-30 13:50:21 +02:00
|
|
|
nodeSpacing: 50,
|
|
|
|
rankSpacing: 50,
|
|
|
|
},
|
2021-12-05 00:28:40 +01:00
|
|
|
logLevel: 0,
|
2021-04-26 19:08:16 +02:00
|
|
|
fontSize: 18,
|
2020-08-16 08:45:44 +02:00
|
|
|
curve: 'cardinal',
|
2022-02-03 19:54:24 +01:00
|
|
|
// securityLevel: 'sandbox',
|
2021-04-26 19:08:16 +02:00
|
|
|
// themeVariables: {relationLabelColor: 'red'}
|
2020-08-16 08:45:44 +02:00
|
|
|
});
|
2021-12-05 00:28:40 +01:00
|
|
|
function callback() {
|
|
|
|
alert('It worked');
|
|
|
|
}
|
2022-01-28 14:45:43 +01:00
|
|
|
|
|
|
|
function clickByFlow(elemName) {
|
|
|
|
const div = document.createElement('div');
|
|
|
|
div.className = 'created-by-click';
|
|
|
|
div.style = 'padding: 20px; background: green; color: white;';
|
|
|
|
div.innerText = 'Clicked By Flow';
|
|
|
|
|
|
|
|
document.getElementsByTagName('body')[0].appendChild(div);
|
|
|
|
}
|
2020-08-16 08:45:44 +02:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|