mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-05 07:09:40 +02:00
Compare commits
388 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f72d3c4372 | ||
![]() |
8b29fbe98e | ||
![]() |
529384c4ba | ||
![]() |
ada3f8e5e6 | ||
![]() |
bed475b229 | ||
![]() |
87b56bdd9a | ||
![]() |
904826b3e1 | ||
![]() |
44877545e5 | ||
![]() |
9123757549 | ||
![]() |
1d2f92454a | ||
![]() |
57ac111d05 | ||
![]() |
51e9a6b3aa | ||
![]() |
3ccf027f42 | ||
![]() |
bbac11a4b8 | ||
![]() |
12c63ff007 | ||
![]() |
f6421734a2 | ||
![]() |
754a776fe3 | ||
![]() |
be92c70b1b | ||
![]() |
fca58aafb1 | ||
![]() |
bbabf25a9e | ||
![]() |
3c0a2f0fd0 | ||
![]() |
b380d46c66 | ||
![]() |
f24e66ecd9 | ||
![]() |
50f522ae5c | ||
![]() |
76a6f622f7 | ||
![]() |
6bf60ef097 | ||
![]() |
62fe24b477 | ||
![]() |
b3fb86e374 | ||
![]() |
733a2f9b3f | ||
![]() |
13b388b7be | ||
![]() |
ac57eb09f3 | ||
![]() |
cf4cae315a | ||
![]() |
db117cc738 | ||
![]() |
22aca7b3ee | ||
![]() |
3ee141ff9b | ||
![]() |
c0335cf5fb | ||
![]() |
2ab275b5b5 | ||
![]() |
b9bde5e64c | ||
![]() |
c3e9382053 | ||
![]() |
32de3684a3 | ||
![]() |
4eb7d0d299 | ||
![]() |
a29e2e6baa | ||
![]() |
2f9a7e8590 | ||
![]() |
512e157c8a | ||
![]() |
594df753b8 | ||
![]() |
17857d3ea9 | ||
![]() |
f9b1e05c08 | ||
![]() |
8949b77a4a | ||
![]() |
e54fcae363 | ||
![]() |
fa2148f4bf | ||
![]() |
b03f017372 | ||
![]() |
36677152e9 | ||
![]() |
84bf1cb5d5 | ||
![]() |
65052854c2 | ||
![]() |
bdcd0d7dab | ||
![]() |
30a10bfa99 | ||
![]() |
2038562f79 | ||
![]() |
f5cc145e35 | ||
![]() |
695218c2f0 | ||
![]() |
a9194d4eaa | ||
![]() |
4023be1e84 | ||
![]() |
b78b371025 | ||
![]() |
a7c33b7d5a | ||
![]() |
501e62894b | ||
![]() |
1ef58e286c | ||
![]() |
c1dead1187 | ||
![]() |
01970d2bbd | ||
![]() |
243f2b28cd | ||
![]() |
9f7130a3e6 | ||
![]() |
b84cd155dd | ||
![]() |
423ebfd5d5 | ||
![]() |
bfc431f0f8 | ||
![]() |
1f3293bb43 | ||
![]() |
2a449ab773 | ||
![]() |
01f571e053 | ||
![]() |
c4c219b7c2 | ||
![]() |
1e1c3ef1a6 | ||
![]() |
0a8a0790cf | ||
![]() |
0181cbf743 | ||
![]() |
c6c9b88292 | ||
![]() |
fe6a042060 | ||
![]() |
1e19e39cc5 | ||
![]() |
4d9821fb46 | ||
![]() |
50f60da076 | ||
![]() |
4f5cab7f4c | ||
![]() |
3342f884ce | ||
![]() |
21c97f9521 | ||
![]() |
7bd9286a9b | ||
![]() |
781b239d0d | ||
![]() |
2b3f99d0e9 | ||
![]() |
4ff3b23da5 | ||
![]() |
9ddf138683 | ||
![]() |
4620a88164 | ||
![]() |
3f61993e2e | ||
![]() |
548c18a0c0 | ||
![]() |
213920a7c3 | ||
![]() |
5f3bb4aeeb | ||
![]() |
efbc369b86 | ||
![]() |
1de7f3e14c | ||
![]() |
2822fd033a | ||
![]() |
ee63856483 | ||
![]() |
d886c2b6b7 | ||
![]() |
12d9e81bee | ||
![]() |
dd51acb6c0 | ||
![]() |
8cb548d30d | ||
![]() |
b1fab6ffcd | ||
![]() |
5a8c372666 | ||
![]() |
56a1c27907 | ||
![]() |
7e041dd921 | ||
![]() |
1f175d2d84 | ||
![]() |
b110567517 | ||
![]() |
f8401511e2 | ||
![]() |
3b282e26c2 | ||
![]() |
8cc2ef8e36 | ||
![]() |
7b0c3c3cd5 | ||
![]() |
6223d3c470 | ||
![]() |
005fc7a765 | ||
![]() |
b50052c073 | ||
![]() |
0c6f8b58a3 | ||
![]() |
4593d8742d | ||
![]() |
fd1cd908fe | ||
![]() |
d302380b08 | ||
![]() |
bc2c3cba08 | ||
![]() |
695ca5d3f3 | ||
![]() |
bc9ff496f2 | ||
![]() |
c0cb05b406 | ||
![]() |
2524dfdf39 | ||
![]() |
4ec1c608a3 | ||
![]() |
14464f9fba | ||
![]() |
b3573e27be | ||
![]() |
286f6e52f0 | ||
![]() |
26f9924839 | ||
![]() |
908b704a42 | ||
![]() |
f95de5c6d9 | ||
![]() |
933efd0dda | ||
![]() |
4753ae8ac0 | ||
![]() |
0b815c7782 | ||
![]() |
321c2a73dd | ||
![]() |
050a4df149 | ||
![]() |
0ed20278f8 | ||
![]() |
97acbfee0b | ||
![]() |
25b5f544e8 | ||
![]() |
4a1d7c42f4 | ||
![]() |
05b1451050 | ||
![]() |
c58340916c | ||
![]() |
99e10766b3 | ||
![]() |
ad08016509 | ||
![]() |
cc826289c6 | ||
![]() |
7098bf9185 | ||
![]() |
43854a2921 | ||
![]() |
ed39de8426 | ||
![]() |
ffc6cae7f5 | ||
![]() |
40f95a5dc1 | ||
![]() |
f5ba67ab78 | ||
![]() |
04454cece0 | ||
![]() |
3b9900c1e0 | ||
![]() |
f8f59fc00f | ||
![]() |
d8c7a2894e | ||
![]() |
f71ab2f879 | ||
![]() |
1e4be4eb6a | ||
![]() |
1fc10a7857 | ||
![]() |
e1f0e69263 | ||
![]() |
8d77721dee | ||
![]() |
9110bdfb5d | ||
![]() |
74b1219d62 | ||
![]() |
d818551f50 | ||
![]() |
2d8a6b7d7f | ||
![]() |
606f0e50b2 | ||
![]() |
8b111bb4f0 | ||
![]() |
869bb0f37f | ||
![]() |
03ae4d03cf | ||
![]() |
07add1fe01 | ||
![]() |
7c950619cf | ||
![]() |
cdeca2d507 | ||
![]() |
f145f44d5b | ||
![]() |
3e43bc0299 | ||
![]() |
f36e29ea90 | ||
![]() |
7fb70fdd20 | ||
![]() |
73d3049255 | ||
![]() |
8be1e4756d | ||
![]() |
bb2dd2f5f3 | ||
![]() |
cbe3a9159d | ||
![]() |
b141f24068 | ||
![]() |
e13f97c8ee | ||
![]() |
3877b88e6e | ||
![]() |
bb6c36c6af | ||
![]() |
a4892069d2 | ||
![]() |
5d71afc56a | ||
![]() |
6413cc5ad3 | ||
![]() |
69cc6ddaeb | ||
![]() |
4465a661d0 | ||
![]() |
246e5f5b8b | ||
![]() |
4c11e8ec68 | ||
![]() |
df7ba0a897 | ||
![]() |
b7dd2bb2ce | ||
![]() |
dfca6ae893 | ||
![]() |
09fdd2cd0c | ||
![]() |
15ed52f64a | ||
![]() |
ac6759078b | ||
![]() |
6a9a09c08f | ||
![]() |
882ba03fcb | ||
![]() |
77908e8059 | ||
![]() |
2ea68c607c | ||
![]() |
41a6697dc3 | ||
![]() |
953c31cd11 | ||
![]() |
a483a53e26 | ||
![]() |
a3745ca492 | ||
![]() |
571423e909 | ||
![]() |
3873ec941b | ||
![]() |
46cdacfdc7 | ||
![]() |
384afc1a6d | ||
![]() |
fa55b7c824 | ||
![]() |
8188bf1d57 | ||
![]() |
c19319f115 | ||
![]() |
ff3bdfd282 | ||
![]() |
4130386447 | ||
![]() |
9c04595ae8 | ||
![]() |
d1c7f1c2e3 | ||
![]() |
f67b972fdf | ||
![]() |
0185a74e95 | ||
![]() |
222fafe686 | ||
![]() |
45c461cd8a | ||
![]() |
afcf1d5f53 | ||
![]() |
4a7a672d96 | ||
![]() |
9cbbfe3a06 | ||
![]() |
c2db4640aa | ||
![]() |
bec7f2eaf0 | ||
![]() |
556f37284c | ||
![]() |
929b421c71 | ||
![]() |
cd67f7a63a | ||
![]() |
59810783d6 | ||
![]() |
0eae5120eb | ||
![]() |
eeccf1c56b | ||
![]() |
e3e9c67f5b | ||
![]() |
a73b291c4f | ||
![]() |
1b5056ca38 | ||
![]() |
2de2cb64f8 | ||
![]() |
f458e9c003 | ||
![]() |
aa36aee4ee | ||
![]() |
e10bb774e6 | ||
![]() |
cbe2ce41c1 | ||
![]() |
06834eb383 | ||
![]() |
413816783d | ||
![]() |
4081d7f5f6 | ||
![]() |
3a2f6659a6 | ||
![]() |
2210c73ae8 | ||
![]() |
44d7dfe993 | ||
![]() |
87dc13365f | ||
![]() |
adc15c2989 | ||
![]() |
c69ef282b5 | ||
![]() |
8938d3656e | ||
![]() |
6b7699444a | ||
![]() |
926783fe4c | ||
![]() |
8c293df7af | ||
![]() |
8ce9d2f02f | ||
![]() |
09687e407e | ||
![]() |
ad7630f091 | ||
![]() |
a14b384f65 | ||
![]() |
0e8952984b | ||
![]() |
3d4cfe60af | ||
![]() |
b3235c762e | ||
![]() |
30d8eee631 | ||
![]() |
5c77aa6e8e | ||
![]() |
77f2a57155 | ||
![]() |
91ec41762a | ||
![]() |
7abe279b4a | ||
![]() |
ce04c82356 | ||
![]() |
7746091c98 | ||
![]() |
748ee19b4a | ||
![]() |
7a6d73762e | ||
![]() |
20bbe6cfb0 | ||
![]() |
583d905b88 | ||
![]() |
40479aef77 | ||
![]() |
ab276ccdfe | ||
![]() |
5178de7fef | ||
![]() |
d3d5f12d3c | ||
![]() |
db51adcc26 | ||
![]() |
f38c6a661a | ||
![]() |
3d016ba800 | ||
![]() |
bfeb3a8b3c | ||
![]() |
e73894bfbd | ||
![]() |
c2c753ce7d | ||
![]() |
a352cf3ae5 | ||
![]() |
35f3d57cf3 | ||
![]() |
9bd5652b88 | ||
![]() |
0924a1cef0 | ||
![]() |
0b56686f4d | ||
![]() |
9a398c0a76 | ||
![]() |
db3edb61b4 | ||
![]() |
f4a3f33f36 | ||
![]() |
2305bbed93 | ||
![]() |
a900a8cc17 | ||
![]() |
d48a4bd13d | ||
![]() |
d5c4ea30db | ||
![]() |
979960e8e4 | ||
![]() |
24ee6746f4 | ||
![]() |
4c76b4189c | ||
![]() |
c6dfc9306f | ||
![]() |
d3577eb59b | ||
![]() |
066b7a0d0b | ||
![]() |
be46ace02e | ||
![]() |
65592e0541 | ||
![]() |
f4c335ad2f | ||
![]() |
e6fc278861 | ||
![]() |
73045b5c6d | ||
![]() |
f6d1f6c825 | ||
![]() |
eae664937d | ||
![]() |
fabaddb10e | ||
![]() |
b18cb6933a | ||
![]() |
6d3ebab529 | ||
![]() |
4369b6cda2 | ||
![]() |
952d360010 | ||
![]() |
f84b6237cf | ||
![]() |
6f800be33b | ||
![]() |
52af0476c1 | ||
![]() |
b4fbe1b0f0 | ||
![]() |
835ae1734c | ||
![]() |
1127ce7b50 | ||
![]() |
9d8273771a | ||
![]() |
0f9722393e | ||
![]() |
e2bb8478d0 | ||
![]() |
a353300707 | ||
![]() |
77b2e4211d | ||
![]() |
868c2ece91 | ||
![]() |
354daee3a1 | ||
![]() |
fcc51f4d94 | ||
![]() |
94f7af1190 | ||
![]() |
1059873b10 | ||
![]() |
4cf2d71eb4 | ||
![]() |
f7b73be561 | ||
![]() |
a349fd3aba | ||
![]() |
295b428d62 | ||
![]() |
a44714c715 | ||
![]() |
53ea005ebc | ||
![]() |
1baca16a51 | ||
![]() |
036f9dc359 | ||
![]() |
8f22daf9a3 | ||
![]() |
9c12502a36 | ||
![]() |
38496c004b | ||
![]() |
966139eae3 | ||
![]() |
c1326f1e14 | ||
![]() |
42d107f434 | ||
![]() |
92a275eb9b | ||
![]() |
6329e90f62 | ||
![]() |
4cd2621eeb | ||
![]() |
67143b7bfd | ||
![]() |
b7eb71e7d3 | ||
![]() |
c75827c71c | ||
![]() |
0c472d97bd | ||
![]() |
4459eb5c87 | ||
![]() |
1e7a56b6fa | ||
![]() |
800f1e8305 | ||
![]() |
bf716de886 | ||
![]() |
db537f2cb4 | ||
![]() |
bad0584317 | ||
![]() |
36b4860ab5 | ||
![]() |
6a45701042 | ||
![]() |
a8325c6a5c | ||
![]() |
7a42c3123e | ||
![]() |
305b78dbba | ||
![]() |
411ff4f302 | ||
![]() |
be32447773 | ||
![]() |
4c105e36a5 | ||
![]() |
48d7082fe4 | ||
![]() |
44ba9c8953 | ||
![]() |
f01bf59114 | ||
![]() |
d0cf3fc96a | ||
![]() |
7479fd3dd2 | ||
![]() |
e0a05f83d1 | ||
![]() |
0b35f9c24a | ||
![]() |
308ab0e465 | ||
![]() |
be0dd22fa5 | ||
![]() |
1385acc3f6 | ||
![]() |
7da80812e0 | ||
![]() |
3ea974709f | ||
![]() |
6681216889 | ||
![]() |
189d3434b2 | ||
![]() |
c11f9b7e5f | ||
![]() |
80b14d1d7f | ||
![]() |
ae5e15c046 | ||
![]() |
8574dadc34 | ||
![]() |
a3b2ba736d | ||
![]() |
3f6296b619 | ||
![]() |
f67a374444 | ||
![]() |
8435e3c856 | ||
![]() |
6eaea38df7 | ||
![]() |
5fb572abaf | ||
![]() |
6df9bf36e5 |
8
.ackrc
8
.ackrc
@@ -1,4 +1,4 @@
|
|||||||
--ignore-dir=dist
|
--ignore-dir=dist
|
||||||
--ignore-file=match:/^yarn\.lock$/
|
--ignore-file=match:/^yarn\.lock$/
|
||||||
--ignore-file=match:/^yarn-error\.log$/
|
--ignore-file=match:/^yarn-error\.log$/
|
||||||
--ignore-dir=coverage
|
--ignore-dir=coverage
|
||||||
|
5
.commitlintrc.json
Normal file
5
.commitlintrc.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"@commitlint/config-conventional"
|
||||||
|
]
|
||||||
|
}
|
@@ -1,11 +1,11 @@
|
|||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
},
|
},
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "plugin:jsdoc/recommended", "plugin:prettier/recommended"],
|
"extends": ["eslint:recommended", "plugin:jsdoc/recommended", "plugin:markdown/recommended", "plugin:prettier/recommended"],
|
||||||
"plugins": ["jest", "jsdoc", "prettier"],
|
"plugins": ["html", "jest", "jsdoc", "prettier"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-prototype-builtins": 0,
|
"no-prototype-builtins": 0,
|
||||||
"no-unused-vars": 0,
|
"no-unused-vars": 0,
|
||||||
@@ -23,6 +23,16 @@
|
|||||||
"jsdoc/check-line-alignment": 0,
|
"jsdoc/check-line-alignment": 0,
|
||||||
"jsdoc/multiline-blocks": 0,
|
"jsdoc/multiline-blocks": 0,
|
||||||
"jsdoc/newline-after-description": 0,
|
"jsdoc/newline-after-description": 0,
|
||||||
"jsdoc/tag-lines": 0
|
"jsdoc/tag-lines": 0,
|
||||||
}
|
"no-empty": ["error", { "allowEmptyCatch": true }]
|
||||||
}
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "./**/*.html",
|
||||||
|
"rules": {
|
||||||
|
"no-undef": "off",
|
||||||
|
"jsdoc/require-jsdoc": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
24
.github/FUNDING.yml
vendored
24
.github/FUNDING.yml
vendored
@@ -1,12 +1,12 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [knsv]
|
github: [knsv]
|
||||||
#patreon: # Replace with a single Patreon username
|
#patreon: # Replace with a single Patreon username
|
||||||
#open_collective: # Replace with a single Open Collective username
|
#open_collective: # Replace with a single Open Collective username
|
||||||
#ko_fi: # Replace with a single Ko-fi username
|
#ko_fi: # Replace with a single Ko-fi username
|
||||||
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
#liberapay: # Replace with a single Liberapay username
|
#liberapay: # Replace with a single Liberapay username
|
||||||
#issuehunt: # Replace with a single IssueHunt username
|
#issuehunt: # Replace with a single IssueHunt username
|
||||||
#otechie: # Replace with a single Otechie username
|
#otechie: # Replace with a single Otechie username
|
||||||
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
|
40
.github/ISSUE_TEMPLATE/feature_request.md
vendored
40
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +1,20 @@
|
|||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ''
|
title: ''
|
||||||
labels: 'Status: Triage, Type: Enhancement'
|
labels: 'Status: Triage, Type: Enhancement'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
**Describe the solution you'd like**
|
||||||
A clear and concise description of what you want to happen.
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
**Describe alternatives you've considered**
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context or screenshots about the feature request here.
|
Add any other context or screenshots about the feature request here.
|
||||||
|
30
.github/ISSUE_TEMPLATE/question.md
vendored
30
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,15 +1,15 @@
|
|||||||
---
|
---
|
||||||
name: Question
|
name: Question
|
||||||
about: Get some help from the community.
|
about: Get some help from the community.
|
||||||
title: ''
|
title: ''
|
||||||
labels: 'Help wanted!, Type: Other'
|
labels: 'Help wanted!, Type: Other'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Help us help you!
|
## Help us help you!
|
||||||
You want an answer. Here are some ways to get it quicker:
|
You want an answer. Here are some ways to get it quicker:
|
||||||
* Use a clear and concise title.
|
* Use a clear and concise title.
|
||||||
* Try to pose a clear and concise question.
|
* Try to pose a clear and concise question.
|
||||||
* Include as much, or as little, code as necessary.
|
* Include as much, or as little, code as necessary.
|
||||||
* Don't be shy to give us some screenshots, if it helps!
|
* Don't be shy to give us some screenshots, if it helps!
|
||||||
|
26
.github/pull_request_template.md
vendored
26
.github/pull_request_template.md
vendored
@@ -1,13 +1,13 @@
|
|||||||
## :bookmark_tabs: Summary
|
## :bookmark_tabs: Summary
|
||||||
Brief description about the content of your PR.
|
Brief description about the content of your PR.
|
||||||
|
|
||||||
Resolves #<your issue id here>
|
Resolves #<your issue id here>
|
||||||
|
|
||||||
## :straight_ruler: Design Decisions
|
## :straight_ruler: Design Decisions
|
||||||
Describe the way your implementation works or what design decisions you made if applicable.
|
Describe the way your implementation works or what design decisions you made if applicable.
|
||||||
|
|
||||||
### :clipboard: Tasks
|
### :clipboard: Tasks
|
||||||
Make sure you
|
Make sure you
|
||||||
- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
|
- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
|
||||||
- [ ] :computer: have added unit/e2e tests (if appropriate)
|
- [ ] :computer: have added unit/e2e tests (if appropriate)
|
||||||
- [ ] :bookmark: targeted `develop` branch
|
- [ ] :bookmark: targeted `develop` branch
|
||||||
|
50
.github/release-drafter.yml
vendored
50
.github/release-drafter.yml
vendored
@@ -1,25 +1,25 @@
|
|||||||
name-template: '$NEXT_PATCH_VERSION'
|
name-template: '$NEXT_PATCH_VERSION'
|
||||||
tag-template: '$NEXT_PATCH_VERSION'
|
tag-template: '$NEXT_PATCH_VERSION'
|
||||||
categories:
|
categories:
|
||||||
- title: '🚀 Features'
|
- title: '🚀 Features'
|
||||||
labels:
|
labels:
|
||||||
- 'Type: Enhancement'
|
- 'Type: Enhancement'
|
||||||
- title: '🐛 Bug Fixes'
|
- title: '🐛 Bug Fixes'
|
||||||
labels:
|
labels:
|
||||||
- 'Type: Bug / Error'
|
- 'Type: Bug / Error'
|
||||||
- title: '🧰 Maintenance'
|
- title: '🧰 Maintenance'
|
||||||
label: 'Type: Other'
|
label: 'Type: Other'
|
||||||
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
|
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
|
||||||
sort-by: title
|
sort-by: title
|
||||||
sort-direction: ascending
|
sort-direction: ascending
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
exclude-labels:
|
exclude-labels:
|
||||||
- 'Skip changelog'
|
- 'Skip changelog'
|
||||||
no-changes-template: 'This release contains minor changes and bugfixes.'
|
no-changes-template: 'This release contains minor changes and bugfixes.'
|
||||||
template: |
|
template: |
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
$CHANGES
|
$CHANGES
|
||||||
|
|
||||||
🎉 **Thanks to all contributors helping with this release!** 🎉
|
🎉 **Thanks to all contributors helping with this release!** 🎉
|
||||||
|
38
.github/stale.yml
vendored
38
.github/stale.yml
vendored
@@ -1,19 +1,19 @@
|
|||||||
# Number of days of inactivity before an issue becomes stale
|
# Number of days of inactivity before an issue becomes stale
|
||||||
daysUntilStale: 60
|
daysUntilStale: 60
|
||||||
# Number of days of inactivity before a stale issue is closed
|
# Number of days of inactivity before a stale issue is closed
|
||||||
daysUntilClose: 14
|
daysUntilClose: 14
|
||||||
# Issues with these labels will never be considered stale
|
# Issues with these labels will never be considered stale
|
||||||
exemptLabels:
|
exemptLabels:
|
||||||
- Retained
|
- Retained
|
||||||
# Label to use when marking an issue as stale
|
# Label to use when marking an issue as stale
|
||||||
staleLabel: Inactive
|
staleLabel: Inactive
|
||||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
markComment: >
|
markComment: >
|
||||||
This issue has been automatically marked as stale because it has not had
|
This issue has been automatically marked as stale because it has not had
|
||||||
recent activity. It will be closed if no further activity occurs. Thank you
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
for your contributions.
|
for your contributions.
|
||||||
If you are still interested in this issue and it is still relevant you can comment to revive it.
|
If you are still interested in this issue and it is still relevant you can comment to revive it.
|
||||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
closeComment: >
|
closeComment: >
|
||||||
This issue has been been automatically closed due to a lack of activity.
|
This issue has been been automatically closed due to a lack of activity.
|
||||||
This is done to maintain a clean list of issues that the community is interested in developing.
|
This is done to maintain a clean list of issues that the community is interested in developing.
|
||||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -9,10 +9,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: yarn
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
32
.github/workflows/check-readme-in-sync.yml
vendored
Normal file
32
.github/workflows/check-readme-in-sync.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Reference: https://github.com/Yash-Singh1/eslint-plugin-userscripts/blob/main/.github/workflows/readme-in-sync.yml
|
||||||
|
|
||||||
|
name: Check if README and docs/README are in sync
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- gh-pages
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- gh-pages
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Check for difference in README.md and docs/README.md
|
||||||
|
run: |
|
||||||
|
if [ -z "$(diff README.md docs/README.md --brief)" ]
|
||||||
|
then
|
||||||
|
echo "README.md and docs/README.md are in sync"
|
||||||
|
else
|
||||||
|
echo "Make sure that README.md and docs/README.md are in sync"
|
||||||
|
echo
|
||||||
|
echo "Difference:"
|
||||||
|
echo
|
||||||
|
diff README.md docs/README.md -u
|
||||||
|
exit 1
|
||||||
|
fi
|
38
.github/workflows/checks
vendored
38
.github/workflows/checks
vendored
@@ -1,19 +1,19 @@
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
name: Static analysis
|
name: Static analysis
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: check tests
|
name: check tests
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: testomatio/check-tests@stable
|
- uses: testomatio/check-tests@stable
|
||||||
with:
|
with:
|
||||||
framework: cypress
|
framework: cypress
|
||||||
tests: "./cypress/integration/**/**.spec.js"
|
tests: "./cypress/integration/**/**.spec.js"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
has-tests-label: true
|
has-tests-label: true
|
||||||
|
|
||||||
|
6
.github/workflows/e2e.yml
vendored
6
.github/workflows/e2e.yml
vendored
@@ -9,10 +9,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [16.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: yarn
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
- name: Run E2E Tests
|
- name: Run E2E Tests
|
||||||
run: yarn e2e
|
run: yarn e2e
|
||||||
env:
|
env:
|
||||||
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
#- name: Post Upload Test Results
|
#- name: Post Upload Test Results
|
||||||
|
@@ -6,7 +6,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v3
|
||||||
- name: Validate Configuration
|
- name: Validate Configuration
|
||||||
uses: Yash-Singh1/pr-labeler-config-validator@releases/v0.0.3
|
uses: Yash-Singh1/pr-labeler-config-validator@releases/v0.0.3
|
||||||
with:
|
with:
|
||||||
|
@@ -9,9 +9,9 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
- name: Install Yarn
|
- name: Install Yarn
|
||||||
|
4
.github/workflows/release-publish.yml
vendored
4
.github/workflows/release-publish.yml
vendored
@@ -8,11 +8,11 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v3
|
||||||
- uses: fregante/setup-git-user@v1
|
- uses: fregante/setup-git-user@v1
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
- name: Install Yarn
|
- name: Install Yarn
|
||||||
|
26
.github/workflows/unlock-reopened-issues.yml
vendored
26
.github/workflows/unlock-reopened-issues.yml
vendored
@@ -1,13 +1,13 @@
|
|||||||
name: Unlock reopened issue
|
name: Unlock reopened issue
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [reopened]
|
types: [reopened]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: Dunning-Kruger/unlock-issues@v1
|
- uses: Dunning-Kruger/unlock-issues@v1
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
18
.github/workflows/update-browserlist.yml
vendored
Normal file
18
.github/workflows/update-browserlist.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Update Browserslist
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 7 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: npx browserslist@latest --update-db
|
||||||
|
- name: Commit changes
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
with:
|
||||||
|
author_name: ${{ github.actor }}
|
||||||
|
author_email: ${{ github.actor }}@users.noreply.github.com
|
||||||
|
message: 'chore: update browsers list'
|
10
.gitignore
vendored
10
.gitignore
vendored
@@ -4,8 +4,7 @@ node_modules/
|
|||||||
coverage/
|
coverage/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
dist/*.js
|
dist
|
||||||
dist/*.map
|
|
||||||
|
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
.npmrc
|
.npmrc
|
||||||
@@ -13,10 +12,6 @@ token
|
|||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
dist/classTest.html
|
|
||||||
|
|
||||||
dist/sequenceTest.html
|
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
cypress/platform/current.html
|
cypress/platform/current.html
|
||||||
cypress/platform/experimental.html
|
cypress/platform/experimental.html
|
||||||
@@ -25,3 +20,6 @@ local/
|
|||||||
_site
|
_site
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
/.vs
|
/.vs
|
||||||
|
|
||||||
|
cypress/screenshots/
|
||||||
|
cypress/snapshots/
|
4
.husky/commit-msg
Normal file
4
.husky/commit-msg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# . "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
# npx --no-install commitlint --edit $1
|
2
.husky/pre-commit
Executable file → Normal file
2
.husky/pre-commit
Executable file → Normal file
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
yarn dlx lint-staged
|
yarn pre-commit
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"*": [
|
"*.{js,html,md}": [
|
||||||
"yarn lint:fix"
|
"yarn lint:fix"
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -1,22 +1,22 @@
|
|||||||
{
|
{
|
||||||
"ecmaVersion": 6,
|
"ecmaVersion": 6,
|
||||||
"libs": [
|
"libs": [
|
||||||
"browser"
|
"browser"
|
||||||
],
|
],
|
||||||
"loadEagerly": [
|
"loadEagerly": [
|
||||||
"path/to/your/js/**/*.js"
|
"path/to/your/js/**/*.js"
|
||||||
],
|
],
|
||||||
"dontLoad": [
|
"dontLoad": [
|
||||||
"node_modules/**",
|
"node_modules/**",
|
||||||
"path/to/your/js/**/*.js"
|
"path/to/your/js/**/*.js"
|
||||||
],
|
],
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"modules": {},
|
"modules": {},
|
||||||
"es_modules": {},
|
"es_modules": {},
|
||||||
"node": {},
|
"node": {},
|
||||||
"doc_comment": {
|
"doc_comment": {
|
||||||
"fullDocs": true,
|
"fullDocs": true,
|
||||||
"strong": true
|
"strong": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,6 +1,19 @@
|
|||||||
const { Generator } = require('jison');
|
const { Generator } = require('jison');
|
||||||
const validate = require('schema-utils');
|
const validate = require('schema-utils');
|
||||||
const schema = require('./parser-options-schema.json');
|
|
||||||
|
const schema = {
|
||||||
|
title: 'Jison Parser options',
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
'token-stack': {
|
||||||
|
type: 'boolean',
|
||||||
|
},
|
||||||
|
debug: {
|
||||||
|
type: 'boolean',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
additionalProperties: false,
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = function jisonLoader(source) {
|
module.exports = function jisonLoader(source) {
|
||||||
const options = this.getOptions();
|
const options = this.getOptions();
|
45
.webpack/webpack.config.babel.js
Normal file
45
.webpack/webpack.config.babel.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { merge, mergeWithCustomize, customizeObject } from 'webpack-merge';
|
||||||
|
import nodeExternals from 'webpack-node-externals';
|
||||||
|
import baseConfig from './webpack.config.base';
|
||||||
|
|
||||||
|
export default (_env, args) => {
|
||||||
|
switch (args.mode) {
|
||||||
|
case 'development':
|
||||||
|
return [
|
||||||
|
baseConfig,
|
||||||
|
merge(baseConfig, {
|
||||||
|
externals: [nodeExternals()],
|
||||||
|
output: {
|
||||||
|
filename: '[name].core.js',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
case 'production':
|
||||||
|
return [
|
||||||
|
// umd
|
||||||
|
merge(baseConfig, {
|
||||||
|
output: {
|
||||||
|
filename: '[name].min.js',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
// esm
|
||||||
|
mergeWithCustomize({
|
||||||
|
customizeObject: customizeObject({
|
||||||
|
'output.library': 'replace',
|
||||||
|
}),
|
||||||
|
})(baseConfig, {
|
||||||
|
experiments: {
|
||||||
|
outputModule: true,
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
library: {
|
||||||
|
type: 'module',
|
||||||
|
},
|
||||||
|
filename: '[name].esm.min.mjs',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
default:
|
||||||
|
throw new Error('No matching configuration was found!');
|
||||||
|
}
|
||||||
|
};
|
54
.webpack/webpack.config.base.js
Normal file
54
.webpack/webpack.config.base.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import path from 'path';
|
||||||
|
|
||||||
|
export const resolveRoot = (...relativePath) => path.resolve(__dirname, '..', ...relativePath);
|
||||||
|
|
||||||
|
export default {
|
||||||
|
amd: false, // https://github.com/lodash/lodash/issues/3052
|
||||||
|
target: 'web',
|
||||||
|
entry: {
|
||||||
|
mermaid: './src/mermaid.js',
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.wasm', '.mjs', '.js', '.json', '.jison'],
|
||||||
|
fallback: {
|
||||||
|
fs: false, // jison generated code requires 'fs'
|
||||||
|
path: require.resolve('path-browserify'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
path: resolveRoot('./dist'),
|
||||||
|
filename: '[name].js',
|
||||||
|
library: {
|
||||||
|
name: 'mermaid',
|
||||||
|
type: 'umd',
|
||||||
|
export: 'default',
|
||||||
|
},
|
||||||
|
globalObject: 'typeof self !== "undefined" ? self : this',
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
include: [resolveRoot('./src'), resolveRoot('./node_modules/dagre-d3-renderer/lib')],
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// load scss to string
|
||||||
|
test: /\.scss$/,
|
||||||
|
use: ['css-to-string-loader', 'css-loader', 'sass-loader'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.jison$/,
|
||||||
|
use: {
|
||||||
|
loader: path.resolve(__dirname, './loaders/jison.js'),
|
||||||
|
options: {
|
||||||
|
'token-stack': true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
devtool: 'source-map',
|
||||||
|
};
|
37
.webpack/webpack.config.e2e.babel.js
Normal file
37
.webpack/webpack.config.e2e.babel.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import baseConfig, { resolveRoot } from './webpack.config.base';
|
||||||
|
import { merge } from 'webpack-merge';
|
||||||
|
|
||||||
|
export default merge(baseConfig, {
|
||||||
|
mode: 'development',
|
||||||
|
entry: {
|
||||||
|
mermaid: './src/mermaid.js',
|
||||||
|
e2e: './cypress/platform/viewer.js',
|
||||||
|
'bundle-test': './cypress/platform/bundle-test.js',
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
globalObject: 'window',
|
||||||
|
},
|
||||||
|
devServer: {
|
||||||
|
compress: true,
|
||||||
|
port: 9000,
|
||||||
|
static: [
|
||||||
|
{ directory: resolveRoot('cypress', 'platform') },
|
||||||
|
{ directory: resolveRoot('dist') },
|
||||||
|
{ directory: resolveRoot('demos') },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
mermaid: 'mermaid',
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
1724
CHANGELOG.md
1724
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -114,7 +114,7 @@ Finally, if it is not in the documentation, no one will know about it and then *
|
|||||||
|
|
||||||
The docs are located in the docs folder and are ofc written in markdown. Just pick the right section and start typing. If you want to add to the structure as in adding a new section and new file you do that via the _navbar.md.
|
The docs are located in the docs folder and are ofc written in markdown. Just pick the right section and start typing. If you want to add to the structure as in adding a new section and new file you do that via the _navbar.md.
|
||||||
|
|
||||||
The changes in master is reflected in http://mermaid-js.github.io/mermaid/ once released the updates are commited to https://mermaid-js.github.io/#/
|
The changes in master is reflected in http://mermaid-js.github.io/mermaid/ once released the updates are committed to https://mermaid-js.github.io/#/
|
||||||
|
|
||||||
## Last words
|
## Last words
|
||||||
|
|
||||||
|
271
README.md
271
README.md
@@ -1,4 +1,4 @@
|
|||||||
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://percy.io/Mermaid/mermaid)
|
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
|
||||||
English | [简体中文](./README.zh-CN.md)
|
English | [简体中文](./README.zh-CN.md)
|
||||||
|
|
||||||
@@ -18,11 +18,10 @@ Mermaid is a Javascript based diagramming and charting tool that uses Markdown-i
|
|||||||
> Doc-Rot is a Catch-22 that Mermaid helps to solve.
|
> Doc-Rot is a Catch-22 that Mermaid helps to solve.
|
||||||
|
|
||||||
Diagramming and documentation costs precious developer time and gets outdated quickly.
|
Diagramming and documentation costs precious developer time and gets outdated quickly.
|
||||||
But not having diagrams or docs ruins productivity and hurts organizational learning. <br/>
|
But not having diagrams or docs ruins productivity and hurts organizational learning.<br/>
|
||||||
Mermaid addresses this problem by cutting the time, effort and tooling that is required to create modifiable diagrams and charts, for smarter and more reusable content.
|
Mermaid addresses this problem by enabling users to create easily modifiable diagrams, it can also be made part of production scripts (and other pieces of code).<br/>
|
||||||
The text definitions for Mermaid diagrams allows for it to be updated easily, it can also be made part of production scripts (and other pieces of code).
|
<br/>
|
||||||
So less time needs to be spent on documenting, as a separate and laborious task. <br/>
|
Mermaid allows even non-programmers to easily create detailed and diagrams through the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).<br/>
|
||||||
Even non-programmers can create diagrams through the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).<br/>
|
|
||||||
[Tutorials](./docs/Tutorials.md) has video tutorials.
|
[Tutorials](./docs/Tutorials.md) has video tutorials.
|
||||||
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/integrations.md).
|
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/integrations.md).
|
||||||
|
|
||||||
@@ -34,33 +33,30 @@ For a more detailed introduction to Mermaid and some of its more basic uses, loo
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
__The following are some examples of the diagrams, charts and graphs that can be made using Mermaid and the Markdown-inspired text specific to it. Click here jump into the [text syntax](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference).__
|
__The following are some examples of the diagrams, charts and graphs that can be made using Mermaid. Click here jump into the [text syntax](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference).__
|
||||||
<table>
|
|
||||||
<!-- <Flowchart> -->
|
<!-- <Flowchart> -->
|
||||||
<tr><td colspan=2 align="center">
|
|
||||||
<b>Flow</b></br>
|
## Flowchart [<a href="https://mermaid-js.github.io/mermaid/#/flowchart">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/flowchart">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
|
||||||
</td></tr>
|
```
|
||||||
<tr>
|
flowchart LR
|
||||||
<td><pre>
|
|
||||||
graph TD
|
|
||||||
A[Hard] -->|Text| B(Round)
|
A[Hard] -->|Text| B(Round)
|
||||||
B --> C{Decision}
|
B --> C{Decision}
|
||||||
C -->|One| D[Result 1]
|
C -->|One| D[Result 1]
|
||||||
C -->|Two| E[Result 2]
|
C -->|Two| E[Result 2]
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-flow.png" />
|
flowchart LR
|
||||||
</td>
|
A[Hard] -->|Text| B(Round)
|
||||||
</tr>
|
B --> C{Decision}
|
||||||
<!-- </Flowchart> -->
|
C -->|One| D[Result 1]
|
||||||
<!-- <Sequence> -->
|
C -->|Two| E[Result 2]
|
||||||
<tr><td colspan=2 align="center">
|
```
|
||||||
<b>Sequence</b><br />
|
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/sequenceDiagram">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
|
||||||
</td></tr>
|
## Sequence diagram [<a href="https://mermaid-js.github.io/mermaid/#/sequenceDiagram">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
<tr>
|
|
||||||
<td><pre>
|
```
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
Alice->>John: Hello John, how are you?
|
Alice->>John: Hello John, how are you?
|
||||||
loop Healthcheck
|
loop Healthcheck
|
||||||
@@ -70,43 +66,48 @@ Note right of John: Rational thoughts!
|
|||||||
John-->>Alice: Great!
|
John-->>Alice: Great!
|
||||||
John->>Bob: How about you?
|
John->>Bob: How about you?
|
||||||
Bob-->>John: Jolly good!
|
Bob-->>John: Jolly good!
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-sequence.png" />
|
sequenceDiagram
|
||||||
</td>
|
Alice->>John: Hello John, how are you?
|
||||||
</tr>
|
loop Healthcheck
|
||||||
<!-- </Sequence> -->
|
John->>John: Fight against hypochondria
|
||||||
<!-- <Gantt> -->
|
end
|
||||||
<tr><td colspan=2 align="center">
|
Note right of John: Rational thoughts!
|
||||||
<b>Gantt</b><br />
|
John-->>Alice: Great!
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
John->>Bob: How about you?
|
||||||
</td></tr>
|
Bob-->>John: Jolly good!
|
||||||
<tr>
|
```
|
||||||
<td><pre>
|
|
||||||
|
## Gantt chart [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
gantt
|
gantt
|
||||||
section Section
|
section Section
|
||||||
Completed :done, des1, 2014-01-06,2014-01-08
|
Completed :done, des1, 2014-01-06,2014-01-08
|
||||||
Active :active, des2, 2014-01-07, 3d
|
Active :active, des2, 2014-01-07, 3d
|
||||||
Parallel 1 : des3, after des1, 1d
|
Parallel 1 : des3, after des1, 1d
|
||||||
Parallel 2 : des4, after des1, 1d
|
Parallel 2 : des4, after des1, 1d
|
||||||
Parallel 3 : des5, after des3, 1d
|
Parallel 3 : des5, after des3, 1d
|
||||||
Parallel 4 : des6, after des4, 1d
|
Parallel 4 : des6, after des4, 1d
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-gantt.png" />
|
gantt
|
||||||
</td>
|
section Section
|
||||||
</tr>
|
Completed :done, des1, 2014-01-06,2014-01-08
|
||||||
<!-- </Gantt> -->
|
Active :active, des2, 2014-01-07, 3d
|
||||||
<!-- <Class> -->
|
Parallel 1 : des3, after des1, 1d
|
||||||
<tr><td colspan=2 align="center">
|
Parallel 2 : des4, after des1, 1d
|
||||||
<b>Class</b><br />
|
Parallel 3 : des5, after des3, 1d
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/classDiagram">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
Parallel 4 : des6, after des4, 1d
|
||||||
</td></tr>
|
```
|
||||||
<tr>
|
|
||||||
<td><pre>
|
## Class diagram [<a href="https://mermaid-js.github.io/mermaid/#/classDiagram">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
classDiagram
|
classDiagram
|
||||||
Class01 <|-- AveryLongClass : Cool
|
Class01 <|-- AveryLongClass : Cool
|
||||||
<<interface>> Class01
|
<<Interface>> Class01
|
||||||
Class09 --> C2 : Where am i?
|
Class09 --> C2 : Where am i?
|
||||||
Class09 --* C3
|
Class09 --* C3
|
||||||
Class09 --|> Class07
|
Class09 --|> Class07
|
||||||
@@ -116,23 +117,32 @@ Class01 : size()
|
|||||||
Class01 : int chimp
|
Class01 : int chimp
|
||||||
Class01 : int gorilla
|
Class01 : int gorilla
|
||||||
class Class10 {
|
class Class10 {
|
||||||
<<service>>
|
<<service>>
|
||||||
int id
|
int id
|
||||||
size()
|
size()
|
||||||
}
|
}
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-class.png" />
|
classDiagram
|
||||||
</td>
|
Class01 <|-- AveryLongClass : Cool
|
||||||
</tr>
|
<<Interface>> Class01
|
||||||
<!-- </Class> -->
|
Class09 --> C2 : Where am i?
|
||||||
<!-- <State> -->
|
Class09 --* C3
|
||||||
<tr><td colspan=2 align="center">
|
Class09 --|> Class07
|
||||||
<b>State</b><br />
|
Class07 : equals()
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtLXYyXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoid2hpdGUiLCJwcmltYXJ5Q29sb3IiOiIjRUNFQ0ZGIiwic2Vjb25kYXJ5Q29sb3IiOiIjZmZmZmRlIiwidGVydGlhcnlDb2xvciI6ImhzbCg4MCwgMTAwJSwgOTYuMjc0NTA5ODAzOSUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDI0MCwgNjAlLCA4Ni4yNzQ1MDk4MDM5JSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xvciI6ImhzbCg2MCwgNjAlLCA4My41Mjk0MTE3NjQ3JSkiLCJ0ZXJ0aWFyeUJvcmRlckNvbG9yIjoiaHNsKDgwLCA2MCUsIDg2LjI3NDUwOTgwMzklKSIsInByaW1hcnlUZXh0Q29sb3IiOiIjMTMxMzAwIiwic2Vjb25kYXJ5VGV4dENvbG9yIjoiIzAwMDAyMSIsInRlcnRpYXJ5VGV4dENvbG9yIjoicmdiKDkuNTAwMDAwMDAwMSwgOS41MDAwMDAwMDAxLCA5LjUwMDAwMDAwMDEpIiwibGluZUNvbG9yIjoiIzMzMzMzMyIsInRleHRDb2xvciI6IiMzMzMiLCJtYWluQmtnIjoiI0VDRUNGRiIsInNlY29uZEJrZyI6IiNmZmZmZGUiLCJib3JkZXIxIjoiIzkzNzBEQiIsImJvcmRlcjIiOiIjYWFhYTMzIiwiYXJyb3doZWFkQ29sb3IiOiIjMzMzMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwibGFiZWxCYWNrZ3JvdW5kIjoiI2U4ZThlOCIsIm5vZGVCa2ciOiIjRUNFQ0ZGIiwibm9kZUJvcmRlciI6IiM5MzcwREIiLCJjbHVzdGVyQmtnIjoiI2ZmZmZkZSIsImNsdXN0ZXJCb3JkZXIiOiIjYWFhYTMzIiwiZGVmYXVsdExpbmtDb2xvciI6IiMzMzMzMzMiLCJ0aXRsZUNvbG9yIjoiIzMzMyIsImVkZ2VMYWJlbEJhY2tncm91bmQiOiIjZThlOGU4IiwiYWN0b3JCb3JkZXIiOiJoc2woMjU5LjYyNjE2ODIyNDMsIDU5Ljc3NjUzNjMxMjglLCA4Ny45MDE5NjA3ODQzJSkiLCJhY3RvckJrZyI6IiNFQ0VDRkYiLCJhY3RvclRleHRDb2xvciI6ImJsYWNrIiwiYWN0b3JMaW5lQ29sb3IiOiJncmV5Iiwic2lnbmFsQ29sb3IiOiIjMzMzIiwic2lnbmFsVGV4dENvbG9yIjoiIzMzMyIsImxhYmVsQm94QmtnQ29sb3IiOiIjRUNFQ0ZGIiwibGFiZWxCb3hCb3JkZXJDb2xvciI6ImhzbCgyNTkuNjI2MTY4MjI0MywgNTkuNzc2NTM2MzEyOCUsIDg3LjkwMTk2MDc4NDMlKSIsImxhYmVsVGV4dENvbG9yIjoiYmxhY2siLCJsb29wVGV4dENvbG9yIjoiYmxhY2siLCJub3RlQm9yZGVyQ29sb3IiOiIjYWFhYTMzIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiJibGFjayIsImFjdGl2YXRpb25Cb3JkZXJDb2xvciI6IiM2NjYiLCJhY3RpdmF0aW9uQmtnQ29sb3IiOiIjZjRmNGY0Iiwic2VxdWVuY2VOdW1iZXJDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yIjoicmdiYSgxMDIsIDEwMiwgMjU1LCAwLjQ5KSIsImFsdFNlY3Rpb25Ca2dDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yMiI6IiNmZmY0MDAiLCJ0YXNrQm9yZGVyQ29sb3IiOiIjNTM0ZmJjIiwidGFza0JrZ0NvbG9yIjoiIzhhOTBkZCIsInRhc2tUZXh0TGlnaHRDb2xvciI6IndoaXRlIiwidGFza1RleHRDb2xvciI6IndoaXRlIiwidGFza1RleHREYXJrQ29sb3IiOiJibGFjayIsInRhc2tUZXh0T3V0c2lkZUNvbG9yIjoiYmxhY2siLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImFjdGl2ZVRhc2tCb3JkZXJDb2xvciI6IiM1MzRmYmMiLCJhY3RpdmVUYXNrQmtnQ29sb3IiOiIjYmZjN2ZmIiwiZ3JpZENvbG9yIjoibGlnaHRncmV5IiwiZG9uZVRhc2tCa2dDb2xvciI6ImxpZ2h0Z3JleSIsImRvbmVUYXNrQm9yZGVyQ29sb3IiOiJncmV5IiwiY3JpdEJvcmRlckNvbG9yIjoiI2ZmODg4OCIsImNyaXRCa2dDb2xvciI6InJlZCIsInRvZGF5TGluZUNvbG9yIjoicmVkIiwibGFiZWxDb2xvciI6ImJsYWNrIiwiZXJyb3JCa2dDb2xvciI6IiM1NTIyMjIiLCJlcnJvclRleHRDb2xvciI6IiM1NTIyMjIiLCJjbGFzc1RleHQiOiIjMTMxMzAwIiwiZmlsbFR5cGUwIjoiI0VDRUNGRiIsImZpbGxUeXBlMSI6IiNmZmZmZGUiLCJmaWxsVHlwZTIiOiJoc2woMzA0LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTMiOiJoc2woMTI0LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkiLCJmaWxsVHlwZTQiOiJoc2woMTc2LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTUiOiJoc2woLTQsIDEwMCUsIDkzLjUyOTQxMTc2NDclKSIsImZpbGxUeXBlNiI6ImhzbCg4LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTciOiJoc2woMTg4LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9">live editor</a>]
|
Class07 : Object[] elementData
|
||||||
</td></tr>
|
Class01 : size()
|
||||||
<tr>
|
Class01 : int chimp
|
||||||
<td><pre>
|
Class01 : int gorilla
|
||||||
|
class Class10 {
|
||||||
|
<<service>>
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## State diagram [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtLXYyXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoid2hpdGUiLCJwcmltYXJ5Q29sb3IiOiIjRUNFQ0ZGIiwic2Vjb25kYXJ5Q29sb3IiOiIjZmZmZmRlIiwidGVydGlhcnlDb2xvciI6ImhzbCg4MCwgMTAwJSwgOTYuMjc0NTA5ODAzOSUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDI0MCwgNjAlLCA4Ni4yNzQ1MDk4MDM5JSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xvciI6ImhzbCg2MCwgNjAlLCA4My41Mjk0MTE3NjQ3JSkiLCJ0ZXJ0aWFyeUJvcmRlckNvbG9yIjoiaHNsKDgwLCA2MCUsIDg2LjI3NDUwOTgwMzklKSIsInByaW1hcnlUZXh0Q29sb3IiOiIjMTMxMzAwIiwic2Vjb25kYXJ5VGV4dENvbG9yIjoiIzAwMDAyMSIsInRlcnRpYXJ5VGV4dENvbG9yIjoicmdiKDkuNTAwMDAwMDAwMSwgOS41MDAwMDAwMDAxLCA5LjUwMDAwMDAwMDEpIiwibGluZUNvbG9yIjoiIzMzMzMzMyIsInRleHRDb2xvciI6IiMzMzMiLCJtYWluQmtnIjoiI0VDRUNGRiIsInNlY29uZEJrZyI6IiNmZmZmZGUiLCJib3JkZXIxIjoiIzkzNzBEQiIsImJvcmRlcjIiOiIjYWFhYTMzIiwiYXJyb3doZWFkQ29sb3IiOiIjMzMzMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwibGFiZWxCYWNrZ3JvdW5kIjoiI2U4ZThlOCIsIm5vZGVCa2ciOiIjRUNFQ0ZGIiwibm9kZUJvcmRlciI6IiM5MzcwREIiLCJjbHVzdGVyQmtnIjoiI2ZmZmZkZSIsImNsdXN0ZXJCb3JkZXIiOiIjYWFhYTMzIiwiZGVmYXVsdExpbmtDb2xvciI6IiMzMzMzMzMiLCJ0aXRsZUNvbG9yIjoiIzMzMyIsImVkZ2VMYWJlbEJhY2tncm91bmQiOiIjZThlOGU4IiwiYWN0b3JCb3JkZXIiOiJoc2woMjU5LjYyNjE2ODIyNDMsIDU5Ljc3NjUzNjMxMjglLCA4Ny45MDE5NjA3ODQzJSkiLCJhY3RvckJrZyI6IiNFQ0VDRkYiLCJhY3RvclRleHRDb2xvciI6ImJsYWNrIiwiYWN0b3JMaW5lQ29sb3IiOiJncmV5Iiwic2lnbmFsQ29sb3IiOiIjMzMzIiwic2lnbmFsVGV4dENvbG9yIjoiIzMzMyIsImxhYmVsQm94QmtnQ29sb3IiOiIjRUNFQ0ZGIiwibGFiZWxCb3hCb3JkZXJDb2xvciI6ImhzbCgyNTkuNjI2MTY4MjI0MywgNTkuNzc2NTM2MzEyOCUsIDg3LjkwMTk2MDc4NDMlKSIsImxhYmVsVGV4dENvbG9yIjoiYmxhY2siLCJsb29wVGV4dENvbG9yIjoiYmxhY2siLCJub3RlQm9yZGVyQ29sb3IiOiIjYWFhYTMzIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiJibGFjayIsImFjdGl2YXRpb25Cb3JkZXJDb2xvciI6IiM2NjYiLCJhY3RpdmF0aW9uQmtnQ29sb3IiOiIjZjRmNGY0Iiwic2VxdWVuY2VOdW1iZXJDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yIjoicmdiYSgxMDIsIDEwMiwgMjU1LCAwLjQ5KSIsImFsdFNlY3Rpb25Ca2dDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yMiI6IiNmZmY0MDAiLCJ0YXNrQm9yZGVyQ29sb3IiOiIjNTM0ZmJjIiwidGFza0JrZ0NvbG9yIjoiIzhhOTBkZCIsInRhc2tUZXh0TGlnaHRDb2xvciI6IndoaXRlIiwidGFza1RleHRDb2xvciI6IndoaXRlIiwidGFza1RleHREYXJrQ29sb3IiOiJibGFjayIsInRhc2tUZXh0T3V0c2lkZUNvbG9yIjoiYmxhY2siLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImFjdGl2ZVRhc2tCb3JkZXJDb2xvciI6IiM1MzRmYmMiLCJhY3RpdmVUYXNrQmtnQ29sb3IiOiIjYmZjN2ZmIiwiZ3JpZENvbG9yIjoibGlnaHRncmV5IiwiZG9uZVRhc2tCa2dDb2xvciI6ImxpZ2h0Z3JleSIsImRvbmVUYXNrQm9yZGVyQ29sb3IiOiJncmV5IiwiY3JpdEJvcmRlckNvbG9yIjoiI2ZmODg4OCIsImNyaXRCa2dDb2xvciI6InJlZCIsInRvZGF5TGluZUNvbG9yIjoicmVkIiwibGFiZWxDb2xvciI6ImJsYWNrIiwiZXJyb3JCa2dDb2xvciI6IiM1NTIyMjIiLCJlcnJvclRleHRDb2xvciI6IiM1NTIyMjIiLCJjbGFzc1RleHQiOiIjMTMxMzAwIiwiZmlsbFR5cGUwIjoiI0VDRUNGRiIsImZpbGxUeXBlMSI6IiNmZmZmZGUiLCJmaWxsVHlwZTIiOiJoc2woMzA0LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTMiOiJoc2woMTI0LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkiLCJmaWxsVHlwZTQiOiJoc2woMTc2LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTUiOiJoc2woLTQsIDEwMCUsIDkzLjUyOTQxMTc2NDclKSIsImZpbGxUeXBlNiI6ImhzbCg4LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTciOiJoc2woMTg4LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9">live editor</a>]
|
||||||
|
```
|
||||||
stateDiagram-v2
|
stateDiagram-v2
|
||||||
[*] --> Still
|
[*] --> Still
|
||||||
Still --> [*]
|
Still --> [*]
|
||||||
@@ -140,46 +150,36 @@ Still --> Moving
|
|||||||
Moving --> Still
|
Moving --> Still
|
||||||
Moving --> Crash
|
Moving --> Crash
|
||||||
Crash --> [*]
|
Crash --> [*]
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-state.png" />
|
stateDiagram-v2
|
||||||
</td>
|
[*] --> Still
|
||||||
</tr>
|
Still --> [*]
|
||||||
<!-- </State> -->
|
Still --> Moving
|
||||||
<!-- <Pie> -->
|
Moving --> Still
|
||||||
<tr><td colspan=2 align="center">
|
Moving --> Crash
|
||||||
<b>Pie</b><br />
|
Crash --> [*]
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/pie">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
```
|
||||||
</td></tr>
|
|
||||||
<tr>
|
### Pie chart [<a href="https://mermaid-js.github.io/mermaid/#/pie">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
<td><pre>
|
|
||||||
|
```
|
||||||
pie
|
pie
|
||||||
"Dogs" : 386
|
"Dogs" : 386
|
||||||
"Cats" : 85
|
"Cats" : 85
|
||||||
"Rats" : 15
|
"Rats" : 15
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-pie.png" />
|
pie
|
||||||
</td>
|
"Dogs" : 386
|
||||||
</tr>
|
"Cats" : 85
|
||||||
<!-- </Pie> -->
|
"Rats" : 15
|
||||||
<!-- <Git> -->
|
```
|
||||||
<tr><td colspan=2 align="center">
|
|
||||||
<b>Git</b><br />
|
## Git graph [experimental - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
[experimental - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
|
||||||
</td></tr>
|
## User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
<tr>
|
```
|
||||||
<td colspan="2" align="center"><i>Coming soon!</i></td>
|
|
||||||
</tr>
|
|
||||||
<!-- </Git> -->
|
|
||||||
<!-- <Journey> -->
|
|
||||||
<tr><td colspan=2 align="center">
|
|
||||||
<b>User Journey</b><br />
|
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
|
||||||
</td></tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<pre>
|
|
||||||
journey
|
journey
|
||||||
title My working day
|
title My working day
|
||||||
section Go to work
|
section Go to work
|
||||||
@@ -189,14 +189,30 @@ pie
|
|||||||
section Go home
|
section Go home
|
||||||
Go downstairs: 5: Me
|
Go downstairs: 5: Me
|
||||||
Sit down: 3: Me
|
Sit down: 3: Me
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img alt="User Journey Diagram" src="img/gray-user-journey.png" />
|
journey
|
||||||
</td>
|
title My working day
|
||||||
</tr>
|
section Go to work
|
||||||
<!-- </Journey> -->
|
Make tea: 5: Me
|
||||||
|
Go upstairs: 3: Me
|
||||||
|
Do work: 1: Me, Cat
|
||||||
|
section Go home
|
||||||
|
Go downstairs: 5: Me
|
||||||
|
Sit down: 3: Me
|
||||||
|
```
|
||||||
|
|
||||||
</table>
|
### Release
|
||||||
|
|
||||||
|
For those who have the permission to do so:
|
||||||
|
|
||||||
|
Update version number in `package.json`.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm publish
|
||||||
|
```
|
||||||
|
|
||||||
|
The above command generates files into the `dist` folder and publishes them to npmjs.org.
|
||||||
|
|
||||||
## Related projects
|
## Related projects
|
||||||
|
|
||||||
@@ -210,10 +226,21 @@ Mermaid is a growing community and is always accepting new contributors. There's
|
|||||||
|
|
||||||
Detailed information about how to contribute can be found in the [contribution guide](CONTRIBUTING.md)
|
Detailed information about how to contribute can be found in the [contribution guide](CONTRIBUTING.md)
|
||||||
|
|
||||||
|
## Security and safe diagrams
|
||||||
|
|
||||||
|
For public sites, it can be precarious to retrieve text from users on the internet, storing that content for presentation in a browser at a later stage. The reason is that the user content can contain embedded malicious scripts that will run when the data is presented. For Mermaid this is a risk, specially as mermaid diagrams contain many characters that are used in html which makes the standard sanitation unusable as it also breaks the diagrams. We still make an effort to sanitise the incoming code and keep refining the process but it is hard to guarantee that there are no loop holes.
|
||||||
|
|
||||||
|
As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing javascript in the code from being executed. This is a great step forward for better security.
|
||||||
|
|
||||||
|
*Unfortunately you can not have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code.*
|
||||||
|
|
||||||
|
## Reporting vulnerabilities
|
||||||
|
To report a vulnerability, please e-mail security@mermaid.live with a description of the issue, the steps you took to create the issue, affected versions, and if known, mitigations for the issue.
|
||||||
|
|
||||||
## Appreciation
|
## Appreciation
|
||||||
A quick note from Knut Sveidqvist:
|
A quick note from Knut Sveidqvist:
|
||||||
>*Many thanks to the [d3](http://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!*
|
>*Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!*
|
||||||
>*Thanks also to the [js-sequence-diagram](http://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.*
|
>*Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.*
|
||||||
>*Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017.*
|
>*Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017.*
|
||||||
>
|
>
|
||||||
>*Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!*
|
>*Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!*
|
||||||
|
273
README.zh-CN.md
273
README.zh-CN.md
@@ -1,4 +1,4 @@
|
|||||||
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://percy.io/Mermaid/mermaid)
|
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
|
||||||
[English](./README.md) | 简体中文
|
[English](./README.md) | 简体中文
|
||||||
|
|
||||||
@@ -15,13 +15,13 @@
|
|||||||
<!-- <Main description> -->
|
<!-- <Main description> -->
|
||||||
Mermaid 是一个基于 Javascript 的图表绘制工具,通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。Mermaid 诞生的主要目的是让文档的更新能够及时跟上开发进度。
|
Mermaid 是一个基于 Javascript 的图表绘制工具,通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。Mermaid 诞生的主要目的是让文档的更新能够及时跟上开发进度。
|
||||||
|
|
||||||
> Mermaid 致力于解决 Doc-Rot 这个令人头疼的问题。
|
> Doc-Rot 是 Mermaid 致力于解决的一个难题。
|
||||||
|
|
||||||
绘图和编写文档花费了开发者宝贵的开发时间,而且随着业务的变更,它很快就会过期。 但是如果缺少了图表或文档,对于生产力和团队新人的业务学习都会产生巨大的阻碍。 <br/>
|
绘图和编写文档花费了开发者宝贵的开发时间,而且随着业务的变更,它很快就会过期。 但是如果缺少了图表或文档,对于生产力和团队新人的业务学习都会产生巨大的阻碍。 <br/>
|
||||||
Mermaid 通过减少创建可修改的图表所需要的时间、精力和工具来解决这一难题,从而提高了内容的智能化和可重用性。 作为一个基于文本的绘图工具, Mermaid 天生就易于维护和更新,它也可以作为生产脚本(或其他代码)的一部分,使得文档编写变得更加简单。 有了它之后,开发者可以从维护文档这个与开发割离且麻烦的任务中解放出来。 <br/>
|
Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它也可以作为生产脚本(或其他代码)的一部分。<br/>
|
||||||
即使是从未接触过编程的非专业人员也可以通过 [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/)来创建图表。<br/>
|
<br/>
|
||||||
你可以访问 [教程](./docs/Tutorials.md) 来查看 Live Editor 的视频教程。
|
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/) 轻松创建详细的图表。<br/>
|
||||||
U也可以查看 [Mermaid 的集成和使用](./docs/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
你可以访问 [教程](./docs/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
||||||
|
|
||||||
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/n00b-overview.md) and [用法](./docs/usage.md).
|
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/n00b-overview.md) and [用法](./docs/usage.md).
|
||||||
|
|
||||||
@@ -31,33 +31,30 @@ U也可以查看 [Mermaid 的集成和使用](./docs/integrations.md) 这个清
|
|||||||
|
|
||||||
## 示例
|
## 示例
|
||||||
|
|
||||||
__下面是一些使用 Mermaid 和类 Markdown 语法创建的图表示例。点击 [语法](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference) 查看详情__
|
__下面是一些可以使用 Mermaid 创建的图表示例。点击 [语法](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference) 查看详情。__
|
||||||
<table>
|
<table>
|
||||||
<!-- <Flowchart> -->
|
<!-- <Flowchart> -->
|
||||||
<tr><td colspan=2 align="center">
|
|
||||||
<b>流程图</b></br>
|
## 流程图 [<a href="https://mermaid-js.github.io/mermaid/#/flowchart">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/flowchart">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
|
||||||
</td></tr>
|
```
|
||||||
<tr>
|
flowchart LR
|
||||||
<td><pre>
|
|
||||||
graph TD
|
|
||||||
A[Hard] -->|Text| B(Round)
|
A[Hard] -->|Text| B(Round)
|
||||||
B --> C{Decision}
|
B --> C{Decision}
|
||||||
C -->|One| D[Result 1]
|
C -->|One| D[Result 1]
|
||||||
C -->|Two| E[Result 2]
|
C -->|Two| E[Result 2]
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-flow.png" />
|
flowchart LR
|
||||||
</td>
|
A[Hard] -->|Text| B(Round)
|
||||||
</tr>
|
B --> C{Decision}
|
||||||
<!-- </Flowchart> -->
|
C -->|One| D[Result 1]
|
||||||
<!-- <Sequence> -->
|
C -->|Two| E[Result 2]
|
||||||
<tr><td colspan=2 align="center">
|
```
|
||||||
<b>时序图</b><br />
|
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/sequenceDiagram">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
## 时序图 [<a href="https://mermaid-js.github.io/mermaid/#/sequenceDiagram">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
</td></tr>
|
|
||||||
<tr>
|
```
|
||||||
<td><pre>
|
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
Alice->>John: Hello John, how are you?
|
Alice->>John: Hello John, how are you?
|
||||||
loop Healthcheck
|
loop Healthcheck
|
||||||
@@ -67,43 +64,48 @@ Note right of John: Rational thoughts!
|
|||||||
John-->>Alice: Great!
|
John-->>Alice: Great!
|
||||||
John->>Bob: How about you?
|
John->>Bob: How about you?
|
||||||
Bob-->>John: Jolly good!
|
Bob-->>John: Jolly good!
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-sequence.png" />
|
sequenceDiagram
|
||||||
</td>
|
Alice->>John: Hello John, how are you?
|
||||||
</tr>
|
loop Healthcheck
|
||||||
<!-- </Sequence> -->
|
John->>John: Fight against hypochondria
|
||||||
<!-- <Gantt> -->
|
end
|
||||||
<tr><td colspan=2 align="center">
|
Note right of John: Rational thoughts!
|
||||||
<b>甘特图</b><br />
|
John-->>Alice: Great!
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/gantt">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
John->>Bob: How about you?
|
||||||
</td></tr>
|
Bob-->>John: Jolly good!
|
||||||
<tr>
|
```
|
||||||
<td><pre>
|
|
||||||
|
## 甘特图 [<a href="https://mermaid-js.github.io/mermaid/#/gantt">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
gantt
|
gantt
|
||||||
section Section
|
section Section
|
||||||
Completed :done, des1, 2014-01-06,2014-01-08
|
Completed :done, des1, 2014-01-06,2014-01-08
|
||||||
Active :active, des2, 2014-01-07, 3d
|
Active :active, des2, 2014-01-07, 3d
|
||||||
Parallel 1 : des3, after des1, 1d
|
Parallel 1 : des3, after des1, 1d
|
||||||
Parallel 2 : des4, after des1, 1d
|
Parallel 2 : des4, after des1, 1d
|
||||||
Parallel 3 : des5, after des3, 1d
|
Parallel 3 : des5, after des3, 1d
|
||||||
Parallel 4 : des6, after des4, 1d
|
Parallel 4 : des6, after des4, 1d
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-gantt.png" />
|
gantt
|
||||||
</td>
|
section Section
|
||||||
</tr>
|
Completed :done, des1, 2014-01-06,2014-01-08
|
||||||
<!-- </Gantt> -->
|
Active :active, des2, 2014-01-07, 3d
|
||||||
<!-- <Class> -->
|
Parallel 1 : des3, after des1, 1d
|
||||||
<tr><td colspan=2 align="center">
|
Parallel 2 : des4, after des1, 1d
|
||||||
<b>类图</b><br />
|
Parallel 3 : des5, after des3, 1d
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/classDiagram">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
Parallel 4 : des6, after des4, 1d
|
||||||
</td></tr>
|
```
|
||||||
<tr>
|
|
||||||
<td><pre>
|
## 类图 [<a href="https://mermaid-js.github.io/mermaid/#/classDiagram">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
classDiagram
|
classDiagram
|
||||||
Class01 <|-- AveryLongClass : Cool
|
Class01 <|-- AveryLongClass : Cool
|
||||||
<<interface>> Class01
|
<<Interface>> Class01
|
||||||
Class09 --> C2 : Where am i?
|
Class09 --> C2 : Where am i?
|
||||||
Class09 --* C3
|
Class09 --* C3
|
||||||
Class09 --|> Class07
|
Class09 --|> Class07
|
||||||
@@ -113,23 +115,33 @@ Class01 : size()
|
|||||||
Class01 : int chimp
|
Class01 : int chimp
|
||||||
Class01 : int gorilla
|
Class01 : int gorilla
|
||||||
class Class10 {
|
class Class10 {
|
||||||
<<service>>
|
<<service>>
|
||||||
int id
|
int id
|
||||||
size()
|
size()
|
||||||
}
|
}
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-class.png" />
|
classDiagram
|
||||||
</td>
|
Class01 <|-- AveryLongClass : Cool
|
||||||
</tr>
|
<<Interface>> Class01
|
||||||
<!-- </Class> -->
|
Class09 --> C2 : Where am i?
|
||||||
<!-- <State> -->
|
Class09 --* C3
|
||||||
<tr><td colspan=2 align="center">
|
Class09 --|> Class07
|
||||||
<b>状态图</b><br />
|
Class07 : equals()
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/stateDiagram">文档</a> - <a href="https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtLXYyXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoid2hpdGUiLCJwcmltYXJ5Q29sb3IiOiIjRUNFQ0ZGIiwic2Vjb25kYXJ5Q29sb3IiOiIjZmZmZmRlIiwidGVydGlhcnlDb2xvciI6ImhzbCg4MCwgMTAwJSwgOTYuMjc0NTA5ODAzOSUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDI0MCwgNjAlLCA4Ni4yNzQ1MDk4MDM5JSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xvciI6ImhzbCg2MCwgNjAlLCA4My41Mjk0MTE3NjQ3JSkiLCJ0ZXJ0aWFyeUJvcmRlckNvbG9yIjoiaHNsKDgwLCA2MCUsIDg2LjI3NDUwOTgwMzklKSIsInByaW1hcnlUZXh0Q29sb3IiOiIjMTMxMzAwIiwic2Vjb25kYXJ5VGV4dENvbG9yIjoiIzAwMDAyMSIsInRlcnRpYXJ5VGV4dENvbG9yIjoicmdiKDkuNTAwMDAwMDAwMSwgOS41MDAwMDAwMDAxLCA5LjUwMDAwMDAwMDEpIiwibGluZUNvbG9yIjoiIzMzMzMzMyIsInRleHRDb2xvciI6IiMzMzMiLCJtYWluQmtnIjoiI0VDRUNGRiIsInNlY29uZEJrZyI6IiNmZmZmZGUiLCJib3JkZXIxIjoiIzkzNzBEQiIsImJvcmRlcjIiOiIjYWFhYTMzIiwiYXJyb3doZWFkQ29sb3IiOiIjMzMzMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwibGFiZWxCYWNrZ3JvdW5kIjoiI2U4ZThlOCIsIm5vZGVCa2ciOiIjRUNFQ0ZGIiwibm9kZUJvcmRlciI6IiM5MzcwREIiLCJjbHVzdGVyQmtnIjoiI2ZmZmZkZSIsImNsdXN0ZXJCb3JkZXIiOiIjYWFhYTMzIiwiZGVmYXVsdExpbmtDb2xvciI6IiMzMzMzMzMiLCJ0aXRsZUNvbG9yIjoiIzMzMyIsImVkZ2VMYWJlbEJhY2tncm91bmQiOiIjZThlOGU4IiwiYWN0b3JCb3JkZXIiOiJoc2woMjU5LjYyNjE2ODIyNDMsIDU5Ljc3NjUzNjMxMjglLCA4Ny45MDE5NjA3ODQzJSkiLCJhY3RvckJrZyI6IiNFQ0VDRkYiLCJhY3RvclRleHRDb2xvciI6ImJsYWNrIiwiYWN0b3JMaW5lQ29sb3IiOiJncmV5Iiwic2lnbmFsQ29sb3IiOiIjMzMzIiwic2lnbmFsVGV4dENvbG9yIjoiIzMzMyIsImxhYmVsQm94QmtnQ29sb3IiOiIjRUNFQ0ZGIiwibGFiZWxCb3hCb3JkZXJDb2xvciI6ImhzbCgyNTkuNjI2MTY4MjI0MywgNTkuNzc2NTM2MzEyOCUsIDg3LjkwMTk2MDc4NDMlKSIsImxhYmVsVGV4dENvbG9yIjoiYmxhY2siLCJsb29wVGV4dENvbG9yIjoiYmxhY2siLCJub3RlQm9yZGVyQ29sb3IiOiIjYWFhYTMzIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiJibGFjayIsImFjdGl2YXRpb25Cb3JkZXJDb2xvciI6IiM2NjYiLCJhY3RpdmF0aW9uQmtnQ29sb3IiOiIjZjRmNGY0Iiwic2VxdWVuY2VOdW1iZXJDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yIjoicmdiYSgxMDIsIDEwMiwgMjU1LCAwLjQ5KSIsImFsdFNlY3Rpb25Ca2dDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yMiI6IiNmZmY0MDAiLCJ0YXNrQm9yZGVyQ29sb3IiOiIjNTM0ZmJjIiwidGFza0JrZ0NvbG9yIjoiIzhhOTBkZCIsInRhc2tUZXh0TGlnaHRDb2xvciI6IndoaXRlIiwidGFza1RleHRDb2xvciI6IndoaXRlIiwidGFza1RleHREYXJrQ29sb3IiOiJibGFjayIsInRhc2tUZXh0T3V0c2lkZUNvbG9yIjoiYmxhY2siLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImFjdGl2ZVRhc2tCb3JkZXJDb2xvciI6IiM1MzRmYmMiLCJhY3RpdmVUYXNrQmtnQ29sb3IiOiIjYmZjN2ZmIiwiZ3JpZENvbG9yIjoibGlnaHRncmV5IiwiZG9uZVRhc2tCa2dDb2xvciI6ImxpZ2h0Z3JleSIsImRvbmVUYXNrQm9yZGVyQ29sb3IiOiJncmV5IiwiY3JpdEJvcmRlckNvbG9yIjoiI2ZmODg4OCIsImNyaXRCa2dDb2xvciI6InJlZCIsInRvZGF5TGluZUNvbG9yIjoicmVkIiwibGFiZWxDb2xvciI6ImJsYWNrIiwiZXJyb3JCa2dDb2xvciI6IiM1NTIyMjIiLCJlcnJvclRleHRDb2xvciI6IiM1NTIyMjIiLCJjbGFzc1RleHQiOiIjMTMxMzAwIiwiZmlsbFR5cGUwIjoiI0VDRUNGRiIsImZpbGxUeXBlMSI6IiNmZmZmZGUiLCJmaWxsVHlwZTIiOiJoc2woMzA0LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTMiOiJoc2woMTI0LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkiLCJmaWxsVHlwZTQiOiJoc2woMTc2LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTUiOiJoc2woLTQsIDEwMCUsIDkzLjUyOTQxMTc2NDclKSIsImZpbGxUeXBlNiI6ImhzbCg4LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTciOiJoc2woMTg4LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9">live editor</a>]
|
Class07 : Object[] elementData
|
||||||
</td></tr>
|
Class01 : size()
|
||||||
<tr>
|
Class01 : int chimp
|
||||||
<td><pre>
|
Class01 : int gorilla
|
||||||
|
class Class10 {
|
||||||
|
<<service>>
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 状态图 [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">文档</a> - <a href="https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtLXYyXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoid2hpdGUiLCJwcmltYXJ5Q29sb3IiOiIjRUNFQ0ZGIiwic2Vjb25kYXJ5Q29sb3IiOiIjZmZmZmRlIiwidGVydGlhcnlDb2xvciI6ImhzbCg4MCwgMTAwJSwgOTYuMjc0NTA5ODAzOSUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDI0MCwgNjAlLCA4Ni4yNzQ1MDk4MDM5JSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xvciI6ImhzbCg2MCwgNjAlLCA4My41Mjk0MTE3NjQ3JSkiLCJ0ZXJ0aWFyeUJvcmRlckNvbG9yIjoiaHNsKDgwLCA2MCUsIDg2LjI3NDUwOTgwMzklKSIsInByaW1hcnlUZXh0Q29sb3IiOiIjMTMxMzAwIiwic2Vjb25kYXJ5VGV4dENvbG9yIjoiIzAwMDAyMSIsInRlcnRpYXJ5VGV4dENvbG9yIjoicmdiKDkuNTAwMDAwMDAwMSwgOS41MDAwMDAwMDAxLCA5LjUwMDAwMDAwMDEpIiwibGluZUNvbG9yIjoiIzMzMzMzMyIsInRleHRDb2xvciI6IiMzMzMiLCJtYWluQmtnIjoiI0VDRUNGRiIsInNlY29uZEJrZyI6IiNmZmZmZGUiLCJib3JkZXIxIjoiIzkzNzBEQiIsImJvcmRlcjIiOiIjYWFhYTMzIiwiYXJyb3doZWFkQ29sb3IiOiIjMzMzMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwibGFiZWxCYWNrZ3JvdW5kIjoiI2U4ZThlOCIsIm5vZGVCa2ciOiIjRUNFQ0ZGIiwibm9kZUJvcmRlciI6IiM5MzcwREIiLCJjbHVzdGVyQmtnIjoiI2ZmZmZkZSIsImNsdXN0ZXJCb3JkZXIiOiIjYWFhYTMzIiwiZGVmYXVsdExpbmtDb2xvciI6IiMzMzMzMzMiLCJ0aXRsZUNvbG9yIjoiIzMzMyIsImVkZ2VMYWJlbEJhY2tncm91bmQiOiIjZThlOGU4IiwiYWN0b3JCb3JkZXIiOiJoc2woMjU5LjYyNjE2ODIyNDMsIDU5Ljc3NjUzNjMxMjglLCA4Ny45MDE5NjA3ODQzJSkiLCJhY3RvckJrZyI6IiNFQ0VDRkYiLCJhY3RvclRleHRDb2xvciI6ImJsYWNrIiwiYWN0b3JMaW5lQ29sb3IiOiJncmV5Iiwic2lnbmFsQ29sb3IiOiIjMzMzIiwic2lnbmFsVGV4dENvbG9yIjoiIzMzMyIsImxhYmVsQm94QmtnQ29sb3IiOiIjRUNFQ0ZGIiwibGFiZWxCb3hCb3JkZXJDb2xvciI6ImhzbCgyNTkuNjI2MTY4MjI0MywgNTkuNzc2NTM2MzEyOCUsIDg3LjkwMTk2MDc4NDMlKSIsImxhYmVsVGV4dENvbG9yIjoiYmxhY2siLCJsb29wVGV4dENvbG9yIjoiYmxhY2siLCJub3RlQm9yZGVyQ29sb3IiOiIjYWFhYTMzIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiJibGFjayIsImFjdGl2YXRpb25Cb3JkZXJDb2xvciI6IiM2NjYiLCJhY3RpdmF0aW9uQmtnQ29sb3IiOiIjZjRmNGY0Iiwic2VxdWVuY2VOdW1iZXJDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yIjoicmdiYSgxMDIsIDEwMiwgMjU1LCAwLjQ5KSIsImFsdFNlY3Rpb25Ca2dDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yMiI6IiNmZmY0MDAiLCJ0YXNrQm9yZGVyQ29sb3IiOiIjNTM0ZmJjIiwidGFza0JrZ0NvbG9yIjoiIzhhOTBkZCIsInRhc2tUZXh0TGlnaHRDb2xvciI6IndoaXRlIiwidGFza1RleHRDb2xvciI6IndoaXRlIiwidGFza1RleHREYXJrQ29sb3IiOiJibGFjayIsInRhc2tUZXh0T3V0c2lkZUNvbG9yIjoiYmxhY2siLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImFjdGl2ZVRhc2tCb3JkZXJDb2xvciI6IiM1MzRmYmMiLCJhY3RpdmVUYXNrQmtnQ29sb3IiOiIjYmZjN2ZmIiwiZ3JpZENvbG9yIjoibGlnaHRncmV5IiwiZG9uZVRhc2tCa2dDb2xvciI6ImxpZ2h0Z3JleSIsImRvbmVUYXNrQm9yZGVyQ29sb3IiOiJncmV5IiwiY3JpdEJvcmRlckNvbG9yIjoiI2ZmODg4OCIsImNyaXRCa2dDb2xvciI6InJlZCIsInRvZGF5TGluZUNvbG9yIjoicmVkIiwibGFiZWxDb2xvciI6ImJsYWNrIiwiZXJyb3JCa2dDb2xvciI6IiM1NTIyMjIiLCJlcnJvclRleHRDb2xvciI6IiM1NTIyMjIiLCJjbGFzc1RleHQiOiIjMTMxMzAwIiwiZmlsbFR5cGUwIjoiI0VDRUNGRiIsImZpbGxUeXBlMSI6IiNmZmZmZGUiLCJmaWxsVHlwZTIiOiJoc2woMzA0LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTMiOiJoc2woMTI0LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkiLCJmaWxsVHlwZTQiOiJoc2woMTc2LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTUiOiJoc2woLTQsIDEwMCUsIDkzLjUyOTQxMTc2NDclKSIsImZpbGxUeXBlNiI6ImhzbCg4LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTciOiJoc2woMTg4LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
stateDiagram-v2
|
stateDiagram-v2
|
||||||
[*] --> Still
|
[*] --> Still
|
||||||
Still --> [*]
|
Still --> [*]
|
||||||
@@ -137,46 +149,37 @@ Still --> Moving
|
|||||||
Moving --> Still
|
Moving --> Still
|
||||||
Moving --> Crash
|
Moving --> Crash
|
||||||
Crash --> [*]
|
Crash --> [*]
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-state.png" />
|
stateDiagram-v2
|
||||||
</td>
|
[*] --> Still
|
||||||
</tr>
|
Still --> [*]
|
||||||
<!-- </State> -->
|
Still --> Moving
|
||||||
<!-- <Pie> -->
|
Moving --> Still
|
||||||
<tr><td colspan=2 align="center">
|
Moving --> Crash
|
||||||
<b>饼图</b><br />
|
Crash --> [*]
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/pie">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
```
|
||||||
</td></tr>
|
|
||||||
<tr>
|
## 饼图 [<a href="https://mermaid-js.github.io/mermaid/#/pie">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
<td><pre>
|
|
||||||
|
```
|
||||||
pie
|
pie
|
||||||
"Dogs" : 386
|
"Dogs" : 386
|
||||||
"Cats" : 85
|
"Cats" : 85
|
||||||
"Rats" : 15
|
"Rats" : 15
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/master/img/gray-pie.png" />
|
pie
|
||||||
</td>
|
"Dogs" : 386
|
||||||
</tr>
|
"Cats" : 85
|
||||||
<!-- </Pie> -->
|
"Rats" : 15
|
||||||
<!-- <Git> -->
|
```
|
||||||
<tr><td colspan=2 align="center">
|
|
||||||
<b>Git图</b><br />
|
## Git图 [实验特性 - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
[实验特性 - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
|
||||||
</td></tr>
|
## 用户体验旅程图 [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
<tr>
|
|
||||||
<td colspan="2" align="center"><i>敬请期待!</i></td>
|
```
|
||||||
</tr>
|
|
||||||
<!-- </Git> -->
|
|
||||||
<!-- <Journey> -->
|
|
||||||
<tr><td colspan=2 align="center">
|
|
||||||
<b>用户体验旅程图</b><br />
|
|
||||||
[<a href="http://mermaid-js.github.io/mermaid/#/user-journey">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
|
||||||
</td></tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<pre>
|
|
||||||
journey
|
journey
|
||||||
title My working day
|
title My working day
|
||||||
section Go to work
|
section Go to work
|
||||||
@@ -186,14 +189,30 @@ pie
|
|||||||
section Go home
|
section Go home
|
||||||
Go downstairs: 5: Me
|
Go downstairs: 5: Me
|
||||||
Sit down: 3: Me
|
Sit down: 3: Me
|
||||||
</pre></td>
|
```
|
||||||
<td align="center">
|
```mermaid
|
||||||
<img alt="User Journey Diagram" src="img/gray-user-journey.png" />
|
journey
|
||||||
</td>
|
title My working day
|
||||||
</tr>
|
section Go to work
|
||||||
<!-- </Journey> -->
|
Make tea: 5: Me
|
||||||
|
Go upstairs: 3: Me
|
||||||
|
Do work: 1: Me, Cat
|
||||||
|
section Go home
|
||||||
|
Go downstairs: 5: Me
|
||||||
|
Sit down: 3: Me
|
||||||
|
```
|
||||||
|
|
||||||
</table>
|
### 发布
|
||||||
|
|
||||||
|
对于有权限的同学来说,你可以通过以下步骤来完成发布操作:
|
||||||
|
|
||||||
|
更新 `package.json` 中的版本号,然后执行如下命令:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm publish
|
||||||
|
```
|
||||||
|
|
||||||
|
以上的命令会将文件打包到 `dist` 目录并发布至 npmjs.org.
|
||||||
|
|
||||||
## 相关项目
|
## 相关项目
|
||||||
|
|
||||||
@@ -207,10 +226,22 @@ Mermaid 是一个不断发展中的社区,并且还在接收新的贡献者。
|
|||||||
|
|
||||||
关于如何贡献的详细信息可以在 [贡献指南](CONTRIBUTING.md) 中找到。
|
关于如何贡献的详细信息可以在 [贡献指南](CONTRIBUTING.md) 中找到。
|
||||||
|
|
||||||
|
## 安全
|
||||||
|
|
||||||
|
对于公开网站来说,从互联网上的用户处检索文本、存储供后续在浏览器中展示的内容可能是不安全的,理由是用户的内容可能嵌入一些数据加载完成之后就会运行的恶意脚本,这些对于 Mermaid 来说毫无疑问是一个风险,尤其是 mermaid 图表还包含了许多在 html 中使用的字符,这意味着我们难以使用常规的手段来过滤不安全代码,因为这些常规手段会造成图表损坏。我们仍然在努力对获取到的代码进行安全过滤并不断完善我们的程序,但很难保证没有漏洞。
|
||||||
|
|
||||||
|
作为拥有外部用户的网站的额外安全级别,我们很高兴推出一个新的安全级别,其中的图表在沙盒 iframe 中渲染,防止代码中的 javascript 被执行,这是在安全性方面迈出的一大步。
|
||||||
|
|
||||||
|
*很不幸的是,鱼与熊掌不可兼得,在这个场景下它意味着在可能的恶意代码被阻止时,也会损失部分交互能力*。
|
||||||
|
|
||||||
|
## 报告漏洞
|
||||||
|
|
||||||
|
如果想要报告漏洞,请发送邮件到 security@mermaid.live, 并附上问题的描述、复现问题的步骤、受影响的版本,以及解决问题的方案(如果有的话)。
|
||||||
|
|
||||||
## 鸣谢
|
## 鸣谢
|
||||||
来自 Knut Sveidqvist:
|
来自 Knut Sveidqvist:
|
||||||
>*特别感谢 [d3](http://d3js.org/) 和 [dagre-d3](https://github.com/cpettitt/dagre-d3) 这两个优秀的项目,它们提供了图形布局和绘图工具库! *
|
>*特别感谢 [d3](https://d3js.org/) 和 [dagre-d3](https://github.com/cpettitt/dagre-d3) 这两个优秀的项目,它们提供了图形布局和绘图工具库! *
|
||||||
>*同样感谢 [js-sequence-diagram](http://bramp.github.io/js-sequence-diagrams) 提供了时序图语法的使用。 感谢 Jessica Peter 提供了甘特图渲染的灵感。*
|
>*同样感谢 [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) 提供了时序图语法的使用。 感谢 Jessica Peter 提供了甘特图渲染的灵感。*
|
||||||
>*感谢 [Tyler Long](https://github.com/tylerlong) 从 2017年四月开始成为了项目的合作者。*
|
>*感谢 [Tyler Long](https://github.com/tylerlong) 从 2017年四月开始成为了项目的合作者。*
|
||||||
>
|
>
|
||||||
>*感谢越来越多的 [贡献者们](https://github.com/knsv/mermaid/graphs/contributors),没有你们,就没有这个项目的今天!*
|
>*感谢越来越多的 [贡献者们](https://github.com/knsv/mermaid/graphs/contributors),没有你们,就没有这个项目的今天!*
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "Using fixtures to represent data",
|
"name": "Using fixtures to represent data",
|
||||||
"email": "hello@cypress.io",
|
"email": "hello@cypress.io",
|
||||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||||
}
|
}
|
@@ -47,7 +47,11 @@ export const imgSnapshotTest = (graphStr, _options, api) => {
|
|||||||
|
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
cy.percySnapshot();
|
// cy.percySnapshot();
|
||||||
|
// Default name to test title
|
||||||
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
|
cy.matchImageSnapshot(name);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const renderGraph = (graphStr, options, api) => {
|
export const renderGraph = (graphStr, options, api) => {
|
||||||
|
@@ -111,7 +111,9 @@ describe('Configuration', () => {
|
|||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
|
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
cy.percySnapshot();
|
cy.matchImageSnapshot(
|
||||||
|
'configuration.spec-should-not-taint-initial-configuration-when-using-multiple-directives'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -110,4 +110,9 @@ describe('XSS', () => {
|
|||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.get('#the-malware').should('not.exist');
|
cy.get('#the-malware').should('not.exist');
|
||||||
});
|
});
|
||||||
|
it('should sanitize cardinalities properly in class diagrams', () => {
|
||||||
|
cy.visit('http://localhost:9000/xss18.html');
|
||||||
|
cy.wait(1000);
|
||||||
|
cy.get('#the-malware').should('not.exist');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -134,7 +134,7 @@ graph TD
|
|||||||
const url = 'http://localhost:9000/theme-directives.html';
|
const url = 'http://localhost:9000/theme-directives.html';
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
cy.percySnapshot();
|
cy.matchImageSnapshot('conf-and-directives.spec-when-rendering-several-diagrams-diagram-1');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -183,11 +183,58 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should render entities with keys', () => {
|
||||||
|
renderGraph(
|
||||||
|
`
|
||||||
|
erDiagram
|
||||||
|
AUTHOR_WITH_LONG_ENTITY_NAME {
|
||||||
|
string name PK
|
||||||
|
}
|
||||||
|
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
|
||||||
|
BOOK {
|
||||||
|
float price
|
||||||
|
string author FK
|
||||||
|
string title PK
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render entities with comments', () => {
|
||||||
|
renderGraph(
|
||||||
|
`
|
||||||
|
erDiagram
|
||||||
|
AUTHOR_WITH_LONG_ENTITY_NAME {
|
||||||
|
string name "comment"
|
||||||
|
}
|
||||||
|
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
|
||||||
|
BOOK {
|
||||||
|
string author
|
||||||
|
string title "author comment"
|
||||||
|
float price "price comment"
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
|
||||||
it('should render entities with keys and comments', () => {
|
it('should render entities with keys and comments', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
erDiagram
|
erDiagram
|
||||||
BOOK { string title PK "comment"}
|
AUTHOR_WITH_LONG_ENTITY_NAME {
|
||||||
|
string name PK "comment"
|
||||||
|
}
|
||||||
|
AUTHOR_WITH_LONG_ENTITY_NAME }|..|{ BOOK : writes
|
||||||
|
BOOK {
|
||||||
|
string description
|
||||||
|
float price "price comment"
|
||||||
|
string title PK "title comment"
|
||||||
|
string author FK
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
|
@@ -368,6 +368,7 @@ flowchart TD
|
|||||||
I{{red text}} -->|default style| J[/blue text/]
|
I{{red text}} -->|default style| J[/blue text/]
|
||||||
K[\\ red text\\] -->|default style| L[/blue text\\]
|
K[\\ red text\\] -->|default style| L[/blue text\\]
|
||||||
M[\\ red text/] -->|default style| N[blue text];
|
M[\\ red text/] -->|default style| N[blue text];
|
||||||
|
O(((red text))) -->|default style| P(((blue text)));
|
||||||
linkStyle default color:Sienna;
|
linkStyle default color:Sienna;
|
||||||
style A stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
style A stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
style B stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
style B stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
@@ -383,6 +384,8 @@ flowchart TD
|
|||||||
style L stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
style L stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
style M stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
style M stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
style N stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
style N stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style O stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style P stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
`,
|
`,
|
||||||
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose', logLevel: 2 }
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose', logLevel: 2 }
|
||||||
);
|
);
|
||||||
@@ -610,7 +613,7 @@ flowchart RL
|
|||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`flowchart TB
|
`flowchart TB
|
||||||
a{{"Lorem 'ipsum' dolor 'sit' amet, 'consectetur' adipiscing 'elit'."}}
|
a{{"Lorem 'ipsum' dolor 'sit' amet, 'consectetur' adipiscing 'elit'."}}
|
||||||
--> b{{"Lorem #quot;ipsum#quot; dolor #quot;sit#quot; amet,#quot;consectetur#quot; adipiscing #quot;elit#quot;."}}
|
--> b{{"Lorem #quot;ipsum#quot; dolor #quot;sit#quot; amet,#quot;consectetur#quot; adipiscing #quot;elit#quot;."}}
|
||||||
`,
|
`,
|
||||||
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
);
|
);
|
||||||
@@ -638,4 +641,15 @@ flowchart RL
|
|||||||
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('2388: handling default in the node name', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart LR
|
||||||
|
default-index.js --> dot.template.js
|
||||||
|
index.js --> module-utl.js
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,20 +1,105 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util.js';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Sequencediagram', () => {
|
describe('Git Graph diagram', () => {
|
||||||
// it('should render a simple git graph', () => {
|
it('1: should render a simple gitgraph with commit on main branch', () => {
|
||||||
// imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
// `
|
`gitGraph
|
||||||
// gitGraph:
|
commit id: "1"
|
||||||
// commit
|
commit id: "2"
|
||||||
// branch newbranch
|
commit id: "3"
|
||||||
// checkout newbranch
|
`,
|
||||||
// commit
|
{}
|
||||||
// commit
|
);
|
||||||
// checkout master
|
});
|
||||||
// commit
|
it('2: should render a simple gitgraph with commit on main branch with Id', () => {
|
||||||
// commit
|
imgSnapshotTest(
|
||||||
// merge newbranch`,
|
`gitGraph
|
||||||
// { logLevel: 0 }
|
commit id: "One"
|
||||||
// );
|
commit id: "Two"
|
||||||
// });
|
commit id: "Three"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('3: should render a simple gitgraph with different commitTypes on main branch ', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`gitGraph
|
||||||
|
commit id: "Normal Commit"
|
||||||
|
commit id: "Reverse Commit" type: REVERSE
|
||||||
|
commit id: "Hightlight Commit" type: HIGHLIGHT
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('4: should render a simple gitgraph with tags commitTypes on main branch ', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`gitGraph
|
||||||
|
commit id: "Normal Commit with tag" tag: "v1.0.0"
|
||||||
|
commit id: "Reverse Commit with tag" type: REVERSE tag: "RC_1"
|
||||||
|
commit id: "Hightlight Commit" type: HIGHLIGHT tag: "8.8.4"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('5: should render a simple gitgraph with two branches', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`gitGraph
|
||||||
|
commit id: "1"
|
||||||
|
commit id: "2"
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id: "3"
|
||||||
|
commit id: "4"
|
||||||
|
checkout main
|
||||||
|
commit id: "5"
|
||||||
|
commit id: "6"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('6: should render a simple gitgraph with two branches and merge commit', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`gitGraph
|
||||||
|
commit id: "1"
|
||||||
|
commit id: "2"
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id: "3"
|
||||||
|
commit id: "4"
|
||||||
|
checkout main
|
||||||
|
merge develop
|
||||||
|
commit id: "5"
|
||||||
|
commit id: "6"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('7: should render a simple gitgraph with three branches and merge commit', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`gitGraph
|
||||||
|
commit id: "1"
|
||||||
|
commit id: "2"
|
||||||
|
branch nice_feature
|
||||||
|
checkout nice_feature
|
||||||
|
commit id: "3"
|
||||||
|
checkout main
|
||||||
|
commit id: "4"
|
||||||
|
checkout nice_feature
|
||||||
|
branch very_nice_feature
|
||||||
|
checkout very_nice_feature
|
||||||
|
commit id: "5"
|
||||||
|
checkout main
|
||||||
|
commit id: "6"
|
||||||
|
checkout nice_feature
|
||||||
|
commit id: "7"
|
||||||
|
checkout main
|
||||||
|
merge nice_feature
|
||||||
|
checkout very_nice_feature
|
||||||
|
commit id: "8"
|
||||||
|
checkout main
|
||||||
|
commit id: "9"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -552,7 +552,7 @@ context('Sequence diagram', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should override config with directive settings', () => {
|
it('should override config with directive settings 2', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
%%{init: { "config": { "mirrorActors": false, "wrap": true }}}%%
|
%%{init: { "config": { "mirrorActors": false, "wrap": true }}}%%
|
||||||
|
@@ -158,7 +158,7 @@ describe('State diagram', () => {
|
|||||||
);
|
);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
it('v2 should render a simple state diagrams', () => {
|
it('v2 should render a simple state diagrams 2', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
stateDiagram-v2
|
stateDiagram-v2
|
||||||
|
@@ -148,7 +148,7 @@ describe('State diagram', () => {
|
|||||||
);
|
);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
it('should render a simple state diagrams', () => {
|
it('should render a simple state diagrams 2', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
stateDiagram
|
stateDiagram
|
||||||
|
@@ -1,5 +1,30 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util.js';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('themeCSS balancing, it', () => {
|
||||||
|
it('should not allow unbalanced CSS definitions', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: { 'themeCSS': '} * { background: red }' } }%%
|
||||||
|
flowchart TD
|
||||||
|
a --> b
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should not allow unbalanced CSS definitions 2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init: { 'themeCSS': '\u007D * { background: red }' } }%%
|
||||||
|
flowchart TD
|
||||||
|
a2 --> b2
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Pie Chart', () => {
|
describe('Pie Chart', () => {
|
||||||
// beforeEach(()=>{
|
// beforeEach(()=>{
|
||||||
// cy.clock((new Date('2014-06-09')).getTime());
|
// cy.clock((new Date('2014-06-09')).getTime());
|
||||||
|
@@ -115,14 +115,14 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'linear', "htmlLabels": true },
|
flowchart: { curve: 'linear', htmlLabels: true },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
@@ -131,9 +131,11 @@
|
|||||||
// fontFamily: '"arial", sans-serif',
|
// fontFamily: '"arial", sans-serif',
|
||||||
// },
|
// },
|
||||||
curve: 'linear',
|
curve: 'linear',
|
||||||
securityLevel: 'loose'
|
securityLevel: 'loose',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -130,39 +130,39 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click'
|
div.className = 'created-by-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Flow'
|
div.innerText = 'Clicked By Flow';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByFlowArg(argument) {
|
function clickByFlowArg(argument) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click-2'
|
div.className = 'created-by-click-2';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Flow: ' + argument
|
div.innerText = 'Clicked By Flow: ' + argument;
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByGantt(arg1, arg2, arg3) {
|
function clickByGantt(arg1, arg2, arg3) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-gant-click'
|
div.className = 'created-by-gant-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Gant'
|
div.innerText = 'Clicked By Gant';
|
||||||
if (arg1) div.innerText += ' ' + arg1;
|
if (arg1) div.innerText += ' ' + arg1;
|
||||||
if (arg2) div.innerText += ' ' + arg2;
|
if (arg2) div.innerText += ' ' + arg2;
|
||||||
if (arg3) div.innerText += ' ' + arg3;
|
if (arg3) div.innerText += ' ' + arg3;
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByClass(arg) {
|
function clickByClass(arg) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-class-click'
|
div.className = 'created-by-class-click';
|
||||||
div.style = 'padding: 20px; background: purple; color: white;'
|
div.style = 'padding: 20px; background: purple; color: white;';
|
||||||
div.innerText = 'Clicked By Class' + (arg?arg:'')
|
div.innerText = 'Clicked By Class' + (arg ? arg : '');
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
|
@@ -62,20 +62,20 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click'
|
div.className = 'created-by-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Flow'
|
div.innerText = 'Clicked By Flow';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByGantt(elemName) {
|
function clickByGantt(elemName) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-gant-click'
|
div.className = 'created-by-gant-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Gant'
|
div.innerText = 'Clicked By Gant';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'strct', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'strct', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
|
170
cypress/platform/click_security_sandbox.html
Normal file
170
cypress/platform/click_security_sandbox.html
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<!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=">
|
||||||
|
<style>
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="display: flex">
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
graph TB
|
||||||
|
Function-->URL
|
||||||
|
click Function clickByFlow "Add a div"
|
||||||
|
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
||||||
|
</div>
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
graph TB
|
||||||
|
1Function--->2URL
|
||||||
|
click 1Function clickByFlow "Add a div"
|
||||||
|
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
||||||
|
</div>
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
flowchart TB
|
||||||
|
Function-->URL
|
||||||
|
click Function clickByFlow "Add a div"
|
||||||
|
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
|
</div>
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
flowchart TB
|
||||||
|
1Function--->2URL
|
||||||
|
click 1Function clickByFlow "Add a div"
|
||||||
|
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
class ShapeLink
|
||||||
|
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
||||||
|
class ShapeCallback
|
||||||
|
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
||||||
|
</div>
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
classDiagram-v2
|
||||||
|
class ShapeLink2
|
||||||
|
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
||||||
|
class ShapeCallback2
|
||||||
|
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mermaid">
|
||||||
|
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 "http://localhost:9000/webpackUsage.html"
|
||||||
|
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 style="display: flex">
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
graph TB
|
||||||
|
FunctionArg-->URL
|
||||||
|
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
|
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
||||||
|
</div>
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
flowchart TB
|
||||||
|
FunctionArg-->URL
|
||||||
|
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
|
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
class ShapeLink
|
||||||
|
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
||||||
|
class ShapeCallback
|
||||||
|
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="FirstLine" class="mermaid">
|
||||||
|
classDiagram-v2
|
||||||
|
class ShapeLink2
|
||||||
|
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
||||||
|
class ShapeCallback2
|
||||||
|
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
function clickByFlowArg(argument) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'created-by-click-2';
|
||||||
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
|
div.innerText = 'Clicked By Flow: ' + argument;
|
||||||
|
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
}
|
||||||
|
function clickByGantt(arg1, arg2, arg3) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'created-by-gant-click';
|
||||||
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
|
div.innerText = 'Clicked By Gant';
|
||||||
|
if (arg1) div.innerText += ' ' + arg1;
|
||||||
|
if (arg2) div.innerText += ' ' + arg2;
|
||||||
|
if (arg3) div.innerText += ' ' + arg3;
|
||||||
|
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
}
|
||||||
|
function clickByClass(arg) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'created-by-class-click';
|
||||||
|
div.style = 'padding: 20px; background: purple; color: white;';
|
||||||
|
div.innerText = 'Clicked By Class' + (arg ? arg : '');
|
||||||
|
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
}
|
||||||
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'sandbox', logLevel: 1 });
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -64,23 +64,23 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click'
|
div.className = 'created-by-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Flow'
|
div.innerText = 'Clicked By Flow';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByGantt(arg1, arg2, arg3) {
|
function clickByGantt(arg1, arg2, arg3) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-gant-click'
|
div.className = 'created-by-gant-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Gant'
|
div.innerText = 'Clicked By Gant';
|
||||||
if (arg1) div.innerText += ' ' + arg1;
|
if (arg1) div.innerText += ' ' + arg1;
|
||||||
if (arg2) div.innerText += ' ' + arg2;
|
if (arg2) div.innerText += ' ' + arg2;
|
||||||
if (arg3) div.innerText += ' ' + arg3;
|
if (arg3) div.innerText += ' ' + arg3;
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'strict', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'strict', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
|
39
cypress/platform/css1.html
Normal file
39
cypress/platform/css1.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<!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=">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="mermaid2">
|
||||||
|
%%{init: { 'themeCSS': '} * { background: lightblue }' } }%%
|
||||||
|
flowchart TD
|
||||||
|
a --> b
|
||||||
|
</div>
|
||||||
|
<div class="mermaid">
|
||||||
|
%%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%%
|
||||||
|
flowchart LR
|
||||||
|
subgraph A
|
||||||
|
a --> b
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
i -->f
|
||||||
|
end
|
||||||
|
A --> B
|
||||||
|
</div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
function showFullFirstSquad(elemName) {
|
||||||
|
console.log('show ' + elemName);
|
||||||
|
}
|
||||||
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 0 });
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -155,23 +155,25 @@ _one --> b
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'forest',
|
// theme: 'forest',
|
||||||
// themeVariables:{primaryColor: '#ff0000'},
|
// themeVariables:{primaryColor: '#ff0000'},
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": true },
|
flowchart: { curve: 'cardinal', htmlLabels: true },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -107,23 +107,25 @@ Note over Bob,Alice: Looks back
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'forest',
|
// theme: 'forest',
|
||||||
// themeVariables:{primaryColor: '#ff0000'},
|
// themeVariables:{primaryColor: '#ff0000'},
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": false },
|
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,52 +1,52 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<!-- <meta charset="iso-8859-15"/> -->
|
<!-- <meta charset="iso-8859-15"/> -->
|
||||||
<script src="/e2e.js"></script>
|
<script src="/e2e.js"></script>
|
||||||
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
|
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
/* font-family: 'Mansalva', cursive;*/
|
/* font-family: 'Mansalva', cursive;*/
|
||||||
/* font-family: 'Mansalva', cursive; */
|
/* font-family: 'Mansalva', cursive; */
|
||||||
/* font-family: 'arial'; */
|
/* font-family: 'arial'; */
|
||||||
/* font-family: "trebuchet ms", verdana, arial; */
|
/* font-family: "trebuchet ms", verdana, arial; */
|
||||||
}
|
}
|
||||||
/* div {
|
/* div {
|
||||||
font-family: 'arial';
|
font-family: 'arial';
|
||||||
} */
|
} */
|
||||||
/* .mermaid-main-font {
|
/* .mermaid-main-font {
|
||||||
font-family: "trebuchet ms", verdana, arial;
|
font-family: "trebuchet ms", verdana, arial;
|
||||||
font-family: var(--mermaid-font-family);
|
font-family: var(--mermaid-font-family);
|
||||||
} */
|
} */
|
||||||
/* :root {
|
/* :root {
|
||||||
--mermaid-font-family: '"trebuchet ms", verdana, arial';
|
--mermaid-font-family: '"trebuchet ms", verdana, arial';
|
||||||
--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive;
|
--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive;
|
||||||
--mermaid-font-family: '"Lucida Console", Monaco, monospace';
|
--mermaid-font-family: '"Lucida Console", Monaco, monospace';
|
||||||
} */
|
} */
|
||||||
svg {
|
svg {
|
||||||
border: 2px solid darkred;
|
border: 2px solid darkred;
|
||||||
}
|
}
|
||||||
.exClass2 > rect, .exClass {
|
.exClass2 > rect, .exClass {
|
||||||
fill: greenyellow !important;
|
fill: greenyellow !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// Notice startOnLoad=false
|
// Notice startOnLoad=false
|
||||||
// This prevents default handling in mermaid from render before the e2e logic is applied
|
// This prevents default handling in mermaid from render before the e2e logic is applied
|
||||||
// mermaid.initialize({
|
// mermaid.initialize({
|
||||||
// startOnLoad: false,
|
// startOnLoad: false,
|
||||||
// useMaxWidth: true,
|
// useMaxWidth: true,
|
||||||
// // "themeCSS": ":root { --mermaid-font-family: \"trebuchet ms\", verdana, arial;}",
|
// // "themeCSS": ":root { --mermaid-font-family: \"trebuchet ms\", verdana, arial;}",
|
||||||
// // fontFamily: '\"trebuchet ms\", verdana, arial;'
|
// // fontFamily: '\"trebuchet ms\", verdana, arial;'
|
||||||
// // fontFamily: '"Comic Sans MS", "Comic Sans", cursive'
|
// // fontFamily: '"Comic Sans MS", "Comic Sans", cursive'
|
||||||
// // fontFamily: '"Mansalva", cursive',
|
// // fontFamily: '"Mansalva", cursive',
|
||||||
// // fontFamily: '"Noto Sans SC", sans-serif'
|
// // fontFamily: '"Noto Sans SC", sans-serif'
|
||||||
// fontFamily: '"Noto Sans SC", sans-serif'
|
// fontFamily: '"Noto Sans SC", sans-serif'
|
||||||
// });
|
// });
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,46 +1,46 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
<style>body {
|
<style>body {
|
||||||
font-family: 'trebuchet ms', verdana, arial;
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
}</style>
|
}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
subgraph One
|
subgraph One
|
||||||
a1-->a2-->a3
|
a1-->a2-->a3
|
||||||
end
|
end
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
a_a --> b_b:::apa --> c_c:::apa
|
a_a --> b_b:::apa --> c_c:::apa
|
||||||
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
||||||
class a_a apa;
|
class a_a apa;
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
|
a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
|
||||||
a_a --> c --> d_d --> c_c
|
a_a --> c --> d_d --> c_c
|
||||||
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
||||||
class a_a apa;
|
class a_a apa;
|
||||||
click a_a "http://www.aftonbladet.se" "apa"
|
click a_a "http://www.aftonbladet.se" "apa"
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
logLevel: 3,
|
logLevel: 3,
|
||||||
flowchart: { curve: 'linear' },
|
flowchart: { curve: 'linear' },
|
||||||
gantt: { axisFormat: '%m/%d/%Y' },
|
gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50 },
|
sequence: { actorMargin: 50 },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
67
cypress/platform/git-graph.html
Normal file
67
cypress/platform/git-graph.html
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
|
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);
|
||||||
|
/*background:#333;*/
|
||||||
|
font-family: 'Arial';
|
||||||
|
}
|
||||||
|
h1 { color: white;}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.customCss > rect, .customCss{
|
||||||
|
fill:#FF0000 !important;
|
||||||
|
stroke:#FFFF00 !important;
|
||||||
|
stroke-width:4px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>info below</h1>
|
||||||
|
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||||
|
|
||||||
|
gitGraph
|
||||||
|
class BankAccount{
|
||||||
|
+String owner
|
||||||
|
+BigDecimal balance
|
||||||
|
+deposit(amount) bool
|
||||||
|
+withdrawl(amount) int
|
||||||
|
}
|
||||||
|
cssClass "BankAccount" customCss
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'default',
|
||||||
|
// arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
flowchart: { curve: 'linear', htmlLabels: true },
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"arial", sans-serif',
|
||||||
|
// themeVariables: {
|
||||||
|
// fontFamily: '"arial", sans-serif',
|
||||||
|
// },
|
||||||
|
curve: 'linear',
|
||||||
|
securityLevel: 'loose',
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
143
cypress/platform/gitgraph.html
Normal file
143
cypress/platform/gitgraph.html
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
|
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); */
|
||||||
|
background:#111;
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
}
|
||||||
|
/* h1 { color: white;} */
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.customCss > rect, .customCss{
|
||||||
|
fill:#FF0000 !important;
|
||||||
|
stroke:#FFFF00 !important;
|
||||||
|
stroke-width:4px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>info below</h1>
|
||||||
|
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||||
|
%%{init: { "logLevel": "debug", "theme": "default" , "gitGraph" : {"showBranches":"false"},"themeVariables": {
|
||||||
|
"gitBranchLabel0": "#ff0000",
|
||||||
|
"gitBranchLabel1": "#00ff00",
|
||||||
|
"gitBranchLabel2": "#0000ff",
|
||||||
|
"git0": "#550055"
|
||||||
|
} } }%%
|
||||||
|
gitGraph
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
commit tag:"v1.0.0"
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit type: HIGHLIGHT
|
||||||
|
commit
|
||||||
|
merge develop
|
||||||
|
commit
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||||
|
gitGraph
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"ash" tag:"abc" type:HIGHLIGHT
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout develop
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||||
|
gitGraph:
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
branch newbranch
|
||||||
|
commit
|
||||||
|
merge main
|
||||||
|
</div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
//theme: 'dark',
|
||||||
|
themeVariables: {
|
||||||
|
commitLabelColor: '#9400D3',
|
||||||
|
commitLabelBackground: '#FFFFFF',
|
||||||
|
// darkMode: true,
|
||||||
|
// background: '#222',
|
||||||
|
// // textColor: 'white',
|
||||||
|
// // primaryTextColor: '#f4f4f4',
|
||||||
|
|
||||||
|
// // // nodeBkg: '#ff0000',
|
||||||
|
// // // mainBkg: '#0000ff',
|
||||||
|
// // // tertiaryColor: '#ffffcc',
|
||||||
|
},
|
||||||
|
// theme: 'forest',
|
||||||
|
// theme: 'neutral',
|
||||||
|
// theme: 'dark',
|
||||||
|
// arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 1,
|
||||||
|
flowchart: { curve: 'linear', htmlLabels: true },
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"arial", sans-serif',
|
||||||
|
// themeVariables: {
|
||||||
|
// fontFamily: '"arial", sans-serif',
|
||||||
|
// },
|
||||||
|
curve: 'linear',
|
||||||
|
securityLevel: 'loose',
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
139
cypress/platform/gitgraph2.html
Normal file
139
cypress/platform/gitgraph2.html
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
|
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); */
|
||||||
|
/* background:#111; */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
}
|
||||||
|
/* h1 { color: white;} */
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.customCss > rect, .customCss{
|
||||||
|
fill:#FF0000 !important;
|
||||||
|
stroke:#FFFF00 !important;
|
||||||
|
stroke-width:4px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>info below</h1>
|
||||||
|
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||||
|
gitGraph:
|
||||||
|
commit "Ashish"
|
||||||
|
branch newbranch
|
||||||
|
checkout newbranch
|
||||||
|
commit id:"1111"
|
||||||
|
commit tag:"test"
|
||||||
|
checkout main
|
||||||
|
commit type: HIGHLIGHT
|
||||||
|
commit
|
||||||
|
merge newbranch
|
||||||
|
commit
|
||||||
|
branch b2
|
||||||
|
commit
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||||
|
%%{init: { "gitGraph": { "showBranches": true, "mainBranchName": "APA" }}}%%
|
||||||
|
gitGraph
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout APA
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout APA
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout APA
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge APA
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||||
|
gitGraph:
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
branch newbranch
|
||||||
|
commit
|
||||||
|
merge main
|
||||||
|
</div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'default',
|
||||||
|
themeVariables: {
|
||||||
|
// primaryColor: '#9400D3',
|
||||||
|
// darkMode: false,
|
||||||
|
// background: '#222',
|
||||||
|
// textColor: 'white',
|
||||||
|
// primaryTextColor: '#f4f4f4',
|
||||||
|
// nodeBkg: '#ff0000',
|
||||||
|
// mainBkg: '#0000ff',
|
||||||
|
// tertiaryColor: '#ffffcc',
|
||||||
|
},
|
||||||
|
// theme: 'forest',
|
||||||
|
// theme: 'neutral',
|
||||||
|
// theme: 'dark',
|
||||||
|
// arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 1,
|
||||||
|
flowchart: { curve: 'linear', htmlLabels: true },
|
||||||
|
// gitGraph: { showCommitLabel: false },
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"arial", sans-serif',
|
||||||
|
// themeVariables: {
|
||||||
|
// fontFamily: '"arial", sans-serif',
|
||||||
|
// },
|
||||||
|
curve: 'linear',
|
||||||
|
securityLevel: 'loose',
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -29,7 +29,7 @@
|
|||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'linear', "htmlLabels": false },
|
flowchart: { curve: 'linear', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50 },
|
sequence: { actorMargin: 50 },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
@@ -1,26 +1,26 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>info below</h1>
|
<h1>info below</h1>
|
||||||
<div class="mermaid">info</div>
|
<div class="mermaid">info</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
logLevel: 3,
|
logLevel: 3,
|
||||||
flowchart: { curve: 'linear' },
|
flowchart: { curve: 'linear' },
|
||||||
gantt: { axisFormat: '%m/%d/%Y' },
|
gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50 },
|
sequence: { actorMargin: 50 },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -90,31 +90,31 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-click'
|
div.className = 'created-by-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Flow'
|
div.innerText = 'Clicked By Flow';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByGantt(arg1, arg2, arg3) {
|
function clickByGantt(arg1, arg2, arg3) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-gant-click'
|
div.className = 'created-by-gant-click';
|
||||||
div.style = 'padding: 20px; background: green; color: white;'
|
div.style = 'padding: 20px; background: green; color: white;';
|
||||||
div.innerText = 'Clicked By Gant'
|
div.innerText = 'Clicked By Gant';
|
||||||
if (arg1) div.innerText += ' ' + arg1;
|
if (arg1) div.innerText += ' ' + arg1;
|
||||||
if (arg2) div.innerText += ' ' + arg2;
|
if (arg2) div.innerText += ' ' + arg2;
|
||||||
if (arg3) div.innerText += ' ' + arg3;
|
if (arg3) div.innerText += ' ' + arg3;
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
function clickByClass() {
|
function clickByClass() {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.className = 'created-by-class-click'
|
div.className = 'created-by-class-click';
|
||||||
div.style = 'padding: 20px; background: purple; color: white;'
|
div.style = 'padding: 20px; background: purple; color: white;';
|
||||||
div.innerText = 'Clicked By Class'
|
div.innerText = 'Clicked By Class';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div)
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
font-family: 'Arial';
|
font-family: 'Arial';
|
||||||
/* font-size: 18px !important; */
|
/* font-size: 18px !important; */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
h1 { color: grey;}
|
h1 { color: grey;}
|
||||||
.mermaid2,.mermaid3 {
|
.mermaid2,.mermaid3 {
|
||||||
@@ -25,45 +26,269 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>info below</div>
|
<div class="mermaid2" style="width: 50%;">
|
||||||
<div class="flex flex-wrap">
|
pie title Pets adopted by volunteers
|
||||||
|
"Dogs" : 386
|
||||||
|
"Cats" : 85
|
||||||
|
"Rats" : 15
|
||||||
|
</div>
|
||||||
|
<div class="mermaid2" style="width: 100%;">
|
||||||
|
gantt
|
||||||
|
title Adding GANTT diagram functionality to mermaid
|
||||||
|
excludes :excludes the named dates/days from being included in a charted task..
|
||||||
|
section Screening
|
||||||
|
Lexplore :active, des1, 2023-01-06,2023-01-08
|
||||||
|
H4 :active, des2, 2024-01-09, 3d
|
||||||
|
Future task : des3, after des2, 5d
|
||||||
|
Future task2 : des4, after des3, 5d
|
||||||
|
|
||||||
<div class="mermaid" style="width: 100%; height: 20%;">
|
</div>
|
||||||
stateDiagram-v2
|
<div class="mermaid2" style="width: 100%;">
|
||||||
|
info
|
||||||
|
</div>
|
||||||
|
<div class="mermaid2" style="width: 100%;">
|
||||||
|
gitGraph:
|
||||||
|
options
|
||||||
|
{
|
||||||
|
"nodeSpacing": 150,
|
||||||
|
"nodeRadius": 10
|
||||||
|
}
|
||||||
|
end
|
||||||
|
commit
|
||||||
|
branch newbranch
|
||||||
|
checkout newbranch
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
checkout master
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
merge newbranch
|
||||||
|
</div>
|
||||||
|
<div class="mermaid" style="width: 50%;">
|
||||||
|
sequenceDiagram
|
||||||
|
title: with colon:
|
||||||
|
participant a as Alice
|
||||||
|
participant j as John
|
||||||
|
note right of a: Hello world!
|
||||||
|
properties a: {"class": "internal-service-actor", "type": "@clock"}
|
||||||
|
properties j: {"class": "external-service-actor", "type": "@computer"}
|
||||||
|
links a: {"Repo": "https://www.contoso.com/repo", "Swagger": "https://www.contoso.com/swagger"}
|
||||||
|
links j: {"Repo": "https://www.contoso.com/repo"}
|
||||||
|
links a: {"Dashboard": "https://www.contoso.com/dashboard", "On-Call": "https://www.contoso.com/oncall"}
|
||||||
|
link a: Contacts @ https://contacts.contoso.com/?contact=alice@contoso.com
|
||||||
|
a->>j: Hello John, how are you?
|
||||||
|
j-->>a: Great! </div>
|
||||||
|
<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>
|
||||||
|
<div class="mermaid" style="width: 50%;">
|
||||||
|
flowchart LR
|
||||||
|
Function-->URL-->A-->B-->C
|
||||||
|
click Function clickByFlow "Add a div"
|
||||||
|
click URL "https://mermaid-js.github.io/mermaid/#/" "Visit <strong>mermaid docs</strong>" _blank
|
||||||
|
</div>
|
||||||
|
<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%;">
|
||||||
|
stateDiagram
|
||||||
[*] --> S1
|
[*] --> S1
|
||||||
state "Some long name" as S1
|
state "Some long name" as S1
|
||||||
|
</div>
|
||||||
</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()
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'dark',
|
// theme: 'dark',
|
||||||
theme: 'forest',
|
// theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 2,
|
flowchart: {
|
||||||
flowchart: { nodeSpacing: 10, curve: 'cardinal', htmlLabels: false },
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
},
|
||||||
|
class: {
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: {
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
actorFontFamily: 'courier',
|
||||||
|
actorMargin: 50,
|
||||||
|
showSequenceNumbers: false,
|
||||||
|
// forceMenus: true,
|
||||||
|
},
|
||||||
|
// sequenceDiagram: { actorMargin: 300, forceMenus: false }, // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
state:{
|
state: {
|
||||||
nodeSpacing: 50,
|
nodeSpacing: 50,
|
||||||
rankSpacing: 50,
|
rankSpacing: 50,
|
||||||
defaultRenderer: 'dagre-wrapper',
|
defaultRenderer: 'dagre-d3',
|
||||||
},
|
},
|
||||||
logLevel:0,
|
logLevel: 0,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict',
|
// securityLevel: 'sandbox',
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,35 +58,39 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: false,
|
htmlLabels: false,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'strict',
|
securityLevel: 'strict',
|
||||||
startOnLoad: false
|
startOnLoad: false,
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
|
||||||
var diagram = "%%{init: {\"flowchart\": {\"htmlLabels\": \"false\"}} }%%\n";
|
var diagram = '%%{init: {"flowchart": {"htmlLabels": "false"}} }%%\n';
|
||||||
diagram += "flowchart\n";
|
diagram += 'flowchart\n';
|
||||||
diagram += "A[\"<ifra";
|
diagram += 'A["<ifra';
|
||||||
diagram += "me srcdoc='<scrip";
|
diagram += "me srcdoc='<scrip";
|
||||||
diagram += "t src=http://localhost:9000/exploit.js>";
|
diagram += 't src=http://localhost:9000/exploit.js>';
|
||||||
diagram += "</scr"
|
diagram += '</scr';
|
||||||
diagram += "ipt>'></iframe>\"]";
|
diagram += 'ipt>\'></iframe>"]';
|
||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -185,8 +185,8 @@ style N stroke:#0000ff,fill:#ccccff,color:#0000ff
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'neutral',
|
theme: 'neutral',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -195,7 +195,7 @@ style N stroke:#0000ff,fill:#ccccff,color:#0000ff
|
|||||||
flowchart: { nodeSpacing: 10, curve: 'cardinal', htmlLabels: true },
|
flowchart: { nodeSpacing: 10, curve: 'cardinal', htmlLabels: true },
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -204,7 +204,9 @@ style N stroke:#0000ff,fill:#ccccff,color:#0000ff
|
|||||||
securityLevel: 'loose',
|
securityLevel: 'loose',
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -3,10 +3,9 @@
|
|||||||
<script src="http://localhost:9000/mermaid.js"></script>
|
<script src="http://localhost:9000/mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'base',
|
theme: 'base',
|
||||||
themeVariables: {
|
themeVariables: {},
|
||||||
},
|
startOnLoad: true,
|
||||||
startOnLoad: true,
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -11,21 +11,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>mermaid.init({ startOnLoad: false });
|
||||||
|
|
||||||
mermaid.init({ startOnLoad: false });
|
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
||||||
mermaid.mermaidAPI.initialize();
|
|
||||||
|
|
||||||
try{
|
try {
|
||||||
mermaid.mermaidAPI.render("graphDiv",
|
console.log('rendering');
|
||||||
`>`);
|
mermaid.mermaidAPI.render('graphDiv', `>`);
|
||||||
} catch(e){}
|
} catch (e) {}
|
||||||
|
|
||||||
mermaid.mermaidAPI.render("graphDiv",
|
mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => {
|
||||||
`graph LR\n a --> b`, html => {
|
document.getElementById('graph').innerHTML = html;
|
||||||
document.getElementById('graph').innerHTML=html;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@@ -11,21 +11,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>mermaid.init({ startOnLoad: false });
|
||||||
|
|
||||||
mermaid.init({ startOnLoad: false });
|
|
||||||
mermaid.mermaidAPI.initialize();
|
mermaid.mermaidAPI.initialize();
|
||||||
|
|
||||||
rerender('XMas');
|
rerender('XMas');
|
||||||
|
|
||||||
function rerender(text) {
|
function rerender(text) {
|
||||||
var graphText = `graph TD
|
var graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
var graph = mermaid.mermaidAPI.render('id', graphText);
|
var graph = mermaid.mermaidAPI.render('id', graphText);
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph)
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
||||||
document.getElementById('graph').innerHTML=graph;
|
document.getElementById('graph').innerHTML = graph;
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
||||||
|
|
||||||
|
@@ -264,26 +264,72 @@ requirementDiagram
|
|||||||
test_req - contains -> test_req3
|
test_req - contains -> test_req3
|
||||||
test_req <- copies - test_entity2
|
test_req <- copies - test_entity2
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||||
|
gitGraph:
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'base',
|
theme: 'base',
|
||||||
// themeVariables:
|
// themeVariables:
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": false },
|
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -258,19 +258,71 @@ requirementDiagram
|
|||||||
test_req - contains -> test_req3
|
test_req - contains -> test_req3
|
||||||
test_req <- copies - test_entity2
|
test_req <- copies - test_entity2
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mermaid" class="width height">
|
||||||
<script src="./mermaid.js"></script>
|
gitGraph
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
</div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'base',
|
theme: 'base',
|
||||||
themeVariables: { primaryColor: '#9400D3', darkMode: true, background: '#222', textColor:'white', primaryTextColor: '#f4f4f4', nodeBkg: '#ff0000', mainBkg:'#0000ff', tertiaryColor:'#ffffcc' },
|
themeVariables: {
|
||||||
|
primaryColor: '#9400D3',
|
||||||
|
darkMode: true,
|
||||||
|
background: '#222',
|
||||||
|
textColor: 'white',
|
||||||
|
primaryTextColor: '#f4f4f4',
|
||||||
|
nodeBkg: '#ff0000',
|
||||||
|
mainBkg: '#0000ff',
|
||||||
|
tertiaryColor: '#ffffcc',
|
||||||
|
},
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": false },
|
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
@@ -278,7 +330,9 @@ requirementDiagram
|
|||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
// securityLevel: 'strict'
|
// securityLevel: 'strict'
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -256,25 +256,71 @@ requirementDiagram
|
|||||||
test_req - contains -> test_req3
|
test_req - contains -> test_req3
|
||||||
test_req <- copies - test_entity2
|
test_req <- copies - test_entity2
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mermaid" class="width height">
|
||||||
|
gitGraph
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'dark',
|
theme: 'dark',
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": true },
|
flowchart: { curve: 'cardinal', htmlLabels: true },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -251,25 +251,71 @@ requirementDiagram
|
|||||||
test_req - contains -> test_req3
|
test_req - contains -> test_req3
|
||||||
test_req <- copies - test_entity2
|
test_req <- copies - test_entity2
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||||
|
gitGraph
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
</div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'dark',
|
// theme: 'dark',
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": false },
|
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -255,25 +255,71 @@ requirementDiagram
|
|||||||
test_req - contains -> test_req3
|
test_req - contains -> test_req3
|
||||||
test_req <- copies - test_entity2
|
test_req <- copies - test_entity2
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mermaid" class="width height">
|
||||||
|
gitGraph:
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": false },
|
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -254,25 +254,73 @@ requirementDiagram
|
|||||||
test_req - contains -> test_req3
|
test_req - contains -> test_req3
|
||||||
test_req <- copies - test_entity2
|
test_req <- copies - test_entity2
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mermaid" class="width height">
|
||||||
|
gitGraph:
|
||||||
|
commit
|
||||||
|
branch hotfix
|
||||||
|
checkout hotfix
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
checkout develop
|
||||||
|
commit id:"An id" tag:"A tag"
|
||||||
|
branch featureB
|
||||||
|
checkout featureB
|
||||||
|
commit type:HIGHLIGHT
|
||||||
|
checkout main
|
||||||
|
checkout hotfix
|
||||||
|
commit type:NORMAL
|
||||||
|
checkout develop
|
||||||
|
commit type:REVERSE
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
merge hotfix
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
branch featureA
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge hotfix
|
||||||
|
checkout featureA
|
||||||
|
commit
|
||||||
|
checkout featureB
|
||||||
|
commit
|
||||||
|
checkout develop
|
||||||
|
merge featureA
|
||||||
|
branch release
|
||||||
|
checkout release
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout release
|
||||||
|
merge main
|
||||||
|
checkout develop
|
||||||
|
merge release
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'neutral',
|
theme: 'neutral',
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', "htmlLabels": false },
|
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
fontFamily: '"arial", sans-serif',
|
fontFamily: '"arial", sans-serif',
|
||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict'
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -37,9 +37,9 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -120,8 +120,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'dark',
|
// theme: 'dark',
|
||||||
// theme: 'dark',
|
// theme: 'dark',
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
// flowchart: { useMaxWidth: true },
|
// flowchart: { useMaxWidth: true },
|
||||||
graph: { curve: 'cardinal', "htmlLabels": false },
|
graph: { curve: 'cardinal', htmlLabels: false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
@@ -137,7 +137,9 @@
|
|||||||
curve: 'cardinal',
|
curve: 'cardinal',
|
||||||
securityLevel: 'strict',
|
securityLevel: 'strict',
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,41 +1,41 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>User Journey</h1>
|
<h1>User Journey</h1>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
journey
|
journey
|
||||||
title Go shopping
|
title Go shopping
|
||||||
|
|
||||||
section Get to the shops
|
section Get to the shops
|
||||||
Get car keys:5: Dad
|
Get car keys:5: Dad
|
||||||
Get into car:5: Dad, Mum, Child 1, Child 2
|
Get into car:5: Dad, Mum, Child 1, Child 2
|
||||||
Really drive to supermarket:3: Dad
|
Really drive to supermarket:3: Dad
|
||||||
|
|
||||||
section Do shopping
|
section Do shopping
|
||||||
Do actual shop:3: Mum
|
Do actual shop:3: Mum
|
||||||
Get in the way:2: Dad, Child 1, Child 2
|
Get in the way:2: Dad, Child 1, Child 2
|
||||||
Pay: 2: Dad
|
Pay: 2: Dad
|
||||||
|
|
||||||
section Go home
|
section Go home
|
||||||
Lose keys:3: Dad
|
Lose keys:3: Dad
|
||||||
Get cross:1: Dad, Child 1
|
Get cross:1: Dad, Child 1
|
||||||
Find keys:4: Mum
|
Find keys:4: Mum
|
||||||
Get into car:4: Dad, Mum, Child 1, Child 2
|
Get into car:4: Dad, Mum, Child 1, Child 2
|
||||||
Drive home:3: Dad
|
Drive home:3: Dad
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
logLevel: 3,
|
logLevel: 3,
|
||||||
journey: { taskMargin: 30 },
|
journey: { taskMargin: 30 },
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -29,9 +29,9 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,18 +1,18 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
/* .mermaid {
|
/* .mermaid {
|
||||||
font-family: "trebuchet ms", verdana, arial;;
|
font-family: "trebuchet ms", verdana, arial;;
|
||||||
} */
|
} */
|
||||||
/* .mermaid {
|
/* .mermaid {
|
||||||
font-family: 'arial';
|
font-family: 'arial';
|
||||||
} */
|
} */
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="graph-to-be"></div>
|
<div id="graph-to-be"></div>
|
||||||
<script src="./bundle-test.js" charset="utf-8"></script>
|
<script src="./bundle-test.js" charset="utf-8"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@@ -23,11 +23,11 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
function xssAttack(){
|
function xssAttack() {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.id = 'the-malware'
|
div.id = 'the-malware';
|
||||||
div.className = 'malware'
|
div.className = 'malware';
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
// const el = document.querySelector('.mermaid');
|
// const el = document.querySelector('.mermaid');
|
||||||
// el.parentNode.removeChild(el);
|
// el.parentNode.removeChild(el);
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,35 +72,36 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var diagram = 'classDiagram\n';
|
||||||
var diagram = "classDiagram\n"
|
diagram += 'class Square~<img/src';
|
||||||
diagram += "class Square~<img/src";
|
|
||||||
diagram += "='1'/onerror=xssAttack()>~{\n";
|
diagram += "='1'/onerror=xssAttack()>~{\n";
|
||||||
diagram += "id A\n";
|
diagram += 'id A\n';
|
||||||
diagram += "}";
|
diagram += '}';
|
||||||
|
|
||||||
// var diagram = "stateDiagram-v2\n";
|
// var diagram = "stateDiagram-v2\n";
|
||||||
// diagram += "<img/src='1'/onerror"
|
// diagram += "<img/src='1'/onerror"
|
||||||
// diagram += "=xssAttack()> --> B";
|
// diagram += "=xssAttack()> --> B";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,33 +72,34 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var diagram = 'stateDiagram-v2\n';
|
||||||
var diagram = "stateDiagram-v2\n"
|
diagram += 's2 : This is a state description<img/src';
|
||||||
diagram += "s2 : This is a state description<img/src";
|
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
// var diagram = "stateDiagram-v2\n";
|
// var diagram = "stateDiagram-v2\n";
|
||||||
// diagram += "<img/src='1'/onerror"
|
// diagram += "<img/src='1'/onerror"
|
||||||
// diagram += "=xssAttack()> --> B";
|
// diagram += "=xssAttack()> --> B";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,33 +72,34 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var diagram = 'stateDiagram-v2\n';
|
||||||
var diagram = "stateDiagram-v2\n"
|
diagram += 's2 : A<img/src';
|
||||||
diagram += "s2 : A<img/src";
|
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
// var diagram = "stateDiagram-v2\n";
|
// var diagram = "stateDiagram-v2\n";
|
||||||
// diagram += "<img/src='1'/onerror"
|
// diagram += "<img/src='1'/onerror"
|
||||||
// diagram += "=xssAttack()> --> B";
|
// diagram += "=xssAttack()> --> B";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,33 +72,34 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var diagram = 'stateDiagram-v2\n';
|
||||||
var diagram = "stateDiagram-v2\n"
|
diagram += 'if_state --> False: if n < 0<img/src';
|
||||||
diagram += "if_state --> False: if n < 0<img/src";
|
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
// var diagram = "stateDiagram-v2\n";
|
// var diagram = "stateDiagram-v2\n";
|
||||||
// diagram += "<img/src='1'/onerror"
|
// diagram += "<img/src='1'/onerror"
|
||||||
// diagram += "=xssAttack()> --> B";
|
// diagram += "=xssAttack()> --> B";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,34 +72,36 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = "classDiagram\n"
|
var diagram = 'classDiagram\n';
|
||||||
diagram += "classA <-- classB : <ifr";
|
diagram += 'classA <-- classB : <ifr';
|
||||||
diagram += "ame/srcdoc='<scr";
|
diagram += "ame/srcdoc='<scr";
|
||||||
diagram += "ipt>parent.xssAttack(`XSS`)</";
|
diagram += 'ipt>parent.xssAttack(`XSS`)</';
|
||||||
diagram += "script>'>";
|
diagram += "script>'>";
|
||||||
|
|
||||||
// var diagram = "stateDiagram-v2\n";
|
// var diagram = "stateDiagram-v2\n";
|
||||||
// diagram += "<img/src='1'/onerror"
|
// diagram += "<img/src='1'/onerror"
|
||||||
// diagram += "=xssAttack()> --> B";
|
// diagram += "=xssAttack()> --> B";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
107
cypress/platform/xss15.html
Normal file
107
cypress/platform/xss15.html
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<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); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 { color: grey;}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div id="diagram" class="mermaid"></div>
|
||||||
|
<div id="res" class=""></div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
state: {
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
htmlLabels: true,
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"times", sans-serif',
|
||||||
|
// fontFamily: 'courier',
|
||||||
|
fontSize: 18,
|
||||||
|
curve: 'basis',
|
||||||
|
securityLevel: 'strict',
|
||||||
|
startOnLoad: false,
|
||||||
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
function xssAttack() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
throw new Error('XSS Succeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
var diagram = `sequenceDiagram
|
||||||
|
participant John
|
||||||
|
links John: {"XSS": "javas`;
|
||||||
|
diagram += `cript:alert('AudioParam')"}`;
|
||||||
|
|
||||||
|
// var diagram = "stateDiagram-v2\n";
|
||||||
|
// diagram += "<img/src='1'/onerror"
|
||||||
|
// diagram += "=xssAttack()> --> B";
|
||||||
|
console.log(diagram);
|
||||||
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
|
console.log(res);
|
||||||
|
document.querySelector('#res').innerHTML = res;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
106
cypress/platform/xss16.html
Normal file
106
cypress/platform/xss16.html
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<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); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 { color: grey;}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div id="diagram" class="mermaid"></div>
|
||||||
|
<div id="res" class=""></div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
state: {
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
htmlLabels: true,
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"times", sans-serif',
|
||||||
|
// fontFamily: 'courier',
|
||||||
|
fontSize: 18,
|
||||||
|
curve: 'basis',
|
||||||
|
securityLevel: 'loose',
|
||||||
|
startOnLoad: false,
|
||||||
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
function xssAttack() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
throw new Error('XSS Succeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
var diagram = `sequenceDiagram
|
||||||
|
participant Alice
|
||||||
|
links Alice: { "Click me!" : "javasjavascript:cript:alert('goose')" }`;
|
||||||
|
|
||||||
|
// // var diagram = "stateDiagram-v2\n";
|
||||||
|
// // diagram += "<img/src='1'/onerror"
|
||||||
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
|
// console.log(diagram);
|
||||||
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
|
console.log(res);
|
||||||
|
document.querySelector('#res').innerHTML = res;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
106
cypress/platform/xss17.html
Normal file
106
cypress/platform/xss17.html
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<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); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 { color: grey;}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div id="diagram" class="mermaid"></div>
|
||||||
|
<div id="res" class=""></div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
state: {
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
htmlLabels: true,
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"times", sans-serif',
|
||||||
|
// fontFamily: 'courier',
|
||||||
|
fontSize: 18,
|
||||||
|
curve: 'basis',
|
||||||
|
securityLevel: 'loose',
|
||||||
|
startOnLoad: false,
|
||||||
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
function xssAttack() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
throw new Error('XSS Succeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
var diagram = `sequenceDiagram
|
||||||
|
participant Alice
|
||||||
|
link Alice: Click Me!@javasjavascript:cript:alert("goose")`;
|
||||||
|
|
||||||
|
// // var diagram = "stateDiagram-v2\n";
|
||||||
|
// // diagram += "<img/src='1'/onerror"
|
||||||
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
|
// console.log(diagram);
|
||||||
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
|
console.log(res);
|
||||||
|
document.querySelector('#res').innerHTML = res;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
105
cypress/platform/xss18.html
Normal file
105
cypress/platform/xss18.html
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
<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); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 { color: grey;}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div id="diagram" class="mermaid"></div>
|
||||||
|
<div id="res" class=""></div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
state: {
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
htmlLabels: true,
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"times", sans-serif',
|
||||||
|
// fontFamily: 'courier',
|
||||||
|
fontSize: 18,
|
||||||
|
curve: 'basis',
|
||||||
|
// securityLevel: 'loose',
|
||||||
|
startOnLoad: false,
|
||||||
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
function xssAttack() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
throw new Error('XSS Succeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
var diagram = `classDiagram
|
||||||
|
Class "<img/src='x'/onerror=xssAttack(1)>" <--> "<img/src='x'/onerror=xssAttack(2)>" C2: Cool label`;
|
||||||
|
|
||||||
|
// // var diagram = "stateDiagram-v2\n";
|
||||||
|
// // diagram += "<img/src='1'/onerror"
|
||||||
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
|
// console.log(diagram);
|
||||||
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
|
console.log(res);
|
||||||
|
document.querySelector('#res').innerHTML = res;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
107
cypress/platform/xss19.html
Normal file
107
cypress/platform/xss19.html
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<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); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 { color: grey;}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div id="diagram" class="mermaid"></div>
|
||||||
|
<div id="res" class=""></div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
state: {
|
||||||
|
defaultRenderer: 'dagre-d3',
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
htmlLabels: true,
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"times", sans-serif',
|
||||||
|
// fontFamily: 'courier',
|
||||||
|
fontSize: 18,
|
||||||
|
curve: 'basis',
|
||||||
|
securityLevel: 'sandbox',
|
||||||
|
startOnLoad: false,
|
||||||
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
function xssAttack() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
|
throw new Error('XSS Succeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
var diagram = `classDiagram
|
||||||
|
class Shape{
|
||||||
|
<<<img/src='1'/`;
|
||||||
|
|
||||||
|
// // var diagram = "stateDiagram-v2\n";
|
||||||
|
diagram += `onerror=xssAttack()>>>
|
||||||
|
}`;
|
||||||
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
|
// console.log(diagram);
|
||||||
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
|
console.log(res);
|
||||||
|
document.querySelector('#res').innerHTML = res;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@@ -22,11 +22,11 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
function xssAttack(){
|
function xssAttack() {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.id = 'the-malware'
|
div.id = 'the-malware';
|
||||||
div.className = 'malware'
|
div.className = 'malware';
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
@@ -62,11 +62,11 @@
|
|||||||
var handler = setInterval(() => {
|
var handler = setInterval(() => {
|
||||||
cnt++;
|
cnt++;
|
||||||
a = {};
|
a = {};
|
||||||
if(typeof a.polluted !== 'undefined') {
|
if (typeof a.polluted !== 'undefined') {
|
||||||
clearInterval(handler);
|
clearInterval(handler);
|
||||||
xssAttack();
|
xssAttack();
|
||||||
}
|
}
|
||||||
if(cnt>20) {
|
if (cnt > 20) {
|
||||||
clearInterval(handler);
|
clearInterval(handler);
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
@@ -22,11 +22,11 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
function xssAttack(){
|
function xssAttack() {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div');
|
||||||
div.id = 'the-malware'
|
div.id = 'the-malware';
|
||||||
div.className = 'malware'
|
div.className = 'malware';
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
@@ -49,11 +49,11 @@
|
|||||||
var handler = setInterval(() => {
|
var handler = setInterval(() => {
|
||||||
cnt++;
|
cnt++;
|
||||||
a = {};
|
a = {};
|
||||||
if(typeof a.polluted !== 'undefined') {
|
if (typeof a.polluted !== 'undefined') {
|
||||||
clearInterval(handler);
|
clearInterval(handler);
|
||||||
xssAttack();
|
xssAttack();
|
||||||
}
|
}
|
||||||
if(cnt>20) {
|
if (cnt > 20) {
|
||||||
clearInterval(handler);
|
clearInterval(handler);
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: false,
|
htmlLabels: false,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,24 +72,26 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'strict',
|
securityLevel: 'strict',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
|
||||||
var diagram = "%%{init: {\"flowchart\": {\"htmlLabels\": \"true\"}} }%%\n";
|
var diagram = '%%{init: {"flowchart": {"htmlLabels": "true"}} }%%\n';
|
||||||
diagram += "flowchart\n";
|
diagram += 'flowchart\n';
|
||||||
diagram += "A[\"<ifra";
|
diagram += 'A["<ifra';
|
||||||
diagram += "me srcdoc='<scrip";
|
diagram += "me srcdoc='<scrip";
|
||||||
diagram += "t src=http://localhost:9000/exploit.js>";
|
diagram += 't src=http://localhost:9000/exploit.js>';
|
||||||
diagram += "</scr"
|
diagram += '</scr';
|
||||||
diagram += "ipt>'></iframe>\"]";
|
diagram += 'ipt>\'></iframe>"]';
|
||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,29 +72,31 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
var diagram = "graph LR\n";
|
var diagram = 'graph LR\n';
|
||||||
diagram += "B-->D\(\"<img onerror=location=\`java";
|
diagram += 'B-->D("<img onerror=location=`java';
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
diagram += "script\x3a;xssAttack\u0028\u0029\` src=x>\"\);\n";
|
diagram += 'script\x3a;xssAttack\u0028\u0029` src=x>");\n';
|
||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,27 +72,29 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
var diagram = "graph LR\n";
|
var diagram = 'graph LR\n';
|
||||||
diagram += "A(<img/src/onerror=xssAttack`1`>)";
|
diagram += 'A(<img/src/onerror=xssAttack`1`>)';
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,29 +72,31 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
var diagram = "graph LR\n";
|
var diagram = 'graph LR\n';
|
||||||
diagram += " B(<a href='<";
|
diagram += " B(<a href='<";
|
||||||
diagram += "script></";
|
diagram += 'script></';
|
||||||
diagram += "script>Javascript:xssAttack`1`'>Click)";
|
diagram += "script>Javascript:xssAttack`1`'>Click)";
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = res;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,29 +72,30 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var diagram = 'stateDiagram-v2\n';
|
||||||
var diagram = "stateDiagram-v2\n";
|
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
||||||
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
console.log(diagram);
|
||||||
console.log(diagram);
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
console.log(res);
|
||||||
console.log(res);
|
document.querySelector('#res').innerHTML = res;
|
||||||
document.querySelector('#res').innerHTML = res;
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
arrowMarkerAbsolute: true,
|
arrowMarkerAbsolute: true,
|
||||||
@@ -58,11 +58,13 @@
|
|||||||
},
|
},
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
// fontFamily: '"times", sans-serif',
|
// fontFamily: '"times", sans-serif',
|
||||||
// fontFamily: 'courier',
|
// fontFamily: 'courier',
|
||||||
@@ -70,29 +72,30 @@
|
|||||||
curve: 'basis',
|
curve: 'basis',
|
||||||
securityLevel: 'antiscript',
|
securityLevel: 'antiscript',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
});
|
});
|
||||||
function callback(){alert('It worked');}
|
function callback() {
|
||||||
function xssAttack(){
|
alert('It worked');
|
||||||
const div = document.createElement('div')
|
}
|
||||||
div.id = 'the-malware'
|
function xssAttack() {
|
||||||
div.className = 'malware'
|
const div = document.createElement('div');
|
||||||
div.innerHTML = 'XSS Succeeded'
|
div.id = 'the-malware';
|
||||||
|
div.className = 'malware';
|
||||||
|
div.innerHTML = 'XSS Succeeded';
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeded');
|
throw new Error('XSS Succeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var diagram = 'stateDiagram-v2\n';
|
||||||
var diagram = "stateDiagram-v2\n";
|
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
||||||
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
console.log(diagram);
|
||||||
console.log(diagram);
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
console.log(res);
|
||||||
console.log(res);
|
document.querySelector('#res').innerHTML = res;
|
||||||
document.querySelector('#res').innerHTML = res;
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -16,7 +16,8 @@
|
|||||||
// // `config` is the resolved Cypress config
|
// // `config` is the resolved Cypress config
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
||||||
|
|
||||||
module.exports = (on, config) => {
|
module.exports = (on, config) => {
|
||||||
// `on` is used to hook into various events Cypress emits
|
addMatchImageSnapshotPlugin(on, config);
|
||||||
// `config` is the resolved Cypress config
|
|
||||||
};
|
};
|
||||||
|
@@ -24,4 +24,8 @@
|
|||||||
// -- This is will overwrite an existing command --
|
// -- This is will overwrite an existing command --
|
||||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||||
|
|
||||||
import '@percy/cypress';
|
// import '@percy/cypress';
|
||||||
|
|
||||||
|
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
||||||
|
|
||||||
|
addMatchImageSnapshotCommand();
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
// Import commands.js using ES2015 syntax:
|
// Import commands.js using ES2015 syntax:
|
||||||
import './commands';
|
import './commands';
|
||||||
import '@percy/cypress';
|
// import '@percy/cypress';
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
// Alternatively you can use CommonJS syntax:
|
||||||
// require('./commands')
|
// require('./commands')
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user