mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-17 07:19:24 +02:00
Compare commits
466 Commits
v9.4.0
...
huynhicode
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5e0630e21 | ||
![]() |
b30e9620f4 | ||
![]() |
be69f494b7 | ||
![]() |
fd6d1941b7 | ||
![]() |
8dfad241c3 | ||
![]() |
44f6d11537 | ||
![]() |
698951c059 | ||
![]() |
b3959299bc | ||
![]() |
1d4fc5051e | ||
![]() |
6ccdc2bd01 | ||
![]() |
01de155e3c | ||
![]() |
0485999636 | ||
![]() |
f638082ab4 | ||
![]() |
432e8d6535 | ||
![]() |
8c4fb6c753 | ||
![]() |
32538b5b03 | ||
![]() |
8aa51cf3e7 | ||
![]() |
32d553a28f | ||
![]() |
e84c5ec4c9 | ||
![]() |
aa5c1a5f78 | ||
![]() |
d9ebb0d492 | ||
![]() |
634d6602b9 | ||
![]() |
ea6f9c2d59 | ||
![]() |
dda2c25d52 | ||
![]() |
d13b58bec8 | ||
![]() |
b4164b6ab5 | ||
![]() |
aee18ca018 | ||
![]() |
cd976871f0 | ||
![]() |
4f9c4548bf | ||
![]() |
720408e143 | ||
![]() |
54f827d850 | ||
![]() |
7566b5620e | ||
![]() |
9cb7a4a3f5 | ||
![]() |
616d370a51 | ||
![]() |
83d7d6c48f | ||
![]() |
1c98621cf4 | ||
![]() |
727bf30824 | ||
![]() |
aa3c0023f4 | ||
![]() |
f08778d0c7 | ||
![]() |
37eb100bb2 | ||
![]() |
9bb0cef82b | ||
![]() |
4643bb1c00 | ||
![]() |
d132d26246 | ||
![]() |
777a781052 | ||
![]() |
d1e369e68d | ||
![]() |
3b861ab91f | ||
![]() |
721208e981 | ||
![]() |
ee455c1edb | ||
![]() |
43137fbdb2 | ||
![]() |
7ac84fb9af | ||
![]() |
efc4062721 | ||
![]() |
5693f63603 | ||
![]() |
8e6d16e601 | ||
![]() |
e96c8306d1 | ||
![]() |
756fc06c5d | ||
![]() |
80df10067d | ||
![]() |
e7c237dcf3 | ||
![]() |
75adb8ae90 | ||
![]() |
fc1962c795 | ||
![]() |
1a56a18f9b | ||
![]() |
1841346ff6 | ||
![]() |
e8799ad515 | ||
![]() |
2b9872d656 | ||
![]() |
9ffd4d2344 | ||
![]() |
815f4cab73 | ||
![]() |
bc573ef0bb | ||
![]() |
5d536b9973 | ||
![]() |
6807c48f9a | ||
![]() |
c777f9193d | ||
![]() |
917a54f3cd | ||
![]() |
471c842a58 | ||
![]() |
99f65813a1 | ||
![]() |
da7725f38e | ||
![]() |
7e610d13dc | ||
![]() |
64baf2d365 | ||
![]() |
f9c0f1d46f | ||
![]() |
3823ecafb1 | ||
![]() |
057c9e4b81 | ||
![]() |
e6db9e8fc3 | ||
![]() |
c4e4efd4b8 | ||
![]() |
da066553bd | ||
![]() |
a58d014a13 | ||
![]() |
006da82470 | ||
![]() |
1945a62990 | ||
![]() |
d16894daf4 | ||
![]() |
4d933f6b72 | ||
![]() |
7739302ee8 | ||
![]() |
46ab6f46f2 | ||
![]() |
48d267c6dc | ||
![]() |
15af3ea585 | ||
![]() |
35366f79ac | ||
![]() |
4c0980629c | ||
![]() |
8bd2c0f272 | ||
![]() |
2896865163 | ||
![]() |
a49cdabd6c | ||
![]() |
2dd6329872 | ||
![]() |
507a518a91 | ||
![]() |
4caf7d7c7b | ||
![]() |
89193d7360 | ||
![]() |
89eec225ce | ||
![]() |
cbc2df1ff6 | ||
![]() |
e4a2c74b1b | ||
![]() |
63160293c7 | ||
![]() |
9c0cb3f320 | ||
![]() |
fbeb016398 | ||
![]() |
093f1697e1 | ||
![]() |
f56e0bd530 | ||
![]() |
022e6670d0 | ||
![]() |
e3760d1709 | ||
![]() |
0475591fb6 | ||
![]() |
ba1c5dc6c7 | ||
![]() |
2f8c571a5c | ||
![]() |
a70b3a881d | ||
![]() |
950f560d81 | ||
![]() |
fd9680a050 | ||
![]() |
2d815e9626 | ||
![]() |
8c0550b2b7 | ||
![]() |
f054609e02 | ||
![]() |
45c0c5fee0 | ||
![]() |
a535fe1679 | ||
![]() |
e4d2118d4b | ||
![]() |
1184fce148 | ||
![]() |
a79f118323 | ||
![]() |
6cba2ea02d | ||
![]() |
3add711c55 | ||
![]() |
1481a8ccb1 | ||
![]() |
b3b7108d59 | ||
![]() |
fd9ad95346 | ||
![]() |
a1c50b8079 | ||
![]() |
4515c58d42 | ||
![]() |
0dc6e0a0d9 | ||
![]() |
8b37ceffe1 | ||
![]() |
b719fa9b18 | ||
![]() |
f3bebf25ea | ||
![]() |
7647ae317a | ||
![]() |
8c69ecd5ac | ||
![]() |
dc98fe6a3b | ||
![]() |
b56c8a2a7a | ||
![]() |
d18dff65e1 | ||
![]() |
2dc71377dc | ||
![]() |
89b9868870 | ||
![]() |
b232f20169 | ||
![]() |
2dd906d809 | ||
![]() |
fb70091046 | ||
![]() |
ddd245de71 | ||
![]() |
853d9b7f98 | ||
![]() |
f3a9f81bfb | ||
![]() |
4b462d717c | ||
![]() |
fc80ba66d2 | ||
![]() |
fd013286f6 | ||
![]() |
b7d31adda4 | ||
![]() |
273a9e7ad6 | ||
![]() |
f75bd397f8 | ||
![]() |
f70d52510a | ||
![]() |
f0c24d9ec5 | ||
![]() |
708633f639 | ||
![]() |
2e174bb3b6 | ||
![]() |
160fe0f971 | ||
![]() |
58d4ba0d8f | ||
![]() |
155e729722 | ||
![]() |
a17463307b | ||
![]() |
4e4f2fcfc5 | ||
![]() |
759ab0c0f9 | ||
![]() |
1a7b8d3897 | ||
![]() |
f5e7abb71f | ||
![]() |
1412bb4e94 | ||
![]() |
328f3968d1 | ||
![]() |
c965e4c456 | ||
![]() |
86aa7ab91e | ||
![]() |
141d38b4e7 | ||
![]() |
98af37f09f | ||
![]() |
a57e392ed4 | ||
![]() |
993a19e15b | ||
![]() |
7bea44e752 | ||
![]() |
f0a73696f5 | ||
![]() |
878c9f1d9d | ||
![]() |
8ebd550e0b | ||
![]() |
6b5221e465 | ||
![]() |
8f0cb695e7 | ||
![]() |
1913aad03f | ||
![]() |
b80da0daa1 | ||
![]() |
c2035c3709 | ||
![]() |
d77be9546d | ||
![]() |
e9d49e6b98 | ||
![]() |
6c2c28940b | ||
![]() |
72c94b6e6e | ||
![]() |
44d806e7f5 | ||
![]() |
727c56dbb1 | ||
![]() |
526e8fa1ad | ||
![]() |
969088187c | ||
![]() |
649e6820cc | ||
![]() |
8027a0c55d | ||
![]() |
d65d4fc39f | ||
![]() |
f7f6cc73f5 | ||
![]() |
55ebfadb32 | ||
![]() |
c5a5a22b72 | ||
![]() |
ad52d7d823 | ||
![]() |
b9576b4bbe | ||
![]() |
f57fed0eb4 | ||
![]() |
4e344df204 | ||
![]() |
43762c4d7f | ||
![]() |
4d1d1c36de | ||
![]() |
e603840395 | ||
![]() |
c7bcd74d56 | ||
![]() |
20298d243a | ||
![]() |
51c6462f1d | ||
![]() |
6f3077c856 | ||
![]() |
4a9d96aaba | ||
![]() |
4275aa613c | ||
![]() |
a65fb3b979 | ||
![]() |
c0dba713c5 | ||
![]() |
8810b378b3 | ||
![]() |
c3064f396c | ||
![]() |
82f5b4ca39 | ||
![]() |
73ce499863 | ||
![]() |
1ecf15669a | ||
![]() |
d24ddca03f | ||
![]() |
a7847038a5 | ||
![]() |
b6db75fe3e | ||
![]() |
2a838e645c | ||
![]() |
807e1f303d | ||
![]() |
65f5f9dc45 | ||
![]() |
b8b8c4740a | ||
![]() |
61bf7c577c | ||
![]() |
704506835f | ||
![]() |
f8f7d94d5a | ||
![]() |
114ab87816 | ||
![]() |
4a6056b558 | ||
![]() |
3a56af9633 | ||
![]() |
fda0c8d0a9 | ||
![]() |
b932cd0930 | ||
![]() |
2f06b41f5f | ||
![]() |
1ab3ed1a1a | ||
![]() |
1981f12976 | ||
![]() |
733967f65a | ||
![]() |
56d27d555b | ||
![]() |
7cee8cb6dc | ||
![]() |
c91fa192aa | ||
![]() |
3f93edaaf3 | ||
![]() |
0bed5d717b | ||
![]() |
1b56071eb3 | ||
![]() |
e050a5aaa1 | ||
![]() |
9b2f503dc7 | ||
![]() |
c7bdc6ad92 | ||
![]() |
a5db04b01c | ||
![]() |
06640aba06 | ||
![]() |
3bed70a0c5 | ||
![]() |
b079fb4710 | ||
![]() |
8b5cb75ef7 | ||
![]() |
a2855931d2 | ||
![]() |
50db9dcf8e | ||
![]() |
fa8a887ae1 | ||
![]() |
6e4e529af2 | ||
![]() |
275a54a562 | ||
![]() |
1bace23cea | ||
![]() |
f62c4831ad | ||
![]() |
7b4ce7c6ea | ||
![]() |
dda0d00fb9 | ||
![]() |
4bf5c9f3d8 | ||
![]() |
0409c5ac27 | ||
![]() |
19e5ccfdda | ||
![]() |
b13707fa7b | ||
![]() |
716a4d2cbc | ||
![]() |
3b2d55efec | ||
![]() |
870550bd7e | ||
![]() |
89f1ea49ba | ||
![]() |
7372d7d6c5 | ||
![]() |
0206ff540a | ||
![]() |
1e5d9ae1f4 | ||
![]() |
378e6b59e6 | ||
![]() |
8910ecb463 | ||
![]() |
ca97210d67 | ||
![]() |
f8abc9c6d5 | ||
![]() |
ef20e0b77a | ||
![]() |
f3b313ec1d | ||
![]() |
8f830a1698 | ||
![]() |
6a6b200a04 | ||
![]() |
15231924cd | ||
![]() |
7d4692f7b2 | ||
![]() |
285a7448ae | ||
![]() |
fd6ce89933 | ||
![]() |
c8e351c2bb | ||
![]() |
a59904cf16 | ||
![]() |
df36968ec8 | ||
![]() |
2ab1e15b86 | ||
![]() |
eca4163363 | ||
![]() |
1ac219282b | ||
![]() |
0df8c149f9 | ||
![]() |
bdf2667389 | ||
![]() |
b868777184 | ||
![]() |
fe2ef5e0c6 | ||
![]() |
ac21fe2d5c | ||
![]() |
6b251de227 | ||
![]() |
bb56492afe | ||
![]() |
2a9e846a49 | ||
![]() |
3b25cd3238 | ||
![]() |
4bc997cb8f | ||
![]() |
555d4f2cdc | ||
![]() |
75633ba125 | ||
![]() |
ec5fa31a11 | ||
![]() |
bfb8a75fca | ||
![]() |
067b6adc20 | ||
![]() |
a8162634cd | ||
![]() |
14c15b221a | ||
![]() |
8743e9e30e | ||
![]() |
22b18a4320 | ||
![]() |
786023ffa6 | ||
![]() |
6ded32880d | ||
![]() |
68cdc759a7 | ||
![]() |
eb04d80df0 | ||
![]() |
b6cac3a431 | ||
![]() |
3a71618a49 | ||
![]() |
dde8330888 | ||
![]() |
38b2cbc3d1 | ||
![]() |
2272af38b9 | ||
![]() |
40b5f868de | ||
![]() |
3e480612c7 | ||
![]() |
4c7306d808 | ||
![]() |
f66b524585 | ||
![]() |
5de5598069 | ||
![]() |
c9c4320f89 | ||
![]() |
543e4de0c8 | ||
![]() |
8174c7ca16 | ||
![]() |
014ab85420 | ||
![]() |
e51817b735 | ||
![]() |
c7d9103ede | ||
![]() |
92cd5ed133 | ||
![]() |
6fb17bb405 | ||
![]() |
638362baea | ||
![]() |
e22171c5bc | ||
![]() |
77207e0452 | ||
![]() |
4a721a2d25 | ||
![]() |
db8a14cdaf | ||
![]() |
1691d48b2e | ||
![]() |
8469e72709 | ||
![]() |
83f3ceb7f5 | ||
![]() |
4ea7294eeb | ||
![]() |
57fd3e586a | ||
![]() |
8363552c3a | ||
![]() |
8c64a90721 | ||
![]() |
6e3d96e16d | ||
![]() |
1684faf632 | ||
![]() |
e6b4e2c084 | ||
![]() |
03419c691c | ||
![]() |
6aa3ea43ae | ||
![]() |
735aceb37a | ||
![]() |
d2927435ab | ||
![]() |
eaa84d2d91 | ||
![]() |
941b959da3 | ||
![]() |
ae36586b58 | ||
![]() |
d22e8d92c6 | ||
![]() |
45adc5fb6b | ||
![]() |
c1aad5975c | ||
![]() |
0c18c0309b | ||
![]() |
631ff8fb9e | ||
![]() |
31629fe93f | ||
![]() |
735faa83e9 | ||
![]() |
2c062d648a | ||
![]() |
ea8128e881 | ||
![]() |
bd98f1477f | ||
![]() |
0f36bbf3e1 | ||
![]() |
3c4a6a19bb | ||
![]() |
e31924eadc | ||
![]() |
bb8bd111f8 | ||
![]() |
fec193ebaf | ||
![]() |
4ed6ec1a4d | ||
![]() |
ccaa99937f | ||
![]() |
17238c0326 | ||
![]() |
ac231949f0 | ||
![]() |
d543bc0411 | ||
![]() |
23ed533fac | ||
![]() |
86cfb1bb60 | ||
![]() |
b10d243995 | ||
![]() |
b22978dfb2 | ||
![]() |
276f042983 | ||
![]() |
71e4f1152b | ||
![]() |
0a923dfe91 | ||
![]() |
743c636441 | ||
![]() |
8c7043ffaf | ||
![]() |
f81f9f7c95 | ||
![]() |
ea7aaa5d56 | ||
![]() |
ec6ef35d21 | ||
![]() |
c815c84e1c | ||
![]() |
b8315cec6c | ||
![]() |
76fdc00b06 | ||
![]() |
83797eef38 | ||
![]() |
0db2657b7b | ||
![]() |
a1a252cc29 | ||
![]() |
533bd7da3c | ||
![]() |
037504785c | ||
![]() |
62f7fb082e | ||
![]() |
b89b90dbb9 | ||
![]() |
e9cc9f4005 | ||
![]() |
8df965bd60 | ||
![]() |
2b3019fb94 | ||
![]() |
31afd7499b | ||
![]() |
25da0c6c8e | ||
![]() |
aad147c219 | ||
![]() |
98bec36f81 | ||
![]() |
10e6c92766 | ||
![]() |
e1710fddd9 | ||
![]() |
bcfefefbd4 | ||
![]() |
ef4fbd8bb3 | ||
![]() |
17e317385a | ||
![]() |
102900749e | ||
![]() |
46f2aebabc | ||
![]() |
b9c2f62b47 | ||
![]() |
9d75665460 | ||
![]() |
6fcba87ee8 | ||
![]() |
3e9978a58c | ||
![]() |
fd8fb96ec2 | ||
![]() |
ad6a43cf81 | ||
![]() |
f6d9868e35 | ||
![]() |
94d4ee3a2c | ||
![]() |
004432fae9 | ||
![]() |
08ac41113f | ||
![]() |
e9d2d084fd | ||
![]() |
34c98717d5 | ||
![]() |
f22ce38ada | ||
![]() |
8ba33a994c | ||
![]() |
07764348eb | ||
![]() |
803c8ca45b | ||
![]() |
f791cd2b24 | ||
![]() |
b69b3919bb | ||
![]() |
886d1c15c4 | ||
![]() |
72e8b7fb38 | ||
![]() |
3a89cc7993 | ||
![]() |
bb3a48c91a | ||
![]() |
d45eda1c60 | ||
![]() |
4d12fb0464 | ||
![]() |
08e7bbcc13 | ||
![]() |
f83f09d8b0 | ||
![]() |
c4eb1608b0 | ||
![]() |
e8db9b2bd5 | ||
![]() |
5925d8b731 | ||
![]() |
96d5bc7695 | ||
![]() |
cdba2b4ac8 | ||
![]() |
15cfa5d40d | ||
![]() |
bf53a03c9d | ||
![]() |
3b32f44a60 | ||
![]() |
a8cd5e675d | ||
![]() |
bc269a966d | ||
![]() |
d39606cb47 | ||
![]() |
b04517b146 | ||
![]() |
024ee4213f | ||
![]() |
e861fbb517 | ||
![]() |
2e028ce36d | ||
![]() |
7306b5ac45 | ||
![]() |
0854bab124 | ||
![]() |
fa51121f29 | ||
![]() |
0b4c6f6477 | ||
![]() |
e5768454f1 | ||
![]() |
89b5eb56f2 | ||
![]() |
616c969a03 | ||
![]() |
4fd826ac8c | ||
![]() |
6d5a6ad0c8 | ||
![]() |
e0cd76e6fd | ||
![]() |
f03364f328 | ||
![]() |
25bc381361 | ||
![]() |
38e5c3a81e | ||
![]() |
43aa831dd2 | ||
![]() |
4492c5ed4e | ||
![]() |
5dec9eb2f5 | ||
![]() |
02903be558 | ||
![]() |
f36cf5b321 | ||
![]() |
82ac667535 |
14
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
14
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -50,19 +50,11 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Setup
|
label: Setup
|
||||||
description: |-
|
description: |-
|
||||||
Please fill out the below info.
|
Please fill out the info below.
|
||||||
Note that you only need to fill out one and not both sections.
|
Note that you only need to fill out the relevant section
|
||||||
value: |-
|
value: |-
|
||||||
**Desktop**
|
- Mermaid version:
|
||||||
|
|
||||||
- OS and Version: [Windows, Linux, Mac, ...]
|
|
||||||
- Browser and Version: [Chrome, Edge, Firefox]
|
- Browser and Version: [Chrome, Edge, Firefox]
|
||||||
|
|
||||||
**Smartphone**
|
|
||||||
|
|
||||||
- Device: [Samsung, iPhone, ...]
|
|
||||||
- OS and Version: [Android, iOS, ...]
|
|
||||||
- Browser and Version: [Chrome, Safari, ...]
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Additional Context
|
label: Additional Context
|
||||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: true
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: GitHub Discussions
|
- name: GitHub Discussions
|
||||||
url: https://github.com/mermaid-js/mermaid/discussions
|
url: https://github.com/mermaid-js/mermaid/discussions
|
||||||
|
2
.github/workflows/dependency-review.yml
vendored
2
.github/workflows/dependency-review.yml
vendored
@@ -17,4 +17,4 @@ jobs:
|
|||||||
- name: 'Checkout Repository'
|
- name: 'Checkout Repository'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@v2
|
uses: actions/dependency-review-action@v3
|
||||||
|
4
.github/workflows/e2e.yml
vendored
4
.github/workflows/e2e.yml
vendored
@@ -21,11 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
# Need to skip setup if Cypress run is skipped, otherwise an error
|
|
||||||
# is thrown since the pnpm cache step fails
|
|
||||||
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
|
||||||
with:
|
with:
|
||||||
cache: pnpm
|
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
# Install NPM dependencies, cache them correctly
|
# Install NPM dependencies, cache them correctly
|
||||||
|
12
.github/workflows/link-checker.yml
vendored
12
.github/workflows/link-checker.yml
vendored
@@ -14,6 +14,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
# * is a special character in YAML so you have to quote this string
|
# * is a special character in YAML so you have to quote this string
|
||||||
- cron: '30 8 * * *'
|
- cron: '30 8 * * *'
|
||||||
@@ -35,9 +36,16 @@ jobs:
|
|||||||
restore-keys: cache-lychee-
|
restore-keys: cache-lychee-
|
||||||
|
|
||||||
- name: Link Checker
|
- name: Link Checker
|
||||||
uses: lycheeverse/lychee-action@v1.5.4
|
uses: lycheeverse/lychee-action@v1.6.1
|
||||||
with:
|
with:
|
||||||
args: --verbose --no-progress --cache --max-cache-age 1d packages/mermaid/src/docs/**/*.md README.md README.zh-CN.md
|
args: >-
|
||||||
|
--verbose
|
||||||
|
--no-progress
|
||||||
|
--cache
|
||||||
|
--max-cache-age 1d
|
||||||
|
packages/mermaid/src/docs/**/*.md
|
||||||
|
README.md
|
||||||
|
README.zh-CN.md
|
||||||
fail: true
|
fail: true
|
||||||
jobSummary: true
|
jobSummary: true
|
||||||
env:
|
env:
|
||||||
|
2
.github/workflows/pr-labeler.yml
vendored
2
.github/workflows/pr-labeler.yml
vendored
@@ -8,6 +8,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Label PR
|
- name: Label PR
|
||||||
uses: TimonVS/pr-labeler-action@v3
|
uses: TimonVS/pr-labeler-action@v4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
4
.github/workflows/publish-docs.yml
vendored
4
.github/workflows/publish-docs.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -40,7 +41,7 @@ jobs:
|
|||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v2
|
uses: actions/configure-pages@v3
|
||||||
|
|
||||||
- name: Run Build
|
- name: Run Build
|
||||||
run: pnpm --filter mermaid run docs:build:vitepress
|
run: pnpm --filter mermaid run docs:build:vitepress
|
||||||
@@ -52,6 +53,7 @@ jobs:
|
|||||||
|
|
||||||
# Deployment job
|
# Deployment job
|
||||||
deploy:
|
deploy:
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
19
.github/workflows/release-publish.yml
vendored
19
.github/workflows/release-publish.yml
vendored
@@ -11,18 +11,21 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: fregante/setup-git-user@v1
|
- uses: fregante/setup-git-user@v1
|
||||||
|
|
||||||
- name: Setup Node.js
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
|
- name: Setup Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
|
cache: pnpm
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Json
|
|
||||||
run: npm i json --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: yarn install --frozen-lockfile
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
npm i json --global
|
||||||
|
env:
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Prepare release
|
- name: Prepare release
|
||||||
run: |
|
run: |
|
||||||
@@ -31,7 +34,7 @@ jobs:
|
|||||||
git checkout -t origin/release/$VERSION
|
git checkout -t origin/release/$VERSION
|
||||||
npm version --no-git-tag-version --allow-same-version $VERSION
|
npm version --no-git-tag-version --allow-same-version $VERSION
|
||||||
git add package.json
|
git add package.json
|
||||||
git commit -m "Bump version $VERSION"
|
git commit -nm "Bump version $VERSION"
|
||||||
git checkout -t origin/master
|
git checkout -t origin/master
|
||||||
git merge -m "Release $VERSION" --no-ff release/$VERSION
|
git merge -m "Release $VERSION" --no-ff release/$VERSION
|
||||||
git push --no-verify
|
git push --no-verify
|
||||||
|
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@@ -33,6 +33,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pnpm run ci --coverage
|
pnpm run ci --coverage
|
||||||
|
|
||||||
|
- name: Run ganttDb tests using California timezone
|
||||||
|
env:
|
||||||
|
# Makes sure that gantt db works even in a timezone that has daylight savings
|
||||||
|
# since some days have 25 hours instead of 24.
|
||||||
|
TZ: America/Los_Angeles
|
||||||
|
run: |
|
||||||
|
pnpm exec vitest run ./packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts
|
||||||
|
|
||||||
- name: Upload Coverage to Coveralls
|
- name: Upload Coverage to Coveralls
|
||||||
# it feels a bit weird to use @master, but that's what the docs use
|
# it feels a bit weird to use @master, but that's what the docs use
|
||||||
# (coveralls also doesn't publish a @v1 we can use)
|
# (coveralls also doesn't publish a @v1 we can use)
|
||||||
|
@@ -4,12 +4,7 @@
|
|||||||
# Network error: Forbidden
|
# Network error: Forbidden
|
||||||
https://codepen.io
|
https://codepen.io
|
||||||
|
|
||||||
# Network error: The certificate was not trusted
|
# Timeout error, maybe Twitter has anti-bot defenses against GitHub's CI servers?
|
||||||
https://mkdocs.org/
|
|
||||||
https://osawards.com/javascript/#nominees
|
|
||||||
https://osawards.com/javascript/2019
|
|
||||||
|
|
||||||
# Timeout error, maybe Twitter has anti-bot defences against GitHub's CI servers?
|
|
||||||
https://twitter.com/mermaidjs_
|
https://twitter.com/mermaidjs_
|
||||||
|
|
||||||
# Don't check files that are generated during the build via `pnpm docs:code`
|
# Don't check files that are generated during the build via `pnpm docs:code`
|
||||||
|
1
.npmrc
1
.npmrc
@@ -1,3 +1,2 @@
|
|||||||
auto-install-peers=true
|
auto-install-peers=true
|
||||||
strict-peer-dependencies=false
|
strict-peer-dependencies=false
|
||||||
use-inline-specifiers-lockfile-format=true
|
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
version: 2
|
|
||||||
snapshot:
|
|
||||||
widths:
|
|
||||||
- 1280
|
|
||||||
discovery:
|
|
||||||
disable-cache: true
|
|
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"ecmaVersion": 6,
|
|
||||||
"libs": ["browser"],
|
|
||||||
"loadEagerly": [],
|
|
||||||
"dontLoad": ["node_modules/**"],
|
|
||||||
"plugins": {
|
|
||||||
"modules": {},
|
|
||||||
"es_modules": {},
|
|
||||||
"node": {},
|
|
||||||
"doc_comment": {
|
|
||||||
"fullDocs": true,
|
|
||||||
"strong": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -3,6 +3,7 @@ import { resolve } from 'path';
|
|||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import jisonPlugin from './jisonPlugin.js';
|
import jisonPlugin from './jisonPlugin.js';
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
|
import typescript from '@rollup/plugin-typescript';
|
||||||
import { visualizer } from 'rollup-plugin-visualizer';
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||||||
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';
|
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';
|
||||||
|
|
||||||
@@ -20,13 +21,14 @@ const visualizerOptions = (packageName: string, core = false): PluginOption[] =>
|
|||||||
if (packageName !== 'mermaid' || !visualize) {
|
if (packageName !== 'mermaid' || !visualize) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return ['network', 'treemap', 'sunburst'].map((chartType) =>
|
return ['network', 'treemap', 'sunburst'].map(
|
||||||
visualizer({
|
(chartType) =>
|
||||||
filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
|
visualizer({
|
||||||
template: chartType as TemplateType,
|
filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
|
||||||
gzipSize: true,
|
template: chartType as TemplateType,
|
||||||
brotliSize: true,
|
gzipSize: true,
|
||||||
})
|
brotliSize: true,
|
||||||
|
}) as PluginOption
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -61,12 +63,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
|
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name,
|
|
||||||
format: 'umd',
|
|
||||||
sourcemap: true,
|
|
||||||
entryFileNames: `${name}${minify ? '.min' : ''}.js`,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (core) {
|
if (core) {
|
||||||
@@ -107,9 +103,14 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.jison', '.js', '.ts', '.json'],
|
extensions: [],
|
||||||
},
|
},
|
||||||
plugins: [jisonPlugin(), ...visualizerOptions(packageName, core)],
|
plugins: [
|
||||||
|
jisonPlugin(),
|
||||||
|
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
||||||
|
typescript({ compilerOptions: { declaration: false } }),
|
||||||
|
...visualizerOptions(packageName, core),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (watch && config.build) {
|
if (watch && config.build) {
|
||||||
@@ -122,11 +123,9 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
||||||
return Promise.allSettled([
|
await build(getBuildConfig({ minify: false, entryName }));
|
||||||
build(getBuildConfig({ minify: false, entryName })),
|
await build(getBuildConfig({ minify: 'esbuild', entryName }));
|
||||||
build(getBuildConfig({ minify: 'esbuild', entryName })),
|
await build(getBuildConfig({ minify: false, core: true, entryName }));
|
||||||
build(getBuildConfig({ minify: false, core: true, entryName })),
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
|
@@ -1,27 +1,20 @@
|
|||||||
import express, { NextFunction, Request, Response } from 'express';
|
import express from 'express';
|
||||||
|
import cors from 'cors';
|
||||||
import { createServer as createViteServer } from 'vite';
|
import { createServer as createViteServer } from 'vite';
|
||||||
|
|
||||||
const cors = (req: Request, res: Response, next: NextFunction) => {
|
|
||||||
res.header('Access-Control-Allow-Origin', '*');
|
|
||||||
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
|
||||||
res.header('Access-Control-Allow-Headers', 'Content-Type');
|
|
||||||
|
|
||||||
next();
|
|
||||||
};
|
|
||||||
|
|
||||||
async function createServer() {
|
async function createServer() {
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// Create Vite server in middleware mode
|
// Create Vite server in middleware mode
|
||||||
const vite = await createViteServer({
|
const vite = await createViteServer({
|
||||||
configFile: './vite.config.ts',
|
configFile: './vite.config.ts',
|
||||||
|
mode: 'production',
|
||||||
server: { middlewareMode: true },
|
server: { middlewareMode: true },
|
||||||
appType: 'custom', // don't include Vite's default HTML handling middlewares
|
appType: 'custom', // don't include Vite's default HTML handling middleware
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(cors);
|
app.use(cors());
|
||||||
app.use(express.static('./packages/mermaid/dist'));
|
app.use(express.static('./packages/mermaid/dist'));
|
||||||
// app.use(express.static('./packages/mermaid-example-diagram/dist'));
|
|
||||||
app.use(express.static('./packages/mermaid-example-diagram/dist'));
|
app.use(express.static('./packages/mermaid-example-diagram/dist'));
|
||||||
app.use(vite.middlewares);
|
app.use(vite.middlewares);
|
||||||
app.use(express.static('demos'));
|
app.use(express.static('demos'));
|
||||||
|
103
CHANGELOG.md
103
CHANGELOG.md
@@ -1,6 +1,105 @@
|
|||||||
# Change Log
|
# Changelog
|
||||||
|
|
||||||
// TODO: Populate changelog
|
## [10.0.0](https://github.com/mermaid-js/mermaid/releases/tag/v10.0.0)
|
||||||
|
|
||||||
|
### Mermaid is ESM only!
|
||||||
|
|
||||||
|
We've dropped CJS support. So, you will have to update your import scripts as follows.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
|
||||||
|
mermaid.initialize({ startOnLoad: true });
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can keep using v9 by adding the `@9` in the CDN URL.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.js"></script>
|
||||||
|
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
### mermaid.render is async and doesn't accept callbacks
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.render('id', 'graph TD;\nA-->B', (svg, bindFunctions) => {
|
||||||
|
element.innerHTML = svg;
|
||||||
|
if (bindFunctions) {
|
||||||
|
bindFunctions(element);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Shorter syntax
|
||||||
|
if (bindFunctions) {
|
||||||
|
bindFunctions(element);
|
||||||
|
}
|
||||||
|
// can be replaced with the `?.` shorthand
|
||||||
|
bindFunctions?.(element);
|
||||||
|
|
||||||
|
// >= v10 with async/await
|
||||||
|
const { svg, bindFunctions } = await mermaid.render('id', 'graph TD;\nA-->B');
|
||||||
|
element.innerHTML = svg;
|
||||||
|
bindFunctions?.(element);
|
||||||
|
|
||||||
|
// >= v10 with promise.then
|
||||||
|
mermaid.render('id', 'graph TD;A-->B').then(({ svg, bindFunctions }) => {
|
||||||
|
element.innerHTML = svg;
|
||||||
|
bindFunctions?.(element);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### mermaid.parse is async and ParseError is removed
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.parse(text, parseError);
|
||||||
|
|
||||||
|
//>= v10
|
||||||
|
await mermaid.parse(text).catch(parseError);
|
||||||
|
// or
|
||||||
|
try {
|
||||||
|
await mermaid.parse(text);
|
||||||
|
} catch (err) {
|
||||||
|
parseError(err);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Init deprecated and InitThrowsErrors removed
|
||||||
|
|
||||||
|
The config passed to `init` was not being used eariler.
|
||||||
|
It will now be used.
|
||||||
|
The `init` function is deprecated and will be removed in the next major release.
|
||||||
|
init currently works as a wrapper to `initialize` and `run`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.init(config, selector, cb);
|
||||||
|
|
||||||
|
//>= v10
|
||||||
|
mermaid.initialize(config);
|
||||||
|
mermaid.run({
|
||||||
|
querySelector: selector,
|
||||||
|
postRenderCallback: cb,
|
||||||
|
suppressErrors: true,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// < v10
|
||||||
|
mermaid.initThrowsErrors(config, selector, cb);
|
||||||
|
|
||||||
|
//>= v10
|
||||||
|
mermaid.initialize(config);
|
||||||
|
mermaid.run({
|
||||||
|
querySelector: selector,
|
||||||
|
postRenderCallback: cb,
|
||||||
|
suppressErrors: false,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
// TODO: Populate changelog pre v10
|
||||||
|
|
||||||
- Config has a lot of changes
|
- Config has a lot of changes
|
||||||
- globalReset resets to `defaultConfig` instead of current config. Use `reset` instead.
|
- globalReset resets to `defaultConfig` instead of current config. Use `reset` instead.
|
||||||
|
@@ -55,6 +55,8 @@ The documentation is written in **Markdown**. For more information about Markdow
|
|||||||
The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
|
The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
|
||||||
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.
|
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.
|
||||||
|
|
||||||
|
After editing files in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory, be sure to run `pnpm install` and `pnpm run --filter mermaid docs:build` locally to build the `/docs` directory.
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart LR
|
flowchart LR
|
||||||
classDef default fill:#fff,color:black,stroke:black
|
classDef default fill:#fff,color:black,stroke:black
|
||||||
@@ -63,6 +65,28 @@ flowchart LR
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can use `note`, `tip`, `warning` and `danger` in triple backticks to add a note, tip, warning or danger box.
|
||||||
|
Do not use vitepress specific markdown syntax `::: warning` as it will not be processed correctly.
|
||||||
|
|
||||||
|
````
|
||||||
|
```note
|
||||||
|
Note content
|
||||||
|
```
|
||||||
|
|
||||||
|
```tip
|
||||||
|
Tip content
|
||||||
|
```
|
||||||
|
|
||||||
|
```warning
|
||||||
|
Warning content
|
||||||
|
```
|
||||||
|
|
||||||
|
```danger
|
||||||
|
Danger content
|
||||||
|
```
|
||||||
|
|
||||||
|
````
|
||||||
|
|
||||||
**_DO NOT CHANGE FILES IN `/docs`_**
|
**_DO NOT CHANGE FILES IN `/docs`_**
|
||||||
|
|
||||||
### The official documentation site
|
### The official documentation site
|
||||||
|
79
README.md
79
README.md
@@ -1,8 +1,37 @@
|
|||||||
# mermaid
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/develop/docs/public/favicon.svg" height="150">
|
||||||
|
</p>
|
||||||
|
<h1 align="center">
|
||||||
|
Mermaid
|
||||||
|
</h1>
|
||||||
|
<p align="center">
|
||||||
|
Generate diagrams from markdown-like text.
|
||||||
|
<p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.npmjs.com/package/mermaid"><img src="https://img.shields.io/npm/v/mermaid?color=ff3670&label="></a>
|
||||||
|
<p>
|
||||||
|
|
||||||
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml) [](https://www.npmjs.com/package/mermaid) [](https://bundlephobia.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://www.jsdelivr.com/package/npm/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://twitter.com/mermaidjs_)
|
<p align="center">
|
||||||
|
<a href="https://mermaid.live/"><b>Live Editor!</b></a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE" title="Slack invite">🙌 Join Us</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.zh-CN.md">简体中文</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
English | [简体中文](./README.zh-CN.md)
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml)
|
||||||
|
[](https://bundlephobia.com/package/mermaid)
|
||||||
|
[](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
|
||||||
|
[](https://www.jsdelivr.com/package/npm/mermaid)
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
[](https://twitter.com/mermaidjs_)
|
||||||
|
|
||||||
<img src="./img/header.png" alt="" />
|
<img src="./img/header.png" alt="" />
|
||||||
|
|
||||||
@@ -27,14 +56,12 @@ Mermaid addresses this problem by enabling users to create easily modifiable dia
|
|||||||
|
|
||||||
Mermaid allows even non-programmers to easily create detailed diagrams through the [Mermaid Live Editor](https://mermaid.live/).<br/>
|
Mermaid allows even non-programmers to easily create detailed diagrams through the [Mermaid Live Editor](https://mermaid.live/).<br/>
|
||||||
[Tutorials](./docs/config/Tutorials.md) has video tutorials.
|
[Tutorials](./docs/config/Tutorials.md) has video tutorials.
|
||||||
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/misc/integrations.md).
|
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/ecosystem/integrations.md).
|
||||||
|
|
||||||
You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid](./docs/misc/integrations.md).
|
You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid](./docs/ecosystem/integrations.md).
|
||||||
|
|
||||||
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/community/n00b-overview.md), [Usage](./docs/config/usage.md) and [Tutorials](./docs/config/Tutorials.md).
|
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/community/n00b-overview.md), [Usage](./docs/config/usage.md) and [Tutorials](./docs/config/Tutorials.md).
|
||||||
|
|
||||||
🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [Documentation](https://mermaidjs.github.io) | 🙌 [Contribution](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [Changelog](./docs/CHANGELOG.md)
|
|
||||||
|
|
||||||
In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests.
|
In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests.
|
||||||
|
|
||||||
<a href="https://applitools.com/">
|
<a href="https://applitools.com/">
|
||||||
@@ -199,6 +226,44 @@ pie
|
|||||||
|
|
||||||
### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]
|
### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]
|
||||||
|
|
||||||
|
### Bar chart (using gantt chart) [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaid.live/edit#pako:eNptkU1vhCAQhv8KIenNugiI4rkf6bmXpvEyFVxJFDYyNt1u9r8X63Z7WQ9m5pknLzieaBeMpQ3dg0dsPUkPOhwteXZIXmJcbCT3xMAxkuh8Z8kIEclyMIB209fqKcwTICFvG4IvFy_oLrZ-g9F26ILfQgvNFN94VaRXQ1iWqpumZBcu1J8p1E1TXDx59eQNr5LyEqjJn6hv5QnGNlxevZJmdLLpy5xJSzut45biYCfb0iaVxvawjNjS1p-TCguG16PvaIPzYjO67e3BwX6GiTY9jPFKH43DMF_hGMDY1J4oHg-_f8hFTJFd8L3br3yZx4QHxENsdrt1nO8dDstH3oVpF50ZYMbhU6ud4qoGLqyqBJRCmO6j0HXPZdGbihUc6Pmc0QP49xD-b5X69ZQv2gjO81IwzWqhC1lKrjJ6pA3nVS7SMiVjrKirWlYp5fs3osgrWeo00lorLWvOzz8JVbXm">live editor</a>]
|
||||||
|
|
||||||
|
```
|
||||||
|
gantt
|
||||||
|
title Git Issues - days since last update
|
||||||
|
dateFormat X
|
||||||
|
axisFormat %s
|
||||||
|
|
||||||
|
section Issue19062
|
||||||
|
71 : 0, 71
|
||||||
|
section Issue19401
|
||||||
|
36 : 0, 36
|
||||||
|
section Issue193
|
||||||
|
34 : 0, 34
|
||||||
|
section Issue7441
|
||||||
|
9 : 0, 9
|
||||||
|
section Issue1300
|
||||||
|
5 : 0, 5
|
||||||
|
```
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
gantt
|
||||||
|
title Git Issues - days since last update
|
||||||
|
dateFormat X
|
||||||
|
axisFormat %s
|
||||||
|
|
||||||
|
section Issue19062
|
||||||
|
71 : 0, 71
|
||||||
|
section Issue19401
|
||||||
|
36 : 0, 36
|
||||||
|
section Issue193
|
||||||
|
34 : 0, 34
|
||||||
|
section Issue7441
|
||||||
|
9 : 0, 9
|
||||||
|
section Issue1300
|
||||||
|
5 : 0, 5
|
||||||
|
```
|
||||||
|
|
||||||
### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]
|
### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@@ -1,8 +1,37 @@
|
|||||||
# mermaid
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/develop/docs/public/favicon.svg" height="150">
|
||||||
|
</p>
|
||||||
|
<h1 align="center">
|
||||||
|
Mermaid
|
||||||
|
</h1>
|
||||||
|
<p align="center">
|
||||||
|
通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。
|
||||||
|
<p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.npmjs.com/package/mermaid"><img src="https://img.shields.io/npm/v/mermaid?color=ff3670&label="></a>
|
||||||
|
<p>
|
||||||
|
|
||||||
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml) [](https://www.npmjs.com/package/mermaid) [](https://bundlephobia.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://www.jsdelivr.com/package/npm/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://twitter.com/mermaidjs_)
|
<p align="center">
|
||||||
|
<a href="https://mermaid.live/"><b>Live Editor!</b></a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE" title="Slack invite">🙌 加入我们</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="./README.md">English</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[English](./README.md) | 简体中文
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml)
|
||||||
|
[](https://bundlephobia.com/package/mermaid)
|
||||||
|
[](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
|
||||||
|
[](https://www.jsdelivr.com/package/npm/mermaid)
|
||||||
|
[](https://www.npmjs.com/package/mermaid)
|
||||||
|
[](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
||||||
|
[](https://twitter.com/mermaidjs_)
|
||||||
|
|
||||||
<img src="./img/header.png" alt="" />
|
<img src="./img/header.png" alt="" />
|
||||||
|
|
||||||
@@ -24,12 +53,10 @@ Mermaid 是一个基于 Javascript 的图表绘制工具,通过解析类 Markd
|
|||||||
Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它也可以作为生产脚本(或其他代码)的一部分。<br/>
|
Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它也可以作为生产脚本(或其他代码)的一部分。<br/>
|
||||||
<br/>
|
<br/>
|
||||||
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid.live/) 轻松创建详细的图表。<br/>
|
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid.live/) 轻松创建详细的图表。<br/>
|
||||||
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/misc/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/ecosystem/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
||||||
|
|
||||||
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/community/n00b-overview.md), [用法](./docs/config/usage.md) 和 [教程](./docs/config/Tutorials.md).
|
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/community/n00b-overview.md), [用法](./docs/config/usage.md) 和 [教程](./docs/config/Tutorials.md).
|
||||||
|
|
||||||
🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [文档](https://mermaidjs.github.io) | 🙌 [贡献](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [更新日志](./docs/CHANGELOG.md)
|
|
||||||
|
|
||||||
<!-- </Main description> -->
|
<!-- </Main description> -->
|
||||||
|
|
||||||
## 示例
|
## 示例
|
||||||
@@ -325,7 +352,7 @@ _很不幸的是,鱼与熊掌不可兼得,在这个场景下它意味着在
|
|||||||
|
|
||||||
来自 Knut Sveidqvist:
|
来自 Knut Sveidqvist:
|
||||||
|
|
||||||
> _特别感谢 [d3](https://d3js.org/) 和 [dagre-d3](https://github.com/cpettitt/dagre-d3) 这两个优秀的项目,它们提供了图形布局和绘图工具库! _ >_同样感谢 [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) 提供了时序图语法的使用。 感谢 Jessica Peter 提供了甘特图渲染的灵感。_ >_感谢 [Tyler Long](https://github.com/tylerlong) 从 2017 年四月开始成为了项目的合作者。_
|
> _特别感谢 [d3](https://d3js.org/) 和 [dagre-d3](https://github.com/cpettitt/dagre-d3) 这两个优秀的项目,它们提供了图形布局和绘图工具库!_ > _同样感谢 [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) 提供了时序图语法的使用。 感谢 Jessica Peter 提供了甘特图渲染的灵感。_ > _感谢 [Tyler Long](https://github.com/tylerlong) 从 2017 年四月开始成为了项目的合作者。_
|
||||||
>
|
>
|
||||||
> _感谢越来越多的 [贡献者们](https://github.com/knsv/mermaid/graphs/contributors),没有你们,就没有这个项目的今天!_
|
> _感谢越来越多的 [贡献者们](https://github.com/knsv/mermaid/graphs/contributors),没有你们,就没有这个项目的今天!_
|
||||||
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
# A collection of updates that change the behaviour
|
|
||||||
|
|
||||||
## Lazy loading and asynchronisity
|
|
||||||
|
|
||||||
- Invalid dates are rendered as syntax error instead of returning best guess or the current date
|
|
@@ -1,5 +1,5 @@
|
|||||||
// @ts-nocheck TODO: Fix TS
|
// @ts-nocheck TODO: Fix TS
|
||||||
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3';
|
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3.js';
|
||||||
|
|
||||||
export const select = function () {
|
export const select = function () {
|
||||||
return new MockedD3();
|
return new MockedD3();
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
"brkt",
|
"brkt",
|
||||||
"brolin",
|
"brolin",
|
||||||
"brotli",
|
"brotli",
|
||||||
|
"città",
|
||||||
"classdef",
|
"classdef",
|
||||||
"codedoc",
|
"codedoc",
|
||||||
"colour",
|
"colour",
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
"cuzon",
|
"cuzon",
|
||||||
"cytoscape",
|
"cytoscape",
|
||||||
"dagre",
|
"dagre",
|
||||||
|
"deepdwn",
|
||||||
"descr",
|
"descr",
|
||||||
"docsify",
|
"docsify",
|
||||||
"docsy",
|
"docsy",
|
||||||
@@ -45,6 +47,7 @@
|
|||||||
"graphviz",
|
"graphviz",
|
||||||
"grav",
|
"grav",
|
||||||
"greywolf",
|
"greywolf",
|
||||||
|
"huynh",
|
||||||
"inkdrop",
|
"inkdrop",
|
||||||
"jaoude",
|
"jaoude",
|
||||||
"jison",
|
"jison",
|
||||||
@@ -88,6 +91,7 @@
|
|||||||
"sidharthv",
|
"sidharthv",
|
||||||
"sphinxcontrib",
|
"sphinxcontrib",
|
||||||
"statediagram",
|
"statediagram",
|
||||||
|
"steph",
|
||||||
"stylis",
|
"stylis",
|
||||||
"substate",
|
"substate",
|
||||||
"sveidqvist",
|
"sveidqvist",
|
||||||
|
@@ -22,7 +22,7 @@ export const mermaidUrl = (graphStr, options, api) => {
|
|||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const imgSnapshotTest = (graphStr, _options, api = false, validation) => {
|
export const imgSnapshotTest = (graphStr, _options = {}, api = false, validation = undefined) => {
|
||||||
cy.log(_options);
|
cy.log(_options);
|
||||||
const options = Object.assign(_options);
|
const options = Object.assign(_options);
|
||||||
if (!options.fontFamily) {
|
if (!options.fontFamily) {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { renderGraph } from '../../helpers/util';
|
import { renderGraph } from '../../helpers/util.js';
|
||||||
describe('Configuration', () => {
|
describe('Configuration', () => {
|
||||||
describe('arrowMarkerAbsolute', () => {
|
describe('arrowMarkerAbsolute', () => {
|
||||||
it('should handle default value false of arrowMarkerAbsolute', () => {
|
it('should handle default value false of arrowMarkerAbsolute', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { urlSnapshotTest } from '../../helpers/util';
|
import { urlSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('mermaid', () => {
|
describe('mermaid', () => {
|
||||||
describe('registerDiagram', () => {
|
describe('registerDiagram', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { urlSnapshotTest } from '../../helpers/util';
|
import { urlSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('CSS injections', () => {
|
describe('CSS injections', () => {
|
||||||
it('should not allow CSS injections outside of the diagram', () => {
|
it('should not allow CSS injections outside of the diagram', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
describe('Class diagram V2', () => {
|
describe('Class diagram V2', () => {
|
||||||
it('0: should render a simple class diagram', () => {
|
it('0: should render a simple class diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -13,7 +13,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('1: should render a simple class diagram', () => {
|
it('1: should render a simple class diagram', () => {
|
||||||
@@ -47,7 +46,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('2: should render a simple class diagrams with cardinality', () => {
|
it('2: should render a simple class diagrams with cardinality', () => {
|
||||||
@@ -76,7 +74,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a simple class diagram with different visibilities', () => {
|
it('should render a simple class diagram with different visibilities', () => {
|
||||||
@@ -94,7 +91,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render multiple class diagrams', () => {
|
it('should render multiple class diagrams', () => {
|
||||||
@@ -147,7 +143,6 @@ describe('Class diagram V2', () => {
|
|||||||
],
|
],
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('4: should render a simple class diagram with comments', () => {
|
it('4: should render a simple class diagram with comments', () => {
|
||||||
@@ -177,7 +172,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('5: should render a simple class diagram with abstract method', () => {
|
it('5: should render a simple class diagram with abstract method', () => {
|
||||||
@@ -189,7 +183,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('6: should render a simple class diagram with static method', () => {
|
it('6: should render a simple class diagram with static method', () => {
|
||||||
@@ -201,7 +194,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('7: should render a simple class diagram with Generic class', () => {
|
it('7: should render a simple class diagram with Generic class', () => {
|
||||||
@@ -221,7 +213,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('8: should render a simple class diagram with Generic class and relations', () => {
|
it('8: should render a simple class diagram with Generic class and relations', () => {
|
||||||
@@ -242,7 +233,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('9: should render a simple class diagram with clickable link', () => {
|
it('9: should render a simple class diagram with clickable link', () => {
|
||||||
@@ -264,7 +254,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('10: should render a simple class diagram with clickable callback', () => {
|
it('10: should render a simple class diagram with clickable callback', () => {
|
||||||
@@ -286,7 +275,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('11: should render a simple class diagram with return type on method', () => {
|
it('11: should render a simple class diagram with return type on method', () => {
|
||||||
@@ -301,7 +289,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('12: should render a simple class diagram with generic types', () => {
|
it('12: should render a simple class diagram with generic types', () => {
|
||||||
@@ -317,7 +304,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('13: should render a simple class diagram with css classes applied', () => {
|
it('13: should render a simple class diagram with css classes applied', () => {
|
||||||
@@ -335,7 +321,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('14: should render a simple class diagram with css classes applied directly', () => {
|
it('14: should render a simple class diagram with css classes applied directly', () => {
|
||||||
@@ -351,7 +336,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
|
it('15: should render a simple class diagram with css classes applied two multiple classes', () => {
|
||||||
@@ -365,7 +349,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('16a: should render a simple class diagram with static field', () => {
|
it('16a: should render a simple class diagram with static field', () => {
|
||||||
@@ -378,7 +361,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('16b: should handle the direction statement with TB', () => {
|
it('16b: should handle the direction statement with TB', () => {
|
||||||
@@ -403,7 +385,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('18: should handle the direction statement with LR', () => {
|
it('18: should handle the direction statement with LR', () => {
|
||||||
@@ -428,7 +409,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('17a: should handle the direction statement with BT', () => {
|
it('17a: should handle the direction statement with BT', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -452,7 +432,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('17b: should handle the direction statement with RL', () => {
|
it('17b: should handle the direction statement with RL', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -476,7 +455,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('18: should render a simple class diagram with notes', () => {
|
it('18: should render a simple class diagram with notes', () => {
|
||||||
@@ -493,7 +471,6 @@ describe('Class diagram V2', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('1433: should render a simple class with a title', () => {
|
it('1433: should render a simple class with a title', () => {
|
||||||
@@ -503,8 +480,72 @@ title: simple class diagram
|
|||||||
---
|
---
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class Class10
|
class Class10
|
||||||
`,
|
`
|
||||||
{}
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a class with text label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class 1 with text label"]
|
||||||
|
C1 --> C2`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render two classes with text labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class 1 with text label"]
|
||||||
|
class C2["Class 2 with chars @?"]
|
||||||
|
C1 --> C2`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render a class with a text label, members and annotation', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class 1 with text label"] {
|
||||||
|
<<interface>>
|
||||||
|
+member1
|
||||||
|
}
|
||||||
|
C1 --> C2`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render multiple classes with same text labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["Class with text label"]
|
||||||
|
class C2["Class with text label"]
|
||||||
|
class C3["Class with text label"]
|
||||||
|
C1 --> C2
|
||||||
|
C3 ..> C2
|
||||||
|
`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should render classes with different text labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
class C1["OneWord"]
|
||||||
|
class C2["With, Comma"]
|
||||||
|
class C3["With (Brackets)"]
|
||||||
|
class C4["With [Brackets]"]
|
||||||
|
class C5["With {Brackets}"]
|
||||||
|
class C7["With 1 number"]
|
||||||
|
class C8["With . period..."]
|
||||||
|
class C9["With - dash"]
|
||||||
|
class C10["With _ underscore"]
|
||||||
|
class C11["With ' single quote"]
|
||||||
|
class C12["With ~!@#$%^&*()_+=-/?"]
|
||||||
|
class C13["With Città foreign language"]
|
||||||
|
`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render classLabel if class has already been defined earlier', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`classDiagram
|
||||||
|
Animal <|-- Duck
|
||||||
|
class Duck["Duck with text label"]
|
||||||
|
`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Class diagram', () => {
|
describe('Class diagram', () => {
|
||||||
it('1: should render a simple class diagram', () => {
|
it('1: should render a simple class diagram', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Current diagram', () => {
|
describe('Current diagram', () => {
|
||||||
it('should render a state with states in it', () => {
|
it('should render a state with states in it', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Flowchart', () => {
|
describe('Flowchart', () => {
|
||||||
it('34: testing the label width in percy', () => {
|
it('34: testing the label width in percy', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Entity Relationship Diagram', () => {
|
describe('Entity Relationship Diagram', () => {
|
||||||
it('should render a simple ER diagram', () => {
|
it('should render a simple ER diagram', () => {
|
||||||
@@ -10,7 +10,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagram with a recursive relationship', () => {
|
it('should render an ER diagram with a recursive relationship', () => {
|
||||||
@@ -23,7 +22,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagram with multiple relationships between the same two entities', () => {
|
it('should render an ER diagram with multiple relationships between the same two entities', () => {
|
||||||
@@ -35,7 +33,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a cyclical ER diagram', () => {
|
it('should render a cyclical ER diagram', () => {
|
||||||
@@ -48,7 +45,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a not-so-simple ER diagram', () => {
|
it('should render a not-so-simple ER diagram', () => {
|
||||||
@@ -66,7 +62,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render multiple ER diagrams', () => {
|
it('should render multiple ER diagrams', () => {
|
||||||
@@ -85,7 +80,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
],
|
],
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagram with blank or empty labels', () => {
|
it('should render an ER diagram with blank or empty labels', () => {
|
||||||
@@ -98,7 +92,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render an ER diagrams when useMaxWidth is true (default)', () => {
|
it('should render an ER diagrams when useMaxWidth is true (default)', () => {
|
||||||
@@ -151,7 +144,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ er: { useMaxWidth: false } }
|
{ er: { useMaxWidth: false } }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with and without attributes', () => {
|
it('should render entities with and without attributes', () => {
|
||||||
@@ -164,7 +156,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with generic and array attributes', () => {
|
it('should render entities with generic and array attributes', () => {
|
||||||
@@ -179,7 +170,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with length in attributes type', () => {
|
it('should render entities with length in attributes type', () => {
|
||||||
@@ -188,12 +178,11 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
erDiagram
|
erDiagram
|
||||||
CLUSTER {
|
CLUSTER {
|
||||||
varchar(99) name
|
varchar(99) name
|
||||||
string(255) description
|
string(255) description
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities and attributes with big and small entity names', () => {
|
it('should render entities and attributes with big and small entity names', () => {
|
||||||
@@ -209,7 +198,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with keys', () => {
|
it('should render entities with keys', () => {
|
||||||
@@ -228,7 +216,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with comments', () => {
|
it('should render entities with comments', () => {
|
||||||
@@ -247,7 +234,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with keys and comments', () => {
|
it('should render entities with keys and comments', () => {
|
||||||
@@ -267,7 +253,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with aliases', () => {
|
it('should render entities with aliases', () => {
|
||||||
@@ -285,7 +270,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('1433: should render a simple ER diagram with a title', () => {
|
it('1433: should render a simple ER diagram with a title', () => {
|
||||||
|
45
cypress/integration/rendering/errorDiagram.spec.js
Normal file
45
cypress/integration/rendering/errorDiagram.spec.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util';
|
||||||
|
|
||||||
|
describe('Error Diagrams', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.on('uncaught:exception', (err) => {
|
||||||
|
expect(err.message).to.include('Parse error');
|
||||||
|
// return false to prevent the error from
|
||||||
|
// failing this test
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a simple ER diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
error
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render error diagram for actual errors', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart TD
|
||||||
|
A[Christmas] --|Get money| B(Go shopping)
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render error for wrong ER diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
erDiagram
|
||||||
|
ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
|
||||||
|
ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
|
||||||
|
ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
|
||||||
|
MONGODB-CLUSTERS ||..|{
|
||||||
|
ATLAS-TEAMS ||..|{
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
@@ -1,6 +1,6 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Flowchart ELK', () => {
|
describe.skip('Flowchart ELK', () => {
|
||||||
it('1-elk: should render a simple flowchart', () => {
|
it('1-elk: should render a simple flowchart', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`flowchart-elk TD
|
`flowchart-elk TD
|
||||||
@@ -684,4 +684,149 @@ A --> B
|
|||||||
{ titleTopMargin: 0 }
|
{ titleTopMargin: 0 }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
describe('Markdown strings flowchart-elk (#4220)', () => {
|
||||||
|
describe('html labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b(\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`) --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('svg text labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Flowchart v2', () => {
|
describe('Flowchart v2', () => {
|
||||||
it('1: should render a simple flowchart', () => {
|
it('1: should render a simple flowchart', () => {
|
||||||
@@ -674,4 +674,170 @@ A --> B
|
|||||||
{ titleTopMargin: 0 }
|
{ titleTopMargin: 0 }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('3192: It should be possieble to render flowcharts with invisible edges', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: Simple flowchart with invisible edges
|
||||||
|
---
|
||||||
|
flowchart TD
|
||||||
|
A ~~~ B
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('4023: Should render html labels with images and-or text correctly', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart TD
|
||||||
|
B[<img src='https://mermaid.js.org/mermaid-logo.svg'>]
|
||||||
|
B-->C[<img src="https://mermaid.js.org/mermaid-logo.svg"> more text <img src='https://mermaid.js.org/mermaid-logo.svg'>]
|
||||||
|
B-->D(<img src='https://mermaid.js.org/mermaid-logo.svg'> some text)
|
||||||
|
B-->E(plain)`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
describe('Markdown strings flowchart (#4220)', () => {
|
||||||
|
describe('html labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": true}} }%%
|
||||||
|
flowchart LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('svg text labels', () => {
|
||||||
|
it('With styling and classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
A:::someclass --> B["\`The **cat** in the hat\`"]:::someclass
|
||||||
|
id1(Start)-->id2(Stop)
|
||||||
|
style id1 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
classDef someclass fill:#f96
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('With formatting in a node', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
a{"\`The **cat** in the hat\`"} -- 1o --> b
|
||||||
|
a -- 2o --> c
|
||||||
|
a -- 3o --> d
|
||||||
|
g --2i--> a
|
||||||
|
d --1i--> a
|
||||||
|
h --3i -->a
|
||||||
|
b --> d(The dog in the hog)
|
||||||
|
c --> d
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('New line in node and formatted edge label', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1)
|
||||||
|
NL\`") --"\`1o **bold**\`"--> c
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Wrapping long text with a new line', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
b("\`The dog in **the** hog.(1).. a a a a *very long text* about it
|
||||||
|
Word!
|
||||||
|
|
||||||
|
Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`") --> c
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Sub graphs and markdown strings', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||||
|
flowchart LR
|
||||||
|
subgraph "One"
|
||||||
|
a("\`The **cat**
|
||||||
|
in the hat\`") -- "1o" --> b{{"\`The **dog** in the hog\`"}}
|
||||||
|
end
|
||||||
|
subgraph "\`**Two**\`"
|
||||||
|
c("\`The **cat**
|
||||||
|
in the hat\`") -- "\`1o **ipa**\`" --> d("The dog in the hog")
|
||||||
|
end
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('Graph', () => {
|
describe('Graph', () => {
|
||||||
it('1: should render a simple flowchart no htmlLabels', () => {
|
it('1: should render a simple flowchart no htmlLabels', () => {
|
||||||
|
@@ -133,6 +133,24 @@ describe('Gantt diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should default to showing today marker', () => {
|
||||||
|
// This test only works if the environment thinks today is 1010-10-10
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title Show today marker (vertical line should be visible)
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %d
|
||||||
|
%% Should default to being on
|
||||||
|
%% todayMarker on
|
||||||
|
section Section1
|
||||||
|
Yesterday: 1010-10-09, 1d
|
||||||
|
Today: 1010-10-10, 1d
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('should hide today marker', () => {
|
it('should hide today marker', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -142,7 +160,8 @@ describe('Gantt diagram', () => {
|
|||||||
axisFormat %d
|
axisFormat %d
|
||||||
todayMarker off
|
todayMarker off
|
||||||
section Section1
|
section Section1
|
||||||
Today: 1, -1h
|
Yesterday: 1010-10-09, 1d
|
||||||
|
Today: 1010-10-10, 1d
|
||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
@@ -157,7 +176,8 @@ describe('Gantt diagram', () => {
|
|||||||
axisFormat %d
|
axisFormat %d
|
||||||
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
||||||
section Section1
|
section Section1
|
||||||
Today: 1, -1h
|
Yesterday: 1010-10-09, 1d
|
||||||
|
Today: 1010-10-10, 1d
|
||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
@@ -435,4 +455,39 @@ describe('Gantt diagram', () => {
|
|||||||
{ gantt: { topAxis: true } }
|
{ gantt: { topAxis: true } }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should render when compact is true', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
---
|
||||||
|
displayMode: compact
|
||||||
|
---
|
||||||
|
gantt
|
||||||
|
title GANTT compact
|
||||||
|
dateFormat HH:mm:ss
|
||||||
|
axisFormat %Hh%M
|
||||||
|
|
||||||
|
section DB Clean
|
||||||
|
Clean: 12:00:00, 10m
|
||||||
|
Clean: 12:30:00, 12m
|
||||||
|
Clean: 13:00:00, 8m
|
||||||
|
Clean: 13:30:00, 9m
|
||||||
|
Clean: 14:00:00, 13m
|
||||||
|
Clean: 14:30:00, 10m
|
||||||
|
Clean: 15:00:00, 11m
|
||||||
|
|
||||||
|
section Sessions
|
||||||
|
A: 12:00:00, 63m
|
||||||
|
B: 12:30:00, 12m
|
||||||
|
C: 13:05:00, 12m
|
||||||
|
D: 13:06:00, 33m
|
||||||
|
E: 13:15:00, 55m
|
||||||
|
F: 13:20:00, 12m
|
||||||
|
G: 13:32:00, 18m
|
||||||
|
H: 13:50:00, 20m
|
||||||
|
I: 14:10:00, 10m
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -223,5 +223,18 @@ mindmap
|
|||||||
shouldHaveRoot
|
shouldHaveRoot
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
describe('Markdown strings mindmaps (#4220)', () => {
|
||||||
|
it('Formatted label with linebreak and a wrapping label and emojis', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
id1[\`**Start** with
|
||||||
|
a second line 😎\`]
|
||||||
|
id2[\`The dog in **the** hog... a *very long text* about it
|
||||||
|
Word!\`]
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
/* The end */
|
/* The end */
|
||||||
});
|
});
|
||||||
|
@@ -75,4 +75,15 @@ describe('Pie Chart', () => {
|
|||||||
expect(svg).to.not.have.attr('style');
|
expect(svg).to.not.have.attr('style');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('should render a pie diagram when textPosition is set', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
pie
|
||||||
|
"Dogs": 50
|
||||||
|
"Cats": 25
|
||||||
|
`,
|
||||||
|
{ logLevel: 1, pie: { textPosition: 0.9 } }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/// <reference types="Cypress" />
|
/// <reference types="Cypress" />
|
||||||
|
|
||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
context('Sequence diagram', () => {
|
context('Sequence diagram', () => {
|
||||||
it('should render a sequence diagram with boxes', () => {
|
it('should render a sequence diagram with boxes', () => {
|
||||||
@@ -116,7 +116,11 @@ context('Sequence diagram', () => {
|
|||||||
loop Loopy
|
loop Loopy
|
||||||
Bob->>Alice: Pasten
|
Bob->>Alice: Pasten
|
||||||
end `,
|
end `,
|
||||||
{ wrap: true }
|
{
|
||||||
|
sequence: {
|
||||||
|
wrap: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
context('font settings', () => {
|
context('font settings', () => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('State diagram', () => {
|
describe('State diagram', () => {
|
||||||
it('v2 should render a simple info', () => {
|
it('v2 should render a simple info', () => {
|
||||||
@@ -530,7 +530,7 @@ stateDiagram-v2
|
|||||||
[*] --> A
|
[*] --> A
|
||||||
A --> B: test({ foo#colon; 'far' })
|
A --> B: test({ foo#colon; 'far' })
|
||||||
B --> [*]
|
B --> [*]
|
||||||
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
class B badBadEvent
|
class B badBadEvent
|
||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
@@ -543,14 +543,14 @@ stateDiagram-v2
|
|||||||
classDef notMoving fill:white
|
classDef notMoving fill:white
|
||||||
classDef movement font-style:italic;
|
classDef movement font-style:italic;
|
||||||
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
|
|
||||||
[*] --> Still
|
[*] --> Still
|
||||||
Still --> [*]
|
Still --> [*]
|
||||||
Still --> Moving
|
Still --> Moving
|
||||||
Moving --> Still
|
Moving --> Still
|
||||||
Moving --> Crash
|
Moving --> Crash
|
||||||
Crash --> [*]
|
Crash --> [*]
|
||||||
|
|
||||||
class Still notMoving
|
class Still notMoving
|
||||||
class Moving, Crash movement
|
class Moving, Crash movement
|
||||||
class Crash badBadEvent
|
class Crash badBadEvent
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
describe('State diagram', () => {
|
describe('State diagram', () => {
|
||||||
it('should render a simple state diagrams', () => {
|
it('should render a simple state diagrams', () => {
|
||||||
|
@@ -188,7 +188,7 @@ mindmap
|
|||||||
//import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
//import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
// import timeline from '../../packages/mermaid-timeline/src/detector';
|
// import timeline from '../../packages/mermaid-timeline/src/detector';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
// await mermaid.registerExternalDiagrams([]);
|
// await mermaid.registerExternalDiagrams([]);
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
// TODO: this file should be testing the ./mermaid.core.mjs file, as that's the file listed in the package.json file that users will use
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
|
||||||
let code = `flowchart LR
|
let code = `flowchart LR
|
||||||
Power_Supply --> Transmitter_A
|
Power_Supply --> Transmitter_A
|
||||||
@@ -49,13 +50,9 @@ mermaid.initialize({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
mermaid.render(
|
void (async () => {
|
||||||
'the-id-of-the-svg',
|
const { svg } = await mermaid.render('the-id-of-the-svg', code);
|
||||||
code,
|
console.log(svg);
|
||||||
(svg) => {
|
const elem = document.querySelector('#graph-to-be');
|
||||||
console.log(svg);
|
elem.innerHTML = svg;
|
||||||
const elem = document.querySelector('#graph-to-be');
|
})();
|
||||||
elem.innerHTML = svg;
|
|
||||||
}
|
|
||||||
// ,document.querySelector('#tmp')
|
|
||||||
);
|
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background: rgb(221, 208, 208);
|
background: rgb(221, 208, 208);
|
||||||
/*background:#333;*/
|
|
||||||
font-family: 'Arial';
|
font-family: 'Arial';
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
@@ -113,24 +112,16 @@ classE o-- classF : aggregation
|
|||||||
callback Shape "callbackFunction" "This is a tooltip for a callback"
|
callback Shape "callbackFunction" "This is a tooltip for a callback"
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
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,
|
|
||||||
// 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' },
|
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
|
||||||
// fontFamily: '"arial", sans-serif',
|
|
||||||
// themeVariables: {
|
|
||||||
// fontFamily: '"arial", sans-serif',
|
|
||||||
// },
|
|
||||||
curve: 'linear',
|
curve: 'linear',
|
||||||
securityLevel: 'loose',
|
securityLevel: 'loose',
|
||||||
});
|
});
|
||||||
|
@@ -125,7 +125,6 @@
|
|||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
function clickByFlow(elemName) {
|
function clickByFlow(elemName) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
@@ -162,6 +161,9 @@
|
|||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', logLevel: 1 });
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -59,8 +59,8 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
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';
|
||||||
|
@@ -125,8 +125,8 @@
|
|||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
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';
|
||||||
|
@@ -61,8 +61,8 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
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';
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
end
|
end
|
||||||
A --> B
|
A --> B
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
|
@@ -107,8 +107,8 @@ Note over Alice,Bob: Looks
|
|||||||
Note over Bob,Alice: Looks back
|
Note over Bob,Alice: Looks back
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -1,32 +1,12 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<!-- <meta charset="iso-8859-15"/> -->
|
|
||||||
<script src="./viewer.js" type="module"></script>
|
<script src="./viewer.js" type="module"></script>
|
||||||
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
|
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
<style>
|
<style>
|
||||||
body {
|
|
||||||
/* font-family: 'Mansalva', cursive;*/
|
|
||||||
/* font-family: 'Mansalva', cursive; */
|
|
||||||
/* font-family: 'arial'; */
|
|
||||||
/* font-family: "trebuchet ms", verdana, arial; */
|
|
||||||
}
|
|
||||||
/* div {
|
|
||||||
font-family: 'arial';
|
|
||||||
} */
|
|
||||||
/* .mermaid-main-font {
|
|
||||||
font-family: "trebuchet ms", verdana, arial;
|
|
||||||
font-family: var(--mermaid-font-family);
|
|
||||||
} */
|
|
||||||
/* :root {
|
|
||||||
--mermaid-font-family: '"trebuchet ms", verdana, arial';
|
|
||||||
--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive;
|
|
||||||
--mermaid-font-family: '"Lucida Console", Monaco, monospace';
|
|
||||||
} */
|
|
||||||
svg {
|
svg {
|
||||||
border: 2px solid darkred;
|
border: 2px solid darkred;
|
||||||
}
|
}
|
||||||
@@ -36,21 +16,5 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body></body>
|
||||||
<!-- <script src="./mermaid.js"></script> -->
|
|
||||||
<script>
|
|
||||||
// Notice startOnLoad=false
|
|
||||||
// This prevents default handling in mermaid from render before the e2e logic is applied
|
|
||||||
// mermaid.initialize({
|
|
||||||
// startOnLoad: false,
|
|
||||||
// useMaxWidth: true,
|
|
||||||
// // "themeCSS": ":root { --mermaid-font-family: \"trebuchet ms\", verdana, arial;}",
|
|
||||||
// // fontFamily: '\"trebuchet ms\", verdana, arial;'
|
|
||||||
// // fontFamily: '"Comic Sans MS", "Comic Sans", cursive'
|
|
||||||
// // fontFamily: '"Mansalva", cursive',
|
|
||||||
// // fontFamily: '"Noto Sans SC", sans-serif'
|
|
||||||
// fontFamily: '"Noto Sans SC", sans-serif'
|
|
||||||
// });
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
@@ -11,13 +11,13 @@ example-diagram
|
|||||||
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
||||||
<!-- <script type="module" src="./external-diagrams-mindmap.mjs" /> -->
|
<!-- <script type="module" src="./external-diagrams-mindmap.mjs" /> -->
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import exampleDiagram from '../../packages/mermaid-example-diagram/src/detector';
|
import exampleDiagram from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
|
||||||
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
|
||||||
await mermaid.registerExternalDiagrams([exampleDiagram]);
|
await mermaid.registerExternalDiagrams([exampleDiagram]);
|
||||||
await mermaid.initialize({ logLevel: 0 });
|
await mermaid.initialize({ logLevel: 0 });
|
||||||
await mermaid.initThrowsErrorsAsync();
|
await mermaid.run();
|
||||||
if (window.Cypress) {
|
if (window.Cypress) {
|
||||||
window.rendered = true;
|
window.rendered = true;
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,8 @@
|
|||||||
click a_a "http://www.aftonbladet.se" "apa"
|
click a_a "http://www.aftonbladet.se" "apa"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
|
46
cypress/platform/flow2.html
Normal file
46
cypress/platform/flow2.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<pre class="mermaid">
|
||||||
|
graph TB
|
||||||
|
subgraph One
|
||||||
|
a1-->a2-->a3
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
graph TB
|
||||||
|
a_a --> b_b:::apa --> c_c:::apa
|
||||||
|
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
||||||
|
class a_a apa;
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
graph TB
|
||||||
|
a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
|
||||||
|
a_a --> c --> d_d --> c_c
|
||||||
|
classDef apa fill:#f9f,stroke:#333,stroke-width:4px;
|
||||||
|
class a_a apa;
|
||||||
|
click a_a "http://www.aftonbladet.se" "apa"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
|
logLevel: 3,
|
||||||
|
flowchart: { curve: 'linear' },
|
||||||
|
gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorMargin: 50 },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -8,18 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<svg id="diagram"></svg>
|
<svg id="diagram"></svg>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
||||||
|
|
||||||
const graph = `
|
const graph = `
|
||||||
%%{ init: { "themeVariables" : { "textColor": "green;} #target { background-color: crimson }", "mainBkg": "#fff000" } } }%%
|
%%{ init: { "themeVariables" : { "textColor": "green;} #target { background-color: crimson }", "mainBkg": "#fff000" } } }%%
|
||||||
graph TD
|
graph TD
|
||||||
A[Goose]
|
A[Goose]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const diagram = document.getElementById('diagram');
|
const diagram = document.getElementById('diagram');
|
||||||
const svg = mermaid.render('diagram-svg', graph);
|
const { svg } = await mermaid.render('diagram-svg', graph);
|
||||||
diagram.innerHTML = svg;
|
diagram.innerHTML = svg;
|
||||||
if (window.Cypress) {
|
if (window.Cypress) {
|
||||||
window.rendered = true;
|
window.rendered = true;
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<svg id="diagram"></svg>
|
<svg id="diagram"></svg>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
mermaid.initialize({ startOnLoad: false, logLevel: 0 });
|
||||||
|
|
||||||
const graph = `
|
const graph = `
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const diagram = document.getElementById('diagram');
|
const diagram = document.getElementById('diagram');
|
||||||
const svg = mermaid.render('diagram-svg', graph);
|
const { svg } = await mermaid.render('diagram-svg', graph);
|
||||||
diagram.innerHTML = svg;
|
diagram.innerHTML = svg;
|
||||||
if (window.Cypress) {
|
if (window.Cypress) {
|
||||||
window.rendered = true;
|
window.rendered = true;
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -91,13 +91,11 @@
|
|||||||
diagram += 'le> * { background : red}</style>test</p>"]';
|
diagram += 'le> * { background : red}</style>test</p>"]';
|
||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
document.querySelector('#res').innerHTML = svg;
|
||||||
document.querySelector('#res').innerHTML = res;
|
if (window.Cypress) {
|
||||||
if (window.Cypress) {
|
window.rendered = true;
|
||||||
window.rendered = true;
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -43,8 +43,8 @@
|
|||||||
cssClass "BankAccount" customCss
|
cssClass "BankAccount" customCss
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -130,8 +130,8 @@
|
|||||||
commit
|
commit
|
||||||
merge main
|
merge main
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -98,8 +98,8 @@
|
|||||||
commit
|
commit
|
||||||
merge main
|
merge main
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -7,8 +7,8 @@
|
|||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
info
|
info
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
|
@@ -87,8 +87,8 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
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';
|
||||||
|
@@ -29,9 +29,9 @@
|
|||||||
}
|
}
|
||||||
.mermaid svg {
|
.mermaid svg {
|
||||||
/* font-size: 18px !important; */
|
/* font-size: 18px !important; */
|
||||||
background-color: #eee;
|
background-color: #efefef;
|
||||||
background-image: radial-gradient(#fff 1%, transparent 11%),
|
background-image: radial-gradient(#fff 51%, transparent 91%),
|
||||||
radial-gradient(#fff 1%, transparent 11%);
|
radial-gradient(#fff 51%, transparent 91%);
|
||||||
background-size: 20px 20px;
|
background-size: 20px 20px;
|
||||||
background-position: 0 0, 10px 10px;
|
background-position: 0 0, 10px 10px;
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
@@ -51,29 +51,103 @@
|
|||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 72px;
|
font-size: 72px;
|
||||||
}
|
}
|
||||||
|
/* tspan {
|
||||||
|
font-size: 6px !important;
|
||||||
|
} */
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
stateDiagram-v2
|
||||||
graph BT
|
[*] --> Still
|
||||||
a{The cat in the hat} -- 1o --> b
|
Still --> [*]
|
||||||
a -- 2o --> c
|
Still --> Moving
|
||||||
a -- 3o --> d
|
Moving --> Still
|
||||||
g --2i--> a
|
Moving --> Crash
|
||||||
d --1i--> a
|
Crash --> [*] </pre
|
||||||
h --3i -->a
|
>
|
||||||
b --> d(The dog in the hog)
|
<pre id="diagram" class="mermaid2">
|
||||||
c --> d
|
flowchart RL
|
||||||
|
subgraph "`one`"
|
||||||
|
a1 -- l1 --> a2
|
||||||
|
a1 -- l2 --> a2
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
flowchart RL
|
||||||
|
subgraph "`one`"
|
||||||
|
a1 -- l1 --> a2
|
||||||
|
a1 -- l2 --> a2
|
||||||
|
end
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
flowchart-elk TB
|
flowchart
|
||||||
a --> b
|
id["`A root with a long text that wraps to keep the node size in check. A root with a long text that wraps to keep the node size in check`"]</pre
|
||||||
a --> c
|
>
|
||||||
b --> d
|
<pre id="diagram" class="mermaid2">
|
||||||
c --> d
|
flowchart LR
|
||||||
|
A[A text that needs to be wrapped wraps to another line]
|
||||||
|
B[A text that needs to be<br/>wrapped wraps to another line]
|
||||||
|
C["`A text that needs to be wrapped to another line`"]</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart LR
|
||||||
|
C["`A text
|
||||||
|
that needs
|
||||||
|
to be wrapped
|
||||||
|
in another
|
||||||
|
way`"]
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
classDiagram-v2
|
||||||
|
note "I love this diagram!\nDo you love it?"
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
stateDiagram-v2
|
||||||
|
State1: The state with a note with minus - and plus + in it
|
||||||
|
note left of State1
|
||||||
|
Important information! You can write
|
||||||
|
notes with . and in them.
|
||||||
|
end note </pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
root
|
||||||
|
Child3(A node with an icon and with a long text that wraps to keep the node size in check)
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: {"theme": "forest"} }%%
|
||||||
|
mindmap
|
||||||
|
id1[**Start2**<br/>end]
|
||||||
|
id2[**Start2**<br />end]
|
||||||
|
%% Another comment
|
||||||
|
id3[**Start2**<br>end] %% Comment
|
||||||
|
id4[**Start2**<br >end<br >the very end]
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
id1["`**Start2**
|
||||||
|
second line 😎 with long text that is wrapping to the next line`"]
|
||||||
|
id2["`Child **with bold** text`"]
|
||||||
|
id3["`Children of which some
|
||||||
|
is using *italic type of* text`"]
|
||||||
|
id4[Child]
|
||||||
|
id5["`Child
|
||||||
|
Row
|
||||||
|
and another
|
||||||
|
`"]
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
id1("`**Root**`"]
|
||||||
|
id2["`A formatted text... with **bold** and *italics*`"]
|
||||||
|
id3[Regular labels works as usual]
|
||||||
|
id4["`Emojis and unicode works too: 🤓
|
||||||
|
शान्तिः سلام 和平 `"]
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
||||||
flowchart TB
|
flowchart TB
|
||||||
%% I could not figure out how to use double quotes in labels in Mermaid
|
%% I could not figure out how to use double quotes in labels in Mermaid
|
||||||
@@ -89,7 +163,7 @@ flowchart TB
|
|||||||
rom --> core2
|
rom --> core2
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph amd[AMD Latte GPU]
|
subgraph amd["`**AMD** Latte GPU`"]
|
||||||
mem[Memory & I/O Bridge]
|
mem[Memory & I/O Bridge]
|
||||||
dram[DRAM Controller]
|
dram[DRAM Controller]
|
||||||
edram[32 MB EDRAM MEM1]
|
edram[32 MB EDRAM MEM1]
|
||||||
@@ -128,6 +202,62 @@ flowchart TB
|
|||||||
rtc{{rtc}}
|
rtc{{rtc}}
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: {"flowchart": {"defaultRenderer": "elk", "htmlLabels": false}} }%%
|
||||||
|
flowchart TB
|
||||||
|
%% I could not figure out how to use double quotes in labels in Mermaid
|
||||||
|
subgraph ibm[IBM Espresso CPU]
|
||||||
|
core0[IBM PowerPC Broadway Core 0]
|
||||||
|
core1[IBM PowerPC Broadway Core 1]
|
||||||
|
core2[IBM PowerPC Broadway Core 2]
|
||||||
|
|
||||||
|
rom[16 KB ROM]
|
||||||
|
|
||||||
|
core0 --- core2
|
||||||
|
|
||||||
|
rom --> core2
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph amd["`**AMD** Latte GPU`"]
|
||||||
|
mem[Memory & I/O Bridge]
|
||||||
|
dram[DRAM Controller]
|
||||||
|
edram[32 MB EDRAM MEM1]
|
||||||
|
rom[512 B SEEPROM]
|
||||||
|
|
||||||
|
sata[SATA IF]
|
||||||
|
exi[EXI]
|
||||||
|
|
||||||
|
subgraph gx[GX]
|
||||||
|
sram[3 MB 1T-SRAM]
|
||||||
|
end
|
||||||
|
|
||||||
|
radeon[AMD Radeon R7xx GX2]
|
||||||
|
|
||||||
|
mem --- gx
|
||||||
|
mem --- radeon
|
||||||
|
|
||||||
|
rom --- mem
|
||||||
|
|
||||||
|
mem --- sata
|
||||||
|
mem --- exi
|
||||||
|
|
||||||
|
dram --- sata
|
||||||
|
dram --- exi
|
||||||
|
end
|
||||||
|
|
||||||
|
ddr3[2 GB DDR3 RAM MEM2]
|
||||||
|
|
||||||
|
mem --- ddr3
|
||||||
|
dram --- ddr3
|
||||||
|
edram --- ddr3
|
||||||
|
|
||||||
|
core1 --- mem
|
||||||
|
|
||||||
|
exi --- rtc
|
||||||
|
rtc{{rtc}}
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
@@ -263,21 +393,23 @@ mindmap
|
|||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
import example from '../../packages/mermaid-example-diagram/src/detector';
|
// import example from '../../packages/mermaid-example-diagram/src/mermaid-example-diagram.core.mjs';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
await mermaid.registerExternalDiagrams([example]);
|
// await mermaid.registerExternalDiagrams([example]);
|
||||||
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',
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
logLevel: 5,
|
logLevel: 0,
|
||||||
flowchart: {
|
flowchart: {
|
||||||
// defaultRenderer: 'elk',
|
// defaultRenderer: 'elk',
|
||||||
useMaxWidth: false,
|
useMaxWidth: false,
|
||||||
|
// htmlLabels: false,
|
||||||
htmlLabels: true,
|
htmlLabels: true,
|
||||||
},
|
},
|
||||||
|
// htmlLabels: false,
|
||||||
gantt: {
|
gantt: {
|
||||||
useMaxWidth: false,
|
useMaxWidth: false,
|
||||||
},
|
},
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
// import mermaid from './mermaid.esm.mjs';
|
// import mermaid from './mermaid.esm.mjs';
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
import mermaid from '../../packages/mermaid/dist/mermaid.esm.mjs';
|
||||||
// import mermaidMindmap from './mermaid-mindmap.esm.mjs';
|
// import mermaidMindmap from './mermaid-mindmap.esm.mjs';
|
||||||
|
|
||||||
// import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';
|
// import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';
|
||||||
|
@@ -59,7 +59,7 @@ A-->B
|
|||||||
>
|
>
|
||||||
<script src="./packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script>
|
<script src="./packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script>
|
||||||
<script src="./packages/mermaid-mindmap/dist/mermaid-example-diagram-detector.js"></script>
|
<script src="./packages/mermaid-mindmap/dist/mermaid-example-diagram-detector.js"></script>
|
||||||
<script src="./packages/mermaid/dist/mermaid.js"></script>
|
<script src="./packages/mermaid/dist/mermaid.esm.mjs"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
<script src="http://localhost:9000/mermaid.js"></script>
|
|
||||||
<script>
|
|
||||||
mermaid.initialize({
|
|
||||||
theme: 'base',
|
|
||||||
themeVariables: {},
|
|
||||||
startOnLoad: true,
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Example</h1>
|
<h1>Example</h1>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
@@ -26,4 +16,12 @@ sequenceDiagram
|
|||||||
Note left of Ernie: Cookies are good
|
Note left of Ernie: Cookies are good
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from '/mermaid.esm.mjs';
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'base',
|
||||||
|
themeVariables: {},
|
||||||
|
startOnLoad: true,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -9,19 +9,19 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="graph"></div>
|
<div id="graph"></div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.init({ startOnLoad: false });
|
await mermaid.initialize({ startOnLoad: false });
|
||||||
|
await mermaid.run();
|
||||||
|
|
||||||
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
await mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
||||||
try {
|
try {
|
||||||
console.log('rendering');
|
console.log('rendering');
|
||||||
mermaid.mermaidAPI.render('graphDiv', `>`);
|
await mermaid.mermaidAPI.render('graphDiv', `>`);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => {
|
const { svg } = await mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`);
|
||||||
document.getElementById('graph').innerHTML = html;
|
document.getElementById('graph').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -9,20 +9,20 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="graph"></div>
|
<div id="graph"></div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.init({ startOnLoad: false });
|
mermaid.initialize({ startOnLoad: false });
|
||||||
mermaid.mermaidAPI.initialize();
|
mermaid.mermaidAPI.initialize();
|
||||||
|
|
||||||
rerender('XMas');
|
async function rerender(text) {
|
||||||
|
|
||||||
function rerender(text) {
|
|
||||||
const graphText = `graph TD
|
const graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`;
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
const graph = mermaid.mermaidAPI.render('id', graphText);
|
const { svg } = await mermaid.mermaidAPI.render('id', graphText);
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', svg);
|
||||||
document.getElementById('graph').innerHTML = graph;
|
document.getElementById('graph').innerHTML = svg;
|
||||||
}
|
}
|
||||||
|
window.rerender = rerender;
|
||||||
|
await rerender('XMas');
|
||||||
</script>
|
</script>
|
||||||
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -313,8 +313,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -308,8 +308,8 @@ gitGraph
|
|||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -308,8 +308,8 @@ gitGraph
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -301,8 +301,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -305,8 +305,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -305,8 +305,8 @@ requirementDiagram
|
|||||||
merge release
|
merge release
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -1,255 +1,17 @@
|
|||||||
<html>
|
<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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<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; */
|
|
||||||
background-color: #eee;
|
|
||||||
background-image: radial-gradient(#fff 1%, transparent 11%),
|
|
||||||
radial-gradient(#fff 1%, transparent 11%);
|
|
||||||
background-size: 20px 20px;
|
|
||||||
background-position: 0 0, 10px 10px;
|
|
||||||
background-repeat: repeat;
|
|
||||||
}
|
|
||||||
.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>
|
<body>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
|
||||||
graph TB
|
graph TB
|
||||||
a --> b
|
a --> b
|
||||||
a --> c
|
a --> c
|
||||||
b --> d
|
b --> d
|
||||||
c --> d
|
c --> d
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid">
|
|
||||||
flowchart-elk LR
|
|
||||||
subgraph A
|
|
||||||
a -->b
|
|
||||||
end
|
|
||||||
subgraph B
|
|
||||||
b
|
|
||||||
end
|
|
||||||
</pre>
|
|
||||||
<pre id="diagram" class="mermaid">
|
|
||||||
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
|
||||||
flowchart TB
|
|
||||||
%% I could not figure out how to use double quotes in labels in Mermaid
|
|
||||||
subgraph ibm[IBM Espresso CPU]
|
|
||||||
core0[IBM PowerPC Broadway Core 0]
|
|
||||||
core1[IBM PowerPC Broadway Core 1]
|
|
||||||
core2[IBM PowerPC Broadway Core 2]
|
|
||||||
|
|
||||||
rom[16 KB ROM]
|
<div id="d2"></div>
|
||||||
|
|
||||||
core0 --- core2
|
|
||||||
|
|
||||||
rom --> core2
|
|
||||||
end
|
|
||||||
|
|
||||||
subgraph amd[AMD Latte GPU]
|
|
||||||
mem[Memory & I/O Bridge]
|
|
||||||
dram[DRAM Controller]
|
|
||||||
edram[32 MB EDRAM MEM1]
|
|
||||||
rom[512 B SEEPROM]
|
|
||||||
|
|
||||||
sata[SATA IF]
|
|
||||||
exi[EXI]
|
|
||||||
|
|
||||||
subgraph gx[GX]
|
|
||||||
sram[3 MB 1T-SRAM]
|
|
||||||
end
|
|
||||||
|
|
||||||
radeon[AMD Radeon R7xx GX2]
|
|
||||||
|
|
||||||
mem --- gx
|
|
||||||
mem --- radeon
|
|
||||||
|
|
||||||
rom --- mem
|
|
||||||
|
|
||||||
mem --- sata
|
|
||||||
mem --- exi
|
|
||||||
|
|
||||||
dram --- sata
|
|
||||||
dram --- exi
|
|
||||||
end
|
|
||||||
|
|
||||||
ddr3[2 GB DDR3 RAM MEM2]
|
|
||||||
|
|
||||||
mem --- ddr3
|
|
||||||
dram --- ddr3
|
|
||||||
edram --- ddr3
|
|
||||||
|
|
||||||
core1 --- mem
|
|
||||||
|
|
||||||
exi --- rtc
|
|
||||||
rtc{{rtc}}
|
|
||||||
</pre
|
|
||||||
>
|
|
||||||
<br />
|
|
||||||
<pre id="diagram" class="mermaid">
|
|
||||||
flowchart TB
|
|
||||||
%% I could not figure out how to use double quotes in labels in Mermaid
|
|
||||||
subgraph ibm[IBM Espresso CPU]
|
|
||||||
core0[IBM PowerPC Broadway Core 0]
|
|
||||||
core1[IBM PowerPC Broadway Core 1]
|
|
||||||
core2[IBM PowerPC Broadway Core 2]
|
|
||||||
|
|
||||||
rom[16 KB ROM]
|
|
||||||
|
|
||||||
core0 --- core2
|
|
||||||
|
|
||||||
rom --> core2
|
|
||||||
end
|
|
||||||
|
|
||||||
subgraph amd[AMD Latte GPU]
|
|
||||||
mem[Memory & I/O Bridge]
|
|
||||||
dram[DRAM Controller]
|
|
||||||
edram[32 MB EDRAM MEM1]
|
|
||||||
rom[512 B SEEPROM]
|
|
||||||
|
|
||||||
sata[SATA IF]
|
|
||||||
exi[EXI]
|
|
||||||
|
|
||||||
subgraph gx[GX]
|
|
||||||
sram[3 MB 1T-SRAM]
|
|
||||||
end
|
|
||||||
|
|
||||||
radeon[AMD Radeon R7xx GX2]
|
|
||||||
|
|
||||||
mem --- gx
|
|
||||||
mem --- radeon
|
|
||||||
|
|
||||||
rom --- mem
|
|
||||||
|
|
||||||
mem --- sata
|
|
||||||
mem --- exi
|
|
||||||
|
|
||||||
dram --- sata
|
|
||||||
dram --- exi
|
|
||||||
end
|
|
||||||
|
|
||||||
ddr3[2 GB DDR3 RAM MEM2]
|
|
||||||
|
|
||||||
mem --- ddr3
|
|
||||||
dram --- ddr3
|
|
||||||
edram --- ddr3
|
|
||||||
|
|
||||||
core1 --- mem
|
|
||||||
|
|
||||||
exi --- rtc
|
|
||||||
rtc{{rtc}}
|
|
||||||
</pre
|
|
||||||
>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<pre id="diagram" class="mermaid2">
|
|
||||||
flowchart LR
|
|
||||||
B1 --be be--x B2
|
|
||||||
B1 --bo bo--o B3
|
|
||||||
subgraph Ugge
|
|
||||||
B2
|
|
||||||
B3
|
|
||||||
subgraph inner
|
|
||||||
B4
|
|
||||||
B5
|
|
||||||
end
|
|
||||||
subgraph inner2
|
|
||||||
subgraph deeper
|
|
||||||
C4
|
|
||||||
C5
|
|
||||||
end
|
|
||||||
C6
|
|
||||||
end
|
|
||||||
|
|
||||||
B4 --> C4
|
|
||||||
|
|
||||||
B3 -- X --> B4
|
|
||||||
B2 --> inner
|
|
||||||
|
|
||||||
C4 --> C5
|
|
||||||
end
|
|
||||||
|
|
||||||
subgraph outer
|
|
||||||
B6
|
|
||||||
end
|
|
||||||
B6 --> B5
|
|
||||||
</pre
|
|
||||||
>
|
|
||||||
<pre id="diagram" class="mermaid2">
|
|
||||||
sequenceDiagram
|
|
||||||
Customer->>+Stripe: Makes a payment request
|
|
||||||
Stripe->>+Bank: Forwards the payment request to the bank
|
|
||||||
Bank->>+Customer: Asks for authorization
|
|
||||||
Customer->>+Bank: Provides authorization
|
|
||||||
Bank->>+Stripe: Sends a response with payment details
|
|
||||||
Stripe->>+Merchant: Sends a notification of payment receipt
|
|
||||||
Merchant->>+Stripe: Confirms the payment
|
|
||||||
Stripe->>+Customer: Sends a confirmation of payment
|
|
||||||
Customer->>+Merchant: Receives goods or services
|
|
||||||
</pre
|
|
||||||
>
|
|
||||||
<pre id="diagram" class="mermaid2">
|
|
||||||
gantt
|
|
||||||
title Style today marker (vertical line should be 5px wide and half-transparent blue)
|
|
||||||
dateFormat YYYY-MM-DD
|
|
||||||
axisFormat %d
|
|
||||||
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
|
||||||
section Section1
|
|
||||||
Today: 1, -1h
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<!-- <div id="cy"></div> -->
|
|
||||||
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
|
||||||
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
|
||||||
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
|
||||||
<!-- <script src="./mermaid.js"></script> -->
|
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
import mermaid from '/mermaid.esm.mjs';
|
||||||
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
|
||||||
import mermaid from '../../packages/mermaid/src/mermaid';
|
|
||||||
await mermaid.registerExternalDiagrams([mindmap]);
|
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -274,6 +36,11 @@ sequenceDiagram
|
|||||||
console.error('In parse error:');
|
console.error('In parse error:');
|
||||||
console.error(err);
|
console.error(err);
|
||||||
};
|
};
|
||||||
|
const value = `graph TD\nHello --> World`;
|
||||||
|
const el = document.getElementById('d2');
|
||||||
|
const { svg } = await mermaid.render('d22', value);
|
||||||
|
console.log(svg);
|
||||||
|
el.innerHTML = svg;
|
||||||
// mermaid.test1('first_slow', 1200).then((r) => console.info(r));
|
// mermaid.test1('first_slow', 1200).then((r) => console.info(r));
|
||||||
// mermaid.test1('second_fast', 200).then((r) => console.info(r));
|
// mermaid.test1('second_fast', 200).then((r) => console.info(r));
|
||||||
// mermaid.test1('third_fast', 200).then((r) => console.info(r));
|
// mermaid.test1('third_fast', 200).then((r) => console.info(r));
|
||||||
|
@@ -34,8 +34,8 @@
|
|||||||
9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
|
9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
|
||||||
style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
|
style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
|
@@ -120,8 +120,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
|
@@ -25,8 +25,8 @@
|
|||||||
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
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
logLevel: 3,
|
logLevel: 3,
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
A --> B --> C
|
A --> B --> C
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
function showFullFirstSquad(elemName) {
|
function showFullFirstSquad(elemName) {
|
||||||
console.log('show ' + elemName);
|
console.log('show ' + elemName);
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import mermaid2 from '../../packages/mermaid/src/mermaid';
|
import mermaid2 from './mermaid.esm.mjs';
|
||||||
import externalExample from '../../packages/mermaid-example-diagram/src/detector';
|
import externalExample from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
|
||||||
|
|
||||||
function b64ToUtf8(str) {
|
function b64ToUtf8(str) {
|
||||||
return decodeURIComponent(escape(window.atob(str)));
|
return decodeURIComponent(escape(window.atob(str)));
|
||||||
@@ -46,8 +46,7 @@ const contentLoaded = async function () {
|
|||||||
|
|
||||||
await mermaid2.registerExternalDiagrams([externalExample]);
|
await mermaid2.registerExternalDiagrams([externalExample]);
|
||||||
mermaid2.initialize(graphObj.mermaid);
|
mermaid2.initialize(graphObj.mermaid);
|
||||||
await mermaid2.init();
|
await mermaid2.run();
|
||||||
markRendered();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ function merge(current, update) {
|
|||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
const contentLoadedApi = function () {
|
const contentLoadedApi = async function () {
|
||||||
let pos = document.location.href.indexOf('?graph=');
|
let pos = document.location.href.indexOf('?graph=');
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
pos = pos + 7;
|
pos = pos + 7;
|
||||||
@@ -102,41 +101,27 @@ const contentLoadedApi = function () {
|
|||||||
mermaid2.initialize(cnf);
|
mermaid2.initialize(cnf);
|
||||||
|
|
||||||
for (let i = 0; i < numCodes; i++) {
|
for (let i = 0; i < numCodes; i++) {
|
||||||
mermaid2.render(
|
const { svg, bindFunctions } = await mermaid2.render(
|
||||||
'newid' + i,
|
'newid' + i,
|
||||||
graphObj.code[i],
|
graphObj.code[i],
|
||||||
(svgCode, bindFunctions) => {
|
|
||||||
div.innerHTML = svgCode;
|
|
||||||
|
|
||||||
bindFunctions(div);
|
|
||||||
},
|
|
||||||
divs[i]
|
divs[i]
|
||||||
);
|
);
|
||||||
|
div.innerHTML = svg;
|
||||||
|
bindFunctions(div);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.id = 'block';
|
div.id = 'block';
|
||||||
div.className = 'mermaid';
|
div.className = 'mermaid';
|
||||||
// div.innerHTML = graphObj.code
|
|
||||||
console.warn('graphObj.mermaid', graphObj.mermaid);
|
console.warn('graphObj.mermaid', graphObj.mermaid);
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
mermaid2.initialize(graphObj.mermaid);
|
mermaid2.initialize(graphObj.mermaid);
|
||||||
|
|
||||||
mermaid2.render(
|
const { svg, bindFunctions } = await mermaid2.render('newid', graphObj.code, div);
|
||||||
'newid',
|
div.innerHTML = svg;
|
||||||
graphObj.code,
|
bindFunctions(div);
|
||||||
(svgCode, bindFunctions) => {
|
|
||||||
div.innerHTML = svgCode;
|
|
||||||
|
|
||||||
if (bindFunctions) {
|
|
||||||
bindFunctions(div);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
div
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
markRendered();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
@@ -148,10 +133,10 @@ if (typeof document !== 'undefined') {
|
|||||||
function () {
|
function () {
|
||||||
if (this.location.href.match('xss.html')) {
|
if (this.location.href.match('xss.html')) {
|
||||||
this.console.log('Using api');
|
this.console.log('Using api');
|
||||||
contentLoadedApi();
|
void contentLoadedApi().finally(markRendered);
|
||||||
} else {
|
} else {
|
||||||
this.console.log('Not using api');
|
this.console.log('Not using api');
|
||||||
void contentLoaded();
|
void contentLoaded().finally(markRendered);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
|
@@ -33,8 +33,8 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -104,10 +104,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -102,10 +102,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -102,10 +102,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -102,10 +102,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -104,10 +104,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -103,10 +103,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -102,10 +102,9 @@
|
|||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
// console.log(diagram);
|
// console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -102,10 +102,9 @@
|
|||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
// console.log(diagram);
|
// console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -101,10 +101,9 @@
|
|||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
// console.log(diagram);
|
// console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -103,10 +103,9 @@ class Shape{
|
|||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
// console.log(diagram);
|
// console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -48,8 +48,8 @@
|
|||||||
Alice->>Bob: Hi Bob
|
Alice->>Bob: Hi Bob
|
||||||
Bob->>Alice: Hi Alice
|
Bob->>Alice: Hi Alice
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
const handler = setInterval(() => {
|
const handler = setInterval(() => {
|
||||||
cnt++;
|
cnt++;
|
||||||
a = {};
|
a = {};
|
||||||
if (typeof a.polluted !== 'undefined') {
|
if (a.polluted !== undefined) {
|
||||||
clearInterval(handler);
|
clearInterval(handler);
|
||||||
xssAttack();
|
xssAttack();
|
||||||
}
|
}
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -101,10 +101,8 @@ A --> B["<a href='javasc`;
|
|||||||
diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
// console.log(res);
|
document.querySelector('#res').innerHTML = svg;
|
||||||
document.querySelector('#res').innerHTML = res;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -97,14 +97,12 @@
|
|||||||
// A --> B["<a href='javascript`;
|
// A --> B["<a href='javascript`;
|
||||||
// diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
// diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
||||||
let diagram = ` graph TD
|
let diagram = ` graph TD
|
||||||
A --> B["<a href='javasc`;
|
A --> B["<a href='javasc`;
|
||||||
diagram += `ript#9;t#colon;xssAttack()'>AAA</a>"]`;
|
diagram += `ript#9;t#colon;xssAttack()'>AAA</a>"]`;
|
||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
document.querySelector('#res').innerHTML = svg;
|
||||||
document.querySelector('#res').innerHTML = res;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
graph TD
|
graph TD
|
||||||
A --> B["<a href='javascript#9;t#colon;alert(document.location)'>AAA</a>"]
|
A --> B["<a href='javascript#9;t#colon;alert(document.location)'>AAA</a>"]
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({ startOnLoad: true });
|
mermaid.initialize({ startOnLoad: true });
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -36,8 +36,8 @@
|
|||||||
graph LR
|
graph LR
|
||||||
A --> B
|
A --> B
|
||||||
</pre>
|
</pre>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -95,9 +95,8 @@
|
|||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -99,10 +99,9 @@
|
|||||||
|
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
mermaid.render('diagram', diagram, (res) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
<div id="diagram" class="mermaid"></div>
|
<div id="diagram" class="mermaid"></div>
|
||||||
<div id="res" class=""></div>
|
<div id="res" class=""></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script type="module">
|
||||||
<script>
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
@@ -97,10 +97,9 @@
|
|||||||
// 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) => {
|
const { svg } = await mermaid.render('diagram', diagram);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
document.querySelector('#res').innerHTML = res;
|
document.querySelector('#res').innerHTML = svg;
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user