mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-06 17:16:43 +02:00
Compare commits
1120 Commits
minmaps
...
release/9.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
97614b8af5 | ||
![]() |
343e48302e | ||
![]() |
aef989fe03 | ||
![]() |
0c38f20281 | ||
![]() |
eed427b4ac | ||
![]() |
027296df68 | ||
![]() |
a956be7bbf | ||
![]() |
e0286be8d2 | ||
![]() |
74df4a7a68 | ||
![]() |
38a84a7fe0 | ||
![]() |
5e864c3b9b | ||
![]() |
b5a4cc0e17 | ||
![]() |
82f7e1b754 | ||
![]() |
580903051f | ||
![]() |
ce037a84ca | ||
![]() |
7f254e37e9 | ||
![]() |
d562a81019 | ||
![]() |
6a045db83c | ||
![]() |
563896400b | ||
![]() |
73ee9e9a92 | ||
![]() |
923ddc8309 | ||
![]() |
64096b22dc | ||
![]() |
84d563584f | ||
![]() |
ac67794fb2 | ||
![]() |
98b2148352 | ||
![]() |
b3e509b7d4 | ||
![]() |
8d6d90021a | ||
![]() |
71e5a53172 | ||
![]() |
a75cacd4a4 | ||
![]() |
c2ec63d4fd | ||
![]() |
7ecaaaf46f | ||
![]() |
4900647bf0 | ||
![]() |
df10d64989 | ||
![]() |
b9bed14cda | ||
![]() |
cd007cabb5 | ||
![]() |
cb1a20264d | ||
![]() |
7179f1bcba | ||
![]() |
b35e4a8c52 | ||
![]() |
a89cb9f0d6 | ||
![]() |
8b4426aebf | ||
![]() |
003997372e | ||
![]() |
61f33567ae | ||
![]() |
9fb6f1998f | ||
![]() |
19e3624e89 | ||
![]() |
be332cfdef | ||
![]() |
c51f6df82c | ||
![]() |
dc0a46f742 | ||
![]() |
c76728b423 | ||
![]() |
0aa7da261f | ||
![]() |
5e6aac4377 | ||
![]() |
52bd5181f9 | ||
![]() |
49ce5222c9 | ||
![]() |
df1e9c4117 | ||
![]() |
5c14df0aeb | ||
![]() |
8af5c4c341 | ||
![]() |
f7756ccc00 | ||
![]() |
3066a4b43a | ||
![]() |
26e9b1790b | ||
![]() |
c256a6b887 | ||
![]() |
bd1449a0d3 | ||
![]() |
c9833dcd79 | ||
![]() |
6792bb94b7 | ||
![]() |
b36e5d0d3b | ||
![]() |
ead4037963 | ||
![]() |
a28f6bf80c | ||
![]() |
fb6ba231d0 | ||
![]() |
e4491136c3 | ||
![]() |
e7451e7a4e | ||
![]() |
816f2f512e | ||
![]() |
76c3716b2d | ||
![]() |
2f1a521db6 | ||
![]() |
8f4caa4537 | ||
![]() |
b26cdb3e46 | ||
![]() |
de8928b2d9 | ||
![]() |
e5b33087f3 | ||
![]() |
bc56a7d4f1 | ||
![]() |
80903e427c | ||
![]() |
7b67f5783e | ||
![]() |
023f2354cd | ||
![]() |
7ef71cc04d | ||
![]() |
3cd15cdcf2 | ||
![]() |
e865368649 | ||
![]() |
be818ad57f | ||
![]() |
ca22e85e55 | ||
![]() |
652a42fe1a | ||
![]() |
3aeef7b846 | ||
![]() |
250f1f9687 | ||
![]() |
5b9839cbd0 | ||
![]() |
afe3f593e1 | ||
![]() |
e573be4afd | ||
![]() |
549483d19b | ||
![]() |
8a485c3c88 | ||
![]() |
96dedc7b5e | ||
![]() |
9629c8d8d6 | ||
![]() |
7e8c1b0393 | ||
![]() |
e4bdfee85a | ||
![]() |
c0f9b3c00b | ||
![]() |
01a535b8e0 | ||
![]() |
3c12e66f73 | ||
![]() |
fba3f8481e | ||
![]() |
f0e3bcc37b | ||
![]() |
ae7c9475ef | ||
![]() |
d320e788c7 | ||
![]() |
376d1a583c | ||
![]() |
ea3d7bc594 | ||
![]() |
ded83b2ce7 | ||
![]() |
1c8c69f8db | ||
![]() |
4d3f151cf0 | ||
![]() |
8f8ae64ced | ||
![]() |
b93ce24c3d | ||
![]() |
0a4a3bda16 | ||
![]() |
874f4c0641 | ||
![]() |
60175cd84f | ||
![]() |
ac6d325a00 | ||
![]() |
e44e1210e2 | ||
![]() |
05d1fc44e8 | ||
![]() |
075f55418b | ||
![]() |
164b9bc2cb | ||
![]() |
16540f3005 | ||
![]() |
6c862565aa | ||
![]() |
ee056e1ac3 | ||
![]() |
0476bdc68f | ||
![]() |
242a508d50 | ||
![]() |
9ca2e0c5fc | ||
![]() |
9acd562b9e | ||
![]() |
3238ee4c2e | ||
![]() |
7b5bebd9c4 | ||
![]() |
b67c023b0a | ||
![]() |
e28a766e7d | ||
![]() |
3f7f04e02f | ||
![]() |
68609fd8d0 | ||
![]() |
ce6f62e24e | ||
![]() |
094b97de12 | ||
![]() |
0e3dadc53c | ||
![]() |
1fca5131c3 | ||
![]() |
fcb41e4579 | ||
![]() |
a56d0bc36b | ||
![]() |
e6fd3bfb28 | ||
![]() |
568a3329e1 | ||
![]() |
1968d1bb28 | ||
![]() |
117f0ab6da | ||
![]() |
64a935515c | ||
![]() |
e6befbaa3f | ||
![]() |
ae7833bdfa | ||
![]() |
412eec06d4 | ||
![]() |
e659601e03 | ||
![]() |
10cb3e26d5 | ||
![]() |
75b19eaa0c | ||
![]() |
ef51111b86 | ||
![]() |
36c0a30c50 | ||
![]() |
f233ce1fed | ||
![]() |
d13c1bce47 | ||
![]() |
967d3bbb60 | ||
![]() |
06c357916e | ||
![]() |
406d663bff | ||
![]() |
78443861a6 | ||
![]() |
34aef1a6f5 | ||
![]() |
7d0cec0a49 | ||
![]() |
d8c3f8fc16 | ||
![]() |
d8aa44f0c5 | ||
![]() |
2c88c6b526 | ||
![]() |
8ed1ad5a8e | ||
![]() |
c23cd49322 | ||
![]() |
a58b41a38e | ||
![]() |
03c5bc1129 | ||
![]() |
df42f96b5a | ||
![]() |
c535b10534 | ||
![]() |
d75f70f808 | ||
![]() |
1da20d7aa5 | ||
![]() |
913ba34386 | ||
![]() |
dbfb29de27 | ||
![]() |
69928e3ede | ||
![]() |
22b66193dc | ||
![]() |
895c16a793 | ||
![]() |
b375f79b9c | ||
![]() |
b220718b96 | ||
![]() |
0f337d654f | ||
![]() |
3beb828988 | ||
![]() |
469bdcef2f | ||
![]() |
72d9e87284 | ||
![]() |
2baa36fd1f | ||
![]() |
4859947eab | ||
![]() |
fca58f5942 | ||
![]() |
f17f81d12c | ||
![]() |
86946c9bfd | ||
![]() |
95e4443ff2 | ||
![]() |
81aee3554e | ||
![]() |
fd5780d5a1 | ||
![]() |
8e7dd1d148 | ||
![]() |
14ea1430d8 | ||
![]() |
e46e918b23 | ||
![]() |
61fdca58a1 | ||
![]() |
a6ea439ef3 | ||
![]() |
5a8975a4dd | ||
![]() |
56e28a7f40 | ||
![]() |
5705515483 | ||
![]() |
612f9327e9 | ||
![]() |
24bd36b087 | ||
![]() |
1e3d76a0aa | ||
![]() |
7670ada9ac | ||
![]() |
bb9b0b015e | ||
![]() |
521a30dcd7 | ||
![]() |
3e64b439ce | ||
![]() |
1bf636d697 | ||
![]() |
f019250494 | ||
![]() |
528facf88d | ||
![]() |
7855edae6b | ||
![]() |
33f78a5429 | ||
![]() |
60d0185698 | ||
![]() |
2743b72a87 | ||
![]() |
61ef4692b0 | ||
![]() |
7b13b489c2 | ||
![]() |
d6ddf9568e | ||
![]() |
6ab7eb55cb | ||
![]() |
ec026eaf82 | ||
![]() |
c7f085a138 | ||
![]() |
32a8061cc2 | ||
![]() |
d6fad1bbd8 | ||
![]() |
e2b05d3cf6 | ||
![]() |
1495baac2c | ||
![]() |
ac5a1b4501 | ||
![]() |
ff7ed7f49f | ||
![]() |
333b974f10 | ||
![]() |
01039c574c | ||
![]() |
4e70f327c4 | ||
![]() |
fefcc43dd4 | ||
![]() |
2141057ab4 | ||
![]() |
54bb2ef00e | ||
![]() |
992d1623a7 | ||
![]() |
78dd03dcdb | ||
![]() |
9f2d29b68b | ||
![]() |
d841ad8f3e | ||
![]() |
3fb0b2792e | ||
![]() |
bbc4e90c89 | ||
![]() |
5735efacbe | ||
![]() |
774512df57 | ||
![]() |
152994047e | ||
![]() |
d194e78677 | ||
![]() |
16b51800d0 | ||
![]() |
2176bef537 | ||
![]() |
9f9c95b0b3 | ||
![]() |
3f0b13a131 | ||
![]() |
3c44379af9 | ||
![]() |
1d529d80d1 | ||
![]() |
89451ca640 | ||
![]() |
fac3a4d29b | ||
![]() |
d7610dda8f | ||
![]() |
dfa1d26952 | ||
![]() |
32fcea3bdd | ||
![]() |
a975c8c9cd | ||
![]() |
e4622ba06e | ||
![]() |
6fb9b3b353 | ||
![]() |
07d8684fc7 | ||
![]() |
1b0ea981f9 | ||
![]() |
72a3cff13e | ||
![]() |
14f7756fdb | ||
![]() |
e97bef2ff7 | ||
![]() |
e4c9aa198e | ||
![]() |
76e9e07370 | ||
![]() |
ae7fd777a7 | ||
![]() |
d666981599 | ||
![]() |
f0b8657423 | ||
![]() |
ae25a08fe3 | ||
![]() |
2b7aa3f99d | ||
![]() |
e7b4f7f6ca | ||
![]() |
de795a915e | ||
![]() |
e59b830d74 | ||
![]() |
0b01c3376d | ||
![]() |
6c2647e8cf | ||
![]() |
e1a501c66b | ||
![]() |
4f169dd2b8 | ||
![]() |
23a44952ac | ||
![]() |
7656916cef | ||
![]() |
88357ba751 | ||
![]() |
98fc866444 | ||
![]() |
c6fce2431b | ||
![]() |
9b27396344 | ||
![]() |
90d9724d1a | ||
![]() |
1c9a559362 | ||
![]() |
b1dd0008bc | ||
![]() |
ebf76e3d1f | ||
![]() |
033201ff1f | ||
![]() |
af212331ef | ||
![]() |
59fdaa3b53 | ||
![]() |
f2a85eafac | ||
![]() |
9b547edbe9 | ||
![]() |
48518a56c7 | ||
![]() |
1a767ee492 | ||
![]() |
b2489523f2 | ||
![]() |
7553827985 | ||
![]() |
792c1a8320 | ||
![]() |
963a1f1eb1 | ||
![]() |
4dadf8a72d | ||
![]() |
fdf261bda3 | ||
![]() |
f2ee20fdf5 | ||
![]() |
7a086890fd | ||
![]() |
49ca2e3588 | ||
![]() |
c5653156d9 | ||
![]() |
2cce562bc4 | ||
![]() |
f0aea0e6af | ||
![]() |
24560b7d13 | ||
![]() |
d451a0c508 | ||
![]() |
96996d0fba | ||
![]() |
4124d186d0 | ||
![]() |
b68fee7e65 | ||
![]() |
4863d0d29d | ||
![]() |
a1e4ffb3f0 | ||
![]() |
c7471f1755 | ||
![]() |
abc6ee049d | ||
![]() |
4f1b26fd76 | ||
![]() |
accba3f408 | ||
![]() |
bfe3f309d2 | ||
![]() |
f036d58ec3 | ||
![]() |
bcbf68b7e1 | ||
![]() |
1e30e33ad3 | ||
![]() |
4b5021c0cc | ||
![]() |
41033008ec | ||
![]() |
cd0eae2807 | ||
![]() |
8cb6fbfab0 | ||
![]() |
f884b745dc | ||
![]() |
6f2b0c43cb | ||
![]() |
650ee31cd1 | ||
![]() |
931d56947a | ||
![]() |
36cf7e0601 | ||
![]() |
ff1d56e9b5 | ||
![]() |
5e98e99f86 | ||
![]() |
316f612bde | ||
![]() |
2a5c2b58de | ||
![]() |
e8703a59ec | ||
![]() |
3a6dd61f65 | ||
![]() |
bfbb7996e9 | ||
![]() |
1f147b6b63 | ||
![]() |
e302ee383a | ||
![]() |
527a3df083 | ||
![]() |
b949da9ae4 | ||
![]() |
2984e4fc57 | ||
![]() |
2bf753a769 | ||
![]() |
6044e9e9e8 | ||
![]() |
e9d4372c41 | ||
![]() |
3b91846d0c | ||
![]() |
05b25db5eb | ||
![]() |
51119f22df | ||
![]() |
2030885fd3 | ||
![]() |
6e486d3c49 | ||
![]() |
4cc3b17d36 | ||
![]() |
5cfa919672 | ||
![]() |
f1bc2deafd | ||
![]() |
7508cd796d | ||
![]() |
626a4741c0 | ||
![]() |
f425a02cf9 | ||
![]() |
3e4dc306d4 | ||
![]() |
4a4eff55c1 | ||
![]() |
5e330a6d78 | ||
![]() |
ecf1273c82 | ||
![]() |
14ff8a8570 | ||
![]() |
0d5246fbc7 | ||
![]() |
a4fec411bd | ||
![]() |
50aab56177 | ||
![]() |
79c63e9ff4 | ||
![]() |
7201c014e3 | ||
![]() |
cc1c98325c | ||
![]() |
f8b05f7d75 | ||
![]() |
6faf54cf6f | ||
![]() |
01a24296b6 | ||
![]() |
ab81b508ce | ||
![]() |
ed6fb15c38 | ||
![]() |
2cefb0fb8f | ||
![]() |
1dae3a000d | ||
![]() |
7f4368415d | ||
![]() |
8116c8b40d | ||
![]() |
32cf349d12 | ||
![]() |
9da29da63b | ||
![]() |
f2ed255137 | ||
![]() |
49348a82e0 | ||
![]() |
d81a922a4f | ||
![]() |
1ca49c696a | ||
![]() |
8e8259934e | ||
![]() |
66bb19f91a | ||
![]() |
183dee89c2 | ||
![]() |
009a32d20b | ||
![]() |
338d83d4a5 | ||
![]() |
c3e054c155 | ||
![]() |
a09ec69a96 | ||
![]() |
7f5b48920c | ||
![]() |
4703523d6b | ||
![]() |
8066aaeeb0 | ||
![]() |
828e99d4b9 | ||
![]() |
5967289172 | ||
![]() |
4143032b66 | ||
![]() |
9eb506f6c5 | ||
![]() |
231965d36c | ||
![]() |
31380368e1 | ||
![]() |
e2e604a76a | ||
![]() |
98e4b6f338 | ||
![]() |
e1c2b1ddb5 | ||
![]() |
22993e8b6c | ||
![]() |
fdbc4ce0ed | ||
![]() |
96d7666d8e | ||
![]() |
0e3a558b02 | ||
![]() |
f9222a3bf4 | ||
![]() |
78b7941f2d | ||
![]() |
0d27b1aa65 | ||
![]() |
9b01a07b9d | ||
![]() |
32db43069d | ||
![]() |
89488b60a4 | ||
![]() |
a686255d9e | ||
![]() |
ffb95b4fa9 | ||
![]() |
29a02d1ab5 | ||
![]() |
564414ecac | ||
![]() |
050574f60f | ||
![]() |
b9f0c7c807 | ||
![]() |
ed6ad77fd9 | ||
![]() |
1f64302ae2 | ||
![]() |
a8c5f6d517 | ||
![]() |
de99cdfb4c | ||
![]() |
b75ce7af45 | ||
![]() |
de8ce77f37 | ||
![]() |
bdace6a4d6 | ||
![]() |
0e34caa1b0 | ||
![]() |
13ef403921 | ||
![]() |
f687abb165 | ||
![]() |
931661ed67 | ||
![]() |
7d3a0577d2 | ||
![]() |
4411aa9905 | ||
![]() |
4890999206 | ||
![]() |
a9c337302a | ||
![]() |
2a98791ec9 | ||
![]() |
8a2d3a400c | ||
![]() |
29342ea726 | ||
![]() |
4ad99a25d0 | ||
![]() |
fc859528e4 | ||
![]() |
49a931f712 | ||
![]() |
bdf8b01185 | ||
![]() |
1b201bf462 | ||
![]() |
3316aa5f4f | ||
![]() |
a11ab3d5ea | ||
![]() |
2a0f6d4cc9 | ||
![]() |
e3b9dbdf13 | ||
![]() |
70f024735b | ||
![]() |
fd76e0e270 | ||
![]() |
537a627b75 | ||
![]() |
57edcfe87d | ||
![]() |
b9dcdb00a5 | ||
![]() |
09ed41b7d2 | ||
![]() |
6e234f135d | ||
![]() |
e2a0c434cc | ||
![]() |
804a23595d | ||
![]() |
8655db371e | ||
![]() |
9b8d5c1b3b | ||
![]() |
e9f8ba6915 | ||
![]() |
67a015c71d | ||
![]() |
69526402e2 | ||
![]() |
b51759d36e | ||
![]() |
68b1805c40 | ||
![]() |
9cc862b951 | ||
![]() |
4fb4aa417c | ||
![]() |
0adc6a6112 | ||
![]() |
29efc116f3 | ||
![]() |
f62c5d9698 | ||
![]() |
1ad537bc4d | ||
![]() |
1fc02940ae | ||
![]() |
8a3c4f64b2 | ||
![]() |
4d7496b8dd | ||
![]() |
03a11e103e | ||
![]() |
c3313050ce | ||
![]() |
c30aa6f9cf | ||
![]() |
6da6edfc01 | ||
![]() |
461236030c | ||
![]() |
8cc291162f | ||
![]() |
b83ba4d293 | ||
![]() |
c2bd6a490f | ||
![]() |
476917bda9 | ||
![]() |
432d4f41f6 | ||
![]() |
2092330eec | ||
![]() |
e05e0f8ae3 | ||
![]() |
52ee234c0f | ||
![]() |
1d828fe8be | ||
![]() |
503114c0eb | ||
![]() |
653682a4b8 | ||
![]() |
1ad63d5b0b | ||
![]() |
d99707641b | ||
![]() |
0d9566dd71 | ||
![]() |
8d96518092 | ||
![]() |
717aca6824 | ||
![]() |
2cbf6110a6 | ||
![]() |
3358406e68 | ||
![]() |
d05fd25339 | ||
![]() |
fcec9adbcd | ||
![]() |
13f3008f82 | ||
![]() |
6090a1f65a | ||
![]() |
1ecd4a551d | ||
![]() |
c6db0524bd | ||
![]() |
d3f5474f38 | ||
![]() |
9996e53e24 | ||
![]() |
3b79ee35e0 | ||
![]() |
b202b539bf | ||
![]() |
e27966c15f | ||
![]() |
18c27c6f1d | ||
![]() |
345eaade22 | ||
![]() |
82f63b056f | ||
![]() |
ccd55a0bde | ||
![]() |
846a03663c | ||
![]() |
a88a467d45 | ||
![]() |
beab2278d8 | ||
![]() |
51a84eeb90 | ||
![]() |
ad6eba452c | ||
![]() |
eae88c51d2 | ||
![]() |
752cc3a527 | ||
![]() |
051b4271d3 | ||
![]() |
4decaf0308 | ||
![]() |
9144fa390f | ||
![]() |
c354d9e1e3 | ||
![]() |
77a326dedf | ||
![]() |
2d9bdedaf5 | ||
![]() |
04a99a7cd3 | ||
![]() |
0763590c24 | ||
![]() |
dfb1440ae0 | ||
![]() |
a1e2df8466 | ||
![]() |
20613beb8a | ||
![]() |
292cbd75a8 | ||
![]() |
88d3fdfb8f | ||
![]() |
1f68ea4058 | ||
![]() |
ab92b5c100 | ||
![]() |
195f3a5feb | ||
![]() |
dcab2c552f | ||
![]() |
a83f88bdf1 | ||
![]() |
c781545a40 | ||
![]() |
791dbe01a2 | ||
![]() |
fcd93794ce | ||
![]() |
0af36f12b7 | ||
![]() |
dd5d99eacc | ||
![]() |
750029f557 | ||
![]() |
ccfaea8e3f | ||
![]() |
0b9b2cfadc | ||
![]() |
526113517b | ||
![]() |
fb8149b2ca | ||
![]() |
9bb0ed2040 | ||
![]() |
2f9d6e0aff | ||
![]() |
ecc51d7cb8 | ||
![]() |
c309e3e3d6 | ||
![]() |
f52df3037f | ||
![]() |
649ab17806 | ||
![]() |
89da6ea31a | ||
![]() |
c7f7ff39ce | ||
![]() |
8e63a072e4 | ||
![]() |
b03ac389fa | ||
![]() |
d2511f6a8c | ||
![]() |
5b53cee673 | ||
![]() |
1b2dce99c9 | ||
![]() |
ba7f83019f | ||
![]() |
745abb81dc | ||
![]() |
e64e98fbfc | ||
![]() |
605f288554 | ||
![]() |
6d2552ea6e | ||
![]() |
20b4358c0e | ||
![]() |
7ca525622b | ||
![]() |
7350b63e40 | ||
![]() |
6543ece92c | ||
![]() |
aab8f9273f | ||
![]() |
166dca4924 | ||
![]() |
62f3c4baa6 | ||
![]() |
66c543cb8f | ||
![]() |
a19622c807 | ||
![]() |
013ff182c9 | ||
![]() |
b5d335711f | ||
![]() |
5e41b68a3a | ||
![]() |
3b901c4459 | ||
![]() |
f8234369c7 | ||
![]() |
0d8f09cec5 | ||
![]() |
23fe5ebddb | ||
![]() |
4a45112344 | ||
![]() |
75d276e19e | ||
![]() |
2243af1871 | ||
![]() |
91bbab9e2d | ||
![]() |
c6287b640d | ||
![]() |
c5fe23c26f | ||
![]() |
1304e8b00b | ||
![]() |
41dbf0fa96 | ||
![]() |
603b537ee1 | ||
![]() |
2a45d71efd | ||
![]() |
1a5e7315c0 | ||
![]() |
da6bb9498a | ||
![]() |
5d935c44e7 | ||
![]() |
e653d656b3 | ||
![]() |
46fc13a5bc | ||
![]() |
f3d8ada0ca | ||
![]() |
705d88360e | ||
![]() |
9e3601ae48 | ||
![]() |
3aa2885692 | ||
![]() |
c56854941e | ||
![]() |
357a928cce | ||
![]() |
1d9fefe7ac | ||
![]() |
d4cc366e86 | ||
![]() |
3d7883f021 | ||
![]() |
41f228c3ff | ||
![]() |
da447ae5d0 | ||
![]() |
1e417833f4 | ||
![]() |
f295424087 | ||
![]() |
daa85b4279 | ||
![]() |
e7369acaea | ||
![]() |
3ad17b79a6 | ||
![]() |
6879a15834 | ||
![]() |
607fe88d43 | ||
![]() |
b63828f88d | ||
![]() |
794b642ff8 | ||
![]() |
4870d37027 | ||
![]() |
fb855bfcfa | ||
![]() |
97a7f1fd71 | ||
![]() |
c86d46eb8a | ||
![]() |
361dd6a96e | ||
![]() |
17adec38af | ||
![]() |
638b9d9aae | ||
![]() |
c8f6994895 | ||
![]() |
1117a80500 | ||
![]() |
5d83ec6fa2 | ||
![]() |
bab5937426 | ||
![]() |
099a26977a | ||
![]() |
0b834485a8 | ||
![]() |
41f21d4f72 | ||
![]() |
312e5f3d96 | ||
![]() |
6ef3e7f536 | ||
![]() |
4f5228aec4 | ||
![]() |
b9daa35558 | ||
![]() |
21304a9677 | ||
![]() |
c46a3b09b1 | ||
![]() |
549c2b8d04 | ||
![]() |
05fd856d62 | ||
![]() |
6d2441dff6 | ||
![]() |
46ee4e426f | ||
![]() |
469d0f87be | ||
![]() |
b20602672e | ||
![]() |
6563c0292a | ||
![]() |
86f835cfc8 | ||
![]() |
4699ba3e71 | ||
![]() |
3f6613ea9f | ||
![]() |
c8635c0b9b | ||
![]() |
e78ac9b92a | ||
![]() |
7c07bc02af | ||
![]() |
1a0d333e2c | ||
![]() |
cd9fac78b8 | ||
![]() |
4c779beda9 | ||
![]() |
114262d353 | ||
![]() |
015e22acf8 | ||
![]() |
70ec91d0db | ||
![]() |
61b7033c65 | ||
![]() |
a9234785ab | ||
![]() |
b735c21a33 | ||
![]() |
83fb0f446f | ||
![]() |
78565d16c1 | ||
![]() |
2c5a2072b8 | ||
![]() |
56c2fe3eb1 | ||
![]() |
f36e0ef941 | ||
![]() |
c72bdc83c8 | ||
![]() |
3b7463e5ed | ||
![]() |
1e410de4cd | ||
![]() |
d08701e5c4 | ||
![]() |
359a570d77 | ||
![]() |
24198ed63e | ||
![]() |
77782fdbc7 | ||
![]() |
a15b228d3f | ||
![]() |
450c308e4f | ||
![]() |
d1e235a08b | ||
![]() |
85444dbee9 | ||
![]() |
01ac770037 | ||
![]() |
3675682674 | ||
![]() |
a7c9fe77c5 | ||
![]() |
f87d1630d1 | ||
![]() |
ec10316346 | ||
![]() |
449dfe8b8e | ||
![]() |
4adf79451e | ||
![]() |
7a47fcfcbc | ||
![]() |
fed32607de | ||
![]() |
8f5fe38212 | ||
![]() |
f3cf6d638d | ||
![]() |
e1d9d0b990 | ||
![]() |
6e5adbf0ba | ||
![]() |
38fb926ea8 | ||
![]() |
61e20ce48a | ||
![]() |
b0b4cccc96 | ||
![]() |
13e5c5ba72 | ||
![]() |
81d1dd7465 | ||
![]() |
b7d24c8325 | ||
![]() |
d7bf92b39f | ||
![]() |
d4c19ffa59 | ||
![]() |
120940f9f4 | ||
![]() |
6b3892baf1 | ||
![]() |
c1529bb7fc | ||
![]() |
033f88e8bb | ||
![]() |
6293a583a4 | ||
![]() |
ec5568b943 | ||
![]() |
f1bfdd4506 | ||
![]() |
48b1f489fc | ||
![]() |
e62dd255bc | ||
![]() |
13110c4ed9 | ||
![]() |
327fcbf902 | ||
![]() |
81924f72c8 | ||
![]() |
3166f689f9 | ||
![]() |
5d048ce21e | ||
![]() |
264edddc71 | ||
![]() |
caf95dec86 | ||
![]() |
289ac52900 | ||
![]() |
455839c0b9 | ||
![]() |
47e1f611d8 | ||
![]() |
fb9127ecc6 | ||
![]() |
a59f49c04f | ||
![]() |
58d692e6f5 | ||
![]() |
b62873a195 | ||
![]() |
6eb2ce2706 | ||
![]() |
c413119064 | ||
![]() |
599d035daf | ||
![]() |
10ba3b612e | ||
![]() |
3dca7d10d5 | ||
![]() |
84628134ed | ||
![]() |
f4bb978a87 | ||
![]() |
27a68819bc | ||
![]() |
427eaebd79 | ||
![]() |
3603cc883c | ||
![]() |
fc24373667 | ||
![]() |
2e571a18bd | ||
![]() |
1a0309fb87 | ||
![]() |
728d022f52 | ||
![]() |
fc829a4bde | ||
![]() |
e793aae0ec | ||
![]() |
663edabb14 | ||
![]() |
f41e34e61a | ||
![]() |
89d3d297b7 | ||
![]() |
41249fd064 | ||
![]() |
22587b9959 | ||
![]() |
3a2669e634 | ||
![]() |
895a5eb78a | ||
![]() |
4601c90904 | ||
![]() |
b9f0fb9cd2 | ||
![]() |
f788ab54f3 | ||
![]() |
a1c6d76a15 | ||
![]() |
7e5689d0b9 | ||
![]() |
563aff2d72 | ||
![]() |
e6f19ff461 | ||
![]() |
f2279d48d8 | ||
![]() |
8ad8d39fe4 | ||
![]() |
52c5ae6d8e | ||
![]() |
870cfdc44c | ||
![]() |
4b64775fde | ||
![]() |
4cd1e9a462 | ||
![]() |
55d2c928ee | ||
![]() |
0c4edd332c | ||
![]() |
3d140a7411 | ||
![]() |
2d11192c3a | ||
![]() |
3e76edcbac | ||
![]() |
f4fa68031e | ||
![]() |
377b22e82b | ||
![]() |
56a8068a7f | ||
![]() |
d17aa6ecdd | ||
![]() |
6f27363862 | ||
![]() |
5192608f7c | ||
![]() |
77f5e0d5f3 | ||
![]() |
4c311ea4b1 | ||
![]() |
bbb3712284 | ||
![]() |
4838d63455 | ||
![]() |
904c011baf | ||
![]() |
352dd5dcf7 | ||
![]() |
1388e201e5 | ||
![]() |
125312c114 | ||
![]() |
ea314cd24a | ||
![]() |
8230c8f8b4 | ||
![]() |
d115fbc6da | ||
![]() |
c1f51175a1 | ||
![]() |
06b5c192b4 | ||
![]() |
6f19af2371 | ||
![]() |
c230ff04cb | ||
![]() |
c71b6e31f7 | ||
![]() |
2ae8bf2987 | ||
![]() |
017fc483e7 | ||
![]() |
f2571e9930 | ||
![]() |
111354dd10 | ||
![]() |
66ea491aff | ||
![]() |
e95eaddf8a | ||
![]() |
d296049d19 | ||
![]() |
c45bf055b6 | ||
![]() |
c8b377bf74 | ||
![]() |
20751a6496 | ||
![]() |
f6c167db84 | ||
![]() |
75e11b1fde | ||
![]() |
cead1f36f4 | ||
![]() |
3108e896b6 | ||
![]() |
d41efa413c | ||
![]() |
5803d0abaf | ||
![]() |
53bc747e9d | ||
![]() |
e86d7894f5 | ||
![]() |
752a6b2cb0 | ||
![]() |
2fd94db686 | ||
![]() |
97a842e651 | ||
![]() |
8b64ad971a | ||
![]() |
338e7e83cd | ||
![]() |
fde3964b50 | ||
![]() |
aad53f9e61 | ||
![]() |
17b72d565d | ||
![]() |
319f925bdd | ||
![]() |
541de12690 | ||
![]() |
ea86ef3995 | ||
![]() |
fcba29f774 | ||
![]() |
166dca55f2 | ||
![]() |
aa43cfb5ac | ||
![]() |
989d716c36 | ||
![]() |
720849a55e | ||
![]() |
c83e29c6e3 | ||
![]() |
a4af3704ba | ||
![]() |
a3b8c301e2 | ||
![]() |
d106d3d1b1 | ||
![]() |
a26673c59a | ||
![]() |
5aff154740 | ||
![]() |
2e86031f00 | ||
![]() |
978bf4e0ff | ||
![]() |
8aaa7b1ba3 | ||
![]() |
d248952d9e | ||
![]() |
775fb80c43 | ||
![]() |
aec1d80966 | ||
![]() |
1f642ca9b6 | ||
![]() |
478c387491 | ||
![]() |
f532843665 | ||
![]() |
9ba1f7c1f6 | ||
![]() |
b78dc246ec | ||
![]() |
9251176f5e | ||
![]() |
0da56a1249 | ||
![]() |
cbcf7f8a11 | ||
![]() |
58a53c0fa8 | ||
![]() |
b486177ca7 | ||
![]() |
957e64fe8a | ||
![]() |
7881d1e457 | ||
![]() |
16be835c9b | ||
![]() |
59cf085af5 | ||
![]() |
fc8db95597 | ||
![]() |
9ac3992fd2 | ||
![]() |
cc10e62ebd | ||
![]() |
bed95c77a9 | ||
![]() |
069951a748 | ||
![]() |
c913fc8407 | ||
![]() |
4be66554b3 | ||
![]() |
d62c2d1e22 | ||
![]() |
30a3a9ee53 | ||
![]() |
0d5664cc9b | ||
![]() |
d03fdfdbca | ||
![]() |
57b883c7dd | ||
![]() |
af0f0ca526 | ||
![]() |
bc9ed8e1bd | ||
![]() |
673a2e8228 | ||
![]() |
75c67ed948 | ||
![]() |
353895dceb | ||
![]() |
d348f2847c | ||
![]() |
4d46ea9801 | ||
![]() |
eec97d10af | ||
![]() |
ebef4a1416 | ||
![]() |
24605784f2 | ||
![]() |
3240f8ae56 | ||
![]() |
627ddc0774 | ||
![]() |
4fc3cc7aff | ||
![]() |
3e1b235055 | ||
![]() |
44706bc32e | ||
![]() |
e5c85cbc64 | ||
![]() |
589dd70356 | ||
![]() |
85ba4549fb | ||
![]() |
adf7702211 | ||
![]() |
ba71afcce5 | ||
![]() |
3c0727c744 | ||
![]() |
7391baae34 | ||
![]() |
4b31112bcb | ||
![]() |
17ff584d15 | ||
![]() |
79f4eb2e32 | ||
![]() |
e8cd3c0baf | ||
![]() |
15f31f9d95 | ||
![]() |
370806365f | ||
![]() |
15dd60ab85 | ||
![]() |
d1f3b889d6 | ||
![]() |
7b7db4f60e | ||
![]() |
965eae5f45 | ||
![]() |
278a19f87a | ||
![]() |
56f3fa6495 | ||
![]() |
50f44c5cb0 | ||
![]() |
cc2f4f779a | ||
![]() |
00ce0fc034 | ||
![]() |
551b37f969 | ||
![]() |
bc5ef5fb7d | ||
![]() |
c20b8a0664 | ||
![]() |
9660b0e9fb | ||
![]() |
f05f07e44f | ||
![]() |
7e8631dd19 | ||
![]() |
23e590e09b | ||
![]() |
60e4585e20 | ||
![]() |
ba436cc37a | ||
![]() |
960ea450e9 | ||
![]() |
8ffa7e6334 | ||
![]() |
2fb1876023 | ||
![]() |
f5692e742b | ||
![]() |
d7e7498fea | ||
![]() |
8ea1a1a077 | ||
![]() |
7cd281eea8 | ||
![]() |
1570eb7b73 | ||
![]() |
5060c9f390 | ||
![]() |
1fea43e125 | ||
![]() |
ef47cc5b6f | ||
![]() |
e876c35ef9 | ||
![]() |
800cb65706 | ||
![]() |
25ff005dd7 | ||
![]() |
98f4c2d3ae | ||
![]() |
72c266b242 | ||
![]() |
2bb0cf17d1 | ||
![]() |
828f69f011 | ||
![]() |
ad4b079d63 | ||
![]() |
d3de78ffce | ||
![]() |
5d4d7c5fbf | ||
![]() |
238b15df9d | ||
![]() |
6e2deb1fa7 | ||
![]() |
1255c0064b | ||
![]() |
8e93ffffc6 | ||
![]() |
c55add73f6 | ||
![]() |
d2300d375b | ||
![]() |
053c966d5f | ||
![]() |
235797a97c | ||
![]() |
1fa84a30c9 | ||
![]() |
622b441eb0 | ||
![]() |
508fbccdb4 | ||
![]() |
ad0cb7ff3c | ||
![]() |
bc258793ac | ||
![]() |
10d2e0a62f | ||
![]() |
4d0da7fba0 | ||
![]() |
738abc8946 | ||
![]() |
de5ad8644e | ||
![]() |
97b39bca95 | ||
![]() |
3698b30809 | ||
![]() |
069437842b | ||
![]() |
ee13c7666d | ||
![]() |
a23a7edd26 | ||
![]() |
6f05d4b05a | ||
![]() |
ab5111e84f | ||
![]() |
e21da2ec7f | ||
![]() |
2b40bc0a48 | ||
![]() |
7e1006db26 | ||
![]() |
44f463c4f4 | ||
![]() |
6029bdeee9 | ||
![]() |
0261e7464a | ||
![]() |
a22158b2e2 | ||
![]() |
8a3bd5bcb8 | ||
![]() |
514d12d48c | ||
![]() |
01fac85cde | ||
![]() |
18283bc48f | ||
![]() |
f31db315b8 | ||
![]() |
8a2aea219e | ||
![]() |
034fe80411 | ||
![]() |
6d9b695ada | ||
![]() |
9c1da3bca1 | ||
![]() |
0e61395aa9 | ||
![]() |
8215c7d98e | ||
![]() |
ee45ab2e6c | ||
![]() |
b1f3e21d28 | ||
![]() |
a4b0e6b87b | ||
![]() |
9fe7152d98 | ||
![]() |
0859f28a14 | ||
![]() |
56b9aab5ce | ||
![]() |
aacc40e525 | ||
![]() |
b0ed5e9be2 | ||
![]() |
3777ccb305 | ||
![]() |
6b736f0bb0 | ||
![]() |
2e72c0bf6e | ||
![]() |
a1757ba217 | ||
![]() |
5390c409d0 | ||
![]() |
4f91c9a8de | ||
![]() |
8cf4efc190 | ||
![]() |
405df09e43 | ||
![]() |
86adf96021 | ||
![]() |
a0c3de568b | ||
![]() |
c10eb5af79 | ||
![]() |
3c4acd2184 | ||
![]() |
ab1573053e | ||
![]() |
c404f6fe34 | ||
![]() |
d24256e1c2 | ||
![]() |
e494e2dc56 | ||
![]() |
ab2e727db9 | ||
![]() |
b9fcb66d28 | ||
![]() |
12e4819c49 | ||
![]() |
0b54366705 | ||
![]() |
c99fd2baa9 | ||
![]() |
646f76d343 | ||
![]() |
868cb529aa | ||
![]() |
2d01548d02 | ||
![]() |
047e15951a | ||
![]() |
6fb92f6f3c | ||
![]() |
f4a5b80eff | ||
![]() |
802407c8ae | ||
![]() |
74c7a8585d | ||
![]() |
439274c5ae | ||
![]() |
8c1046169f | ||
![]() |
2389f4a285 | ||
![]() |
24fb2337d7 | ||
![]() |
cc55a82b64 | ||
![]() |
931120f73c | ||
![]() |
1f8fb56409 | ||
![]() |
5865c890b5 | ||
![]() |
1fb671c561 | ||
![]() |
acd9a8aefb | ||
![]() |
66bc844cc9 | ||
![]() |
3e3de72093 | ||
![]() |
00053b8e97 | ||
![]() |
883d0d5039 | ||
![]() |
e49825b7a3 | ||
![]() |
9f286b46ff | ||
![]() |
803ea863fd | ||
![]() |
1615c6d9f9 | ||
![]() |
d59f878020 | ||
![]() |
646a96e5f0 | ||
![]() |
77a1aea7b9 | ||
![]() |
f3f4672816 | ||
![]() |
b68a38443c | ||
![]() |
c919bef70e | ||
![]() |
b1540d1491 | ||
![]() |
8ff40c152b | ||
![]() |
51803f00fb | ||
![]() |
fb4aefeae7 | ||
![]() |
7d987e5877 | ||
![]() |
816b6276a6 | ||
![]() |
836a026f63 | ||
![]() |
dc9ddc77ea | ||
![]() |
fdbd38ed5f | ||
![]() |
1f39fde230 | ||
![]() |
c420224080 | ||
![]() |
b1f13cbb9a | ||
![]() |
0f2e0c2ab4 | ||
![]() |
d8af97c152 | ||
![]() |
43f3784c83 | ||
![]() |
528ebd8f12 | ||
![]() |
c05c98c082 | ||
![]() |
d8c7557ae5 | ||
![]() |
f9753fc621 | ||
![]() |
42b59a9e35 | ||
![]() |
74bd576ebc | ||
![]() |
a017ffc3c9 | ||
![]() |
d3a81f025a | ||
![]() |
750f647b0d | ||
![]() |
2a9e56439e | ||
![]() |
e4bca33d00 | ||
![]() |
1528c03f85 | ||
![]() |
c73c68532a | ||
![]() |
989c8969cb | ||
![]() |
ff2ff22d27 | ||
![]() |
5ef7bad1ce | ||
![]() |
5e0c321510 | ||
![]() |
f19fac97d1 | ||
![]() |
d04f73af7e | ||
![]() |
6ef3915fcc | ||
![]() |
87257153b9 | ||
![]() |
02207087e4 | ||
![]() |
b4417d47f1 | ||
![]() |
04e3674355 | ||
![]() |
dbf8af06a4 | ||
![]() |
0bcdaa395f | ||
![]() |
7788d26ed4 | ||
![]() |
b3002be08a | ||
![]() |
813ceb0d96 | ||
![]() |
c39c3be39f | ||
![]() |
9eb17c6e13 | ||
![]() |
a6e26ce5bb | ||
![]() |
b735a7911a | ||
![]() |
2e342dace2 | ||
![]() |
14369d3143 | ||
![]() |
b6b5202923 | ||
![]() |
808152211c | ||
![]() |
408e852018 | ||
![]() |
ef91b4fa0e | ||
![]() |
46d924ffc9 | ||
![]() |
f965f5643a | ||
![]() |
85f0f7d241 | ||
![]() |
9468bffcbb | ||
![]() |
bd44957302 | ||
![]() |
7e3d57fc28 | ||
![]() |
4f5c707b56 | ||
![]() |
2a37023a8d | ||
![]() |
9901a73a2a | ||
![]() |
40a319fc5b | ||
![]() |
8ee321fd7b | ||
![]() |
eaf75fa149 | ||
![]() |
a6093e847e | ||
![]() |
0a6c7781c4 | ||
![]() |
0871f5c012 | ||
![]() |
6f27c36186 | ||
![]() |
563c51d431 | ||
![]() |
455c61b2cf | ||
![]() |
0a547e524e | ||
![]() |
9c5c85d34a | ||
![]() |
8d6af3dfed | ||
![]() |
3bae25fe6b | ||
![]() |
1d8d677d81 | ||
![]() |
75db08a60c | ||
![]() |
d367e832be | ||
![]() |
8d9800c727 | ||
![]() |
058f1c2edf | ||
![]() |
9425b8adc2 | ||
![]() |
21caa3eb72 | ||
![]() |
fdb81be0a0 | ||
![]() |
a4d1d86d7b | ||
![]() |
6191bb5f1b | ||
![]() |
d858cd677e | ||
![]() |
2376d38e0e | ||
![]() |
d8ee2bb850 | ||
![]() |
609d28c6ee | ||
![]() |
eeafa8f5aa | ||
![]() |
5e4bcbdfa0 | ||
![]() |
87911f4a56 | ||
![]() |
a96c5ed83a | ||
![]() |
fe9a1c59cb | ||
![]() |
612a57bdf7 | ||
![]() |
979a376855 | ||
![]() |
c5d859e52e | ||
![]() |
13286f66fd | ||
![]() |
9e0c5d1d14 | ||
![]() |
0f092acec3 | ||
![]() |
56c2f23393 | ||
![]() |
33903bbf6d | ||
![]() |
96395c44e0 | ||
![]() |
036dc802dc | ||
![]() |
15ac2f87a3 | ||
![]() |
8a5d9bbad3 | ||
![]() |
2bcae96d0a |
@@ -3,4 +3,5 @@ dist/**
|
|||||||
docs/Setup.md
|
docs/Setup.md
|
||||||
cypress.config.js
|
cypress.config.js
|
||||||
cypress/plugins/index.js
|
cypress/plugins/index.js
|
||||||
coverage
|
coverage
|
||||||
|
*.json
|
150
.eslintrc.cjs
Normal file
150
.eslintrc.cjs
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es6: true,
|
||||||
|
'jest/globals': true,
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
ecmaFeatures: {
|
||||||
|
experimentalObjectRestSpread: true,
|
||||||
|
jsx: true,
|
||||||
|
},
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
sourceType: 'module',
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
allowAutomaticSingleRunInference: true,
|
||||||
|
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
},
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:json/recommended',
|
||||||
|
'plugin:markdown/recommended',
|
||||||
|
'plugin:@cspell/recommended',
|
||||||
|
'prettier',
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
'@typescript-eslint',
|
||||||
|
'no-only-tests',
|
||||||
|
'html',
|
||||||
|
'jest',
|
||||||
|
'jsdoc',
|
||||||
|
'json',
|
||||||
|
'@cspell',
|
||||||
|
'lodash',
|
||||||
|
'unicorn',
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
curly: 'error',
|
||||||
|
'no-console': 'error',
|
||||||
|
'no-prototype-builtins': 'off',
|
||||||
|
'no-unused-vars': 'off',
|
||||||
|
'cypress/no-async-tests': 'off',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
|
'@typescript-eslint/no-misused-promises': 'error',
|
||||||
|
'@typescript-eslint/ban-ts-comment': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'ts-expect-error': 'allow-with-description',
|
||||||
|
'ts-ignore': 'allow-with-description',
|
||||||
|
'ts-nocheck': 'allow-with-description',
|
||||||
|
'ts-check': 'allow-with-description',
|
||||||
|
minimumDescriptionLength: 10,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'json/*': ['error', 'allowComments'],
|
||||||
|
'@cspell/spellchecker': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
checkIdentifiers: false,
|
||||||
|
checkStrings: false,
|
||||||
|
checkStringTemplates: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-empty': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowEmptyCatch: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-only-tests/no-only-tests': 'error',
|
||||||
|
'lodash/import-scope': ['error', 'method'],
|
||||||
|
'unicorn/better-regex': 'error',
|
||||||
|
'unicorn/no-abusive-eslint-disable': 'error',
|
||||||
|
'unicorn/no-array-push-push': 'error',
|
||||||
|
'unicorn/no-for-loop': 'error',
|
||||||
|
'unicorn/no-instanceof-array': 'error',
|
||||||
|
'unicorn/no-typeof-undefined': 'error',
|
||||||
|
'unicorn/no-unnecessary-await': 'error',
|
||||||
|
'unicorn/no-unsafe-regex': 'warn',
|
||||||
|
'unicorn/no-useless-promise-resolve-reject': 'error',
|
||||||
|
'unicorn/prefer-array-find': 'error',
|
||||||
|
'unicorn/prefer-array-flat-map': 'error',
|
||||||
|
'unicorn/prefer-array-index-of': 'error',
|
||||||
|
'unicorn/prefer-array-some': 'error',
|
||||||
|
'unicorn/prefer-default-parameters': 'error',
|
||||||
|
'unicorn/prefer-includes': 'error',
|
||||||
|
'unicorn/prefer-negative-index': 'error',
|
||||||
|
'unicorn/prefer-object-from-entries': 'error',
|
||||||
|
'unicorn/prefer-string-starts-ends-with': 'error',
|
||||||
|
'unicorn/prefer-string-trim-start-end': 'error',
|
||||||
|
'unicorn/string-content': 'error',
|
||||||
|
'unicorn/prefer-spread': 'error',
|
||||||
|
'unicorn/no-lonely-if': 'error',
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['cypress/**', 'demos/**'],
|
||||||
|
rules: {
|
||||||
|
'no-console': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.{js,jsx,mjs,cjs}'],
|
||||||
|
extends: ['plugin:jsdoc/recommended'],
|
||||||
|
rules: {
|
||||||
|
'jsdoc/check-indentation': 'off',
|
||||||
|
'jsdoc/check-alignment': 'off',
|
||||||
|
'jsdoc/check-line-alignment': 'off',
|
||||||
|
'jsdoc/multiline-blocks': 'off',
|
||||||
|
'jsdoc/newline-after-description': 'off',
|
||||||
|
'jsdoc/tag-lines': 'off',
|
||||||
|
'jsdoc/require-param-description': 'off',
|
||||||
|
'jsdoc/require-param-type': 'off',
|
||||||
|
'jsdoc/require-returns': 'off',
|
||||||
|
'jsdoc/require-returns-description': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.{ts,tsx}'],
|
||||||
|
plugins: ['tsdoc'],
|
||||||
|
rules: {
|
||||||
|
'tsdoc/syntax': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.spec.{ts,js}', 'cypress/**', 'demos/**', '**/docs/**'],
|
||||||
|
rules: {
|
||||||
|
'jsdoc/require-jsdoc': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.html', '*.md', '**/*.md/*'],
|
||||||
|
rules: {
|
||||||
|
'no-var': 'error',
|
||||||
|
'no-undef': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'off',
|
||||||
|
'@typescript-eslint/no-misused-promises': 'off',
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
project: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"es6": true,
|
|
||||||
"jest/globals": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"experimentalObjectRestSpread": true,
|
|
||||||
"jsx": true
|
|
||||||
},
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"plugin:jsdoc/recommended",
|
|
||||||
"plugin:json/recommended",
|
|
||||||
"plugin:markdown/recommended",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"plugins": ["@typescript-eslint", "html", "jest", "jsdoc", "json"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "error",
|
|
||||||
"no-prototype-builtins": "off",
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"jsdoc/check-indentation": "off",
|
|
||||||
"jsdoc/check-alignment": "off",
|
|
||||||
"jsdoc/check-line-alignment": "off",
|
|
||||||
"jsdoc/multiline-blocks": "off",
|
|
||||||
"jsdoc/newline-after-description": "off",
|
|
||||||
"jsdoc/tag-lines": "off",
|
|
||||||
"jsdoc/require-param-description": "off",
|
|
||||||
"jsdoc/require-param-type": "off",
|
|
||||||
"jsdoc/require-returns": "off",
|
|
||||||
"jsdoc/require-returns-description": "off",
|
|
||||||
"cypress/no-async-tests": "off",
|
|
||||||
"@typescript-eslint/ban-ts-comment": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"ts-expect-error": "allow-with-description",
|
|
||||||
"ts-ignore": "allow-with-description",
|
|
||||||
"ts-nocheck": "allow-with-description",
|
|
||||||
"ts-check": "allow-with-description",
|
|
||||||
"minimumDescriptionLength": 10
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"json/*": ["error", "allowComments"],
|
|
||||||
"no-empty": ["error", { "allowEmptyCatch": true }]
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "./**/*.html",
|
|
||||||
"rules": {
|
|
||||||
"no-undef": "off",
|
|
||||||
"jsdoc/require-jsdoc": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["./cypress/**", "./demos/**"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["./**/*.spec.{ts,js}", "./cypress/**", "./demos/**", "./**/docs/**"],
|
|
||||||
"rules": {
|
|
||||||
"jsdoc/require-jsdoc": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1,6 +1,8 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [knsv]
|
github:
|
||||||
|
- knsv
|
||||||
|
- sidharthv96
|
||||||
#patreon: # Replace with a single Patreon username
|
#patreon: # Replace with a single Patreon username
|
||||||
#open_collective: # Replace with a single Open Collective username
|
#open_collective: # Replace with a single Open Collective username
|
||||||
#ko_fi: # Replace with a single Ko-fi username
|
#ko_fi: # Replace with a single Ko-fi username
|
||||||
|
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: 'Status: Triage, Type: Bug / Error'
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Code Sample**
|
|
||||||
If applicable, add the code sample or a link to the [live editor](https://mermaid.live).
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
69
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
69
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: Create a report to help us improve
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Bug / Error'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Security vulnerabilities
|
||||||
|
Please refer our [Security Policy](https://github.com/mermaid-js/.github/blob/main/SECURITY.md) and report to keep vulnerabilities confidential so we can release fixes first.
|
||||||
|
|
||||||
|
## Before you submit...
|
||||||
|
We like to help you, but in order to do that should you make a few things first:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible.
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Give a clear and concise description of what the bug is.
|
||||||
|
placeholder: When I do ... does ... happen.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: Give a step-by-step example on how to reproduce the bug.
|
||||||
|
placeholder: |-
|
||||||
|
1. Do this
|
||||||
|
2. Do that
|
||||||
|
3. ...
|
||||||
|
4. Bug!
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to help explain your issue.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Code Sample
|
||||||
|
description: |-
|
||||||
|
If applicable, add the code sample or a link to the [Live Editor](https://mermaid.live).
|
||||||
|
Any text pasted here will be rendered as a Code block.
|
||||||
|
render: text
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Setup
|
||||||
|
description: |-
|
||||||
|
Please fill out the below info.
|
||||||
|
Note that you only need to fill out one and not both sections.
|
||||||
|
value: |-
|
||||||
|
**Desktop**
|
||||||
|
|
||||||
|
- OS and Version: [Windows, Linux, Mac, ...]
|
||||||
|
- Browser and Version: [Chrome, Edge, Firefox]
|
||||||
|
|
||||||
|
**Smartphone**
|
||||||
|
|
||||||
|
- Device: [Samsung, iPhone, ...]
|
||||||
|
- OS and Version: [Android, iOS, ...]
|
||||||
|
- Browser and Version: [Chrome, Safari, ...]
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional Context
|
||||||
|
description: Anything else to add?
|
14
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
14
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: GitHub Discussions
|
||||||
|
url: https://github.com/mermaid-js/mermaid/discussions
|
||||||
|
about: Ask the Community questions or share your own graphs in our discussions.
|
||||||
|
- name: Slack
|
||||||
|
url: https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE
|
||||||
|
about: Join our Community on Slack for Help and a casual chat.
|
||||||
|
- name: Documentation
|
||||||
|
url: https://mermaid-js.github.io
|
||||||
|
about: Read our documentation for all that Mermaid.js can offer.
|
||||||
|
- name: Live Editor
|
||||||
|
url: https://mermaid.live
|
||||||
|
about: Try the live editor to preview graphs in no time.
|
42
.github/ISSUE_TEMPLATE/diagram_proposal.yml
vendored
Normal file
42
.github/ISSUE_TEMPLATE/diagram_proposal.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Diagram Proposal
|
||||||
|
description: Suggest a new Diagram Type to add to Mermaid.
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Enhancement'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Before you submit...
|
||||||
|
First of all, thank you for proposing a new Diagram to us.
|
||||||
|
We are always happy about new ideas to improve Mermaid.js wherever possible.
|
||||||
|
|
||||||
|
To get the fastest and best response possible, make sure you do the following:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible.
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposal
|
||||||
|
description: A clear and concise description of what should be added to Mermaid.js.
|
||||||
|
placeholder: Mermaid.js should add ... because ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Use Cases
|
||||||
|
description: If applicable, give some use cases for where this diagram would be useful.
|
||||||
|
placeholder: The Diagram could be used for ...
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to show possible examples of how the diagram may look like.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Code Sample
|
||||||
|
description: |-
|
||||||
|
If applicable, add a code sample for how to implement this new diagram.
|
||||||
|
The text will automatically be rendered as JavaScript code.
|
||||||
|
render: javascript
|
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: 'Status: Triage, Type: Enhancement'
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
16
.github/ISSUE_TEMPLATE/question.md
vendored
16
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: Get some help from the community.
|
|
||||||
title: ''
|
|
||||||
labels: 'Help wanted!, Type: Other'
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
|
|
||||||
## Help us help you!
|
|
||||||
|
|
||||||
You want an answer. Here are some ways to get it quicker:
|
|
||||||
|
|
||||||
- Use a clear and concise title.
|
|
||||||
- Try to pose a clear and concise question.
|
|
||||||
- Include as much, or as little, code as necessary.
|
|
||||||
- Don't be shy to give us some screenshots, if it helps!
|
|
34
.github/ISSUE_TEMPLATE/syntax_proposal.yml
vendored
Normal file
34
.github/ISSUE_TEMPLATE/syntax_proposal.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Syntax Proposal
|
||||||
|
description: Suggest a new Syntax to add to Mermaid.js.
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Enhancement'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Before you submit...
|
||||||
|
First of all, thank you for proposing a new Syntax to us.
|
||||||
|
We are always happy about new ideas to improve Mermaid.js wherever possible.
|
||||||
|
|
||||||
|
To get the fastest and best response possible, make sure you do the following:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible. Examples are always welcome.
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposal
|
||||||
|
description: A clear and concise description of what Syntax should be added to Mermaid.js.
|
||||||
|
placeholder: Mermaid.js should add ... because ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Example
|
||||||
|
description: If applicable, provide an example of the new Syntax.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to show possible examples of how the theme may look like.
|
42
.github/ISSUE_TEMPLATE/theme_proposal.yml
vendored
Normal file
42
.github/ISSUE_TEMPLATE/theme_proposal.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Theme Proposal
|
||||||
|
description: Suggest a new theme to add to Mermaid.js.
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Enhancement'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Before you submit...
|
||||||
|
First of all, thank you for proposing a new Theme to us.
|
||||||
|
We are always happy about new ideas to improve Mermaid.js wherever possible.
|
||||||
|
|
||||||
|
To get the fastest and best response possible, make sure you do the following:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible. Examples are always welcome!
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposal
|
||||||
|
description: A clear and concise description of what theme should be added to Mermaid.js.
|
||||||
|
placeholder: Mermaid.js should add ... because ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Colors
|
||||||
|
description: |-
|
||||||
|
A detailed list of the different colour values to use.
|
||||||
|
A list of currently used variable names can be found [here](https://mermaid-js.github.io/mermaid/#/theming?id=theme-variables-reference-table)
|
||||||
|
placeholder: |-
|
||||||
|
- background: #f4f4f4
|
||||||
|
- primaryColor: #fff4dd
|
||||||
|
- ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to show possible examples of how the theme may look like.
|
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -1,18 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: npm
|
|
||||||
open-pull-requests-limit: 10
|
|
||||||
directory: /
|
|
||||||
target-branch: develop
|
|
||||||
versioning-strategy: increase
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
day: monday
|
|
||||||
time: '07:00'
|
|
||||||
- package-ecosystem: github-actions
|
|
||||||
directory: /
|
|
||||||
target-branch: develop
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
day: monday
|
|
||||||
time: '07:00'
|
|
1
.github/pull_request_template.md
vendored
1
.github/pull_request_template.md
vendored
@@ -14,4 +14,5 @@ Make sure you
|
|||||||
|
|
||||||
- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
|
- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
|
||||||
- [ ] :computer: have added unit/e2e tests (if appropriate)
|
- [ ] :computer: have added unit/e2e tests (if appropriate)
|
||||||
|
- [ ] :notebook: have added documentation (if appropriate)
|
||||||
- [ ] :bookmark: targeted `develop` branch
|
- [ ] :bookmark: targeted `develop` branch
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
2
.github/workflows/e2e-applitools.yml
vendored
2
.github/workflows/e2e-applitools.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ ! env.USE_APPLI }}
|
- if: ${{ ! env.USE_APPLI }}
|
||||||
name: Warn if not using Applitools
|
name: Warn if not using Applitools
|
||||||
|
10
.github/workflows/e2e.yml
vendored
10
.github/workflows/e2e.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
containers: [1, 2, 3, 4]
|
containers: [1, 2, 3, 4]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -32,6 +32,7 @@ jobs:
|
|||||||
# and run all Cypress tests
|
# and run all Cypress tests
|
||||||
- name: Cypress run
|
- name: Cypress run
|
||||||
uses: cypress-io/github-action@v4
|
uses: cypress-io/github-action@v4
|
||||||
|
id: cypress
|
||||||
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
|
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
|
||||||
# Otherwise (e.g. if running from fork), we run on a single container only
|
# Otherwise (e.g. if running from fork), we run on a single container only
|
||||||
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
||||||
@@ -44,3 +45,10 @@ jobs:
|
|||||||
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
|
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
|
||||||
env:
|
env:
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
|
||||||
|
with:
|
||||||
|
name: error-snapshots
|
||||||
|
path: cypress/snapshots/**/__diff_output__/*
|
||||||
|
44
.github/workflows/link-checker.yml
vendored
Normal file
44
.github/workflows/link-checker.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# This Link Checker is run on all documentation files once per week.
|
||||||
|
|
||||||
|
# references:
|
||||||
|
# - https://github.com/lycheeverse/lychee-action
|
||||||
|
# - https://github.com/lycheeverse/lychee
|
||||||
|
|
||||||
|
name: Link Checker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
schedule:
|
||||||
|
# * is a special character in YAML so you have to quote this string
|
||||||
|
- cron: '30 8 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linkChecker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
# lychee only uses the GITHUB_TOKEN to avoid rate-limiting
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Restore lychee cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: .lycheecache
|
||||||
|
key: cache-lychee-${{ github.sha }}
|
||||||
|
restore-keys: cache-lychee-
|
||||||
|
|
||||||
|
- name: Link Checker
|
||||||
|
uses: lycheeverse/lychee-action@v1.5.4
|
||||||
|
with:
|
||||||
|
args: --verbose --no-progress --cache --max-cache-age 1d packages/mermaid/src/docs/**/*.md README.md README.zh-CN.md
|
||||||
|
fail: true
|
||||||
|
jobSummary: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
35
.github/workflows/lint.yml
vendored
35
.github/workflows/lint.yml
vendored
@@ -7,16 +7,17 @@ on:
|
|||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -36,7 +37,35 @@ jobs:
|
|||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Linting
|
- name: Run Linting
|
||||||
run: pnpm run lint
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! pnpm run lint; then
|
||||||
|
# print a nice error message on lint failure
|
||||||
|
ERROR_MESSAGE='Running `pnpm run lint` failed.'
|
||||||
|
ERROR_MESSAGE+=' Running `pnpm run lint:fix` may fix this issue. '
|
||||||
|
ERROR_MESSAGE+=" If this error doesn't occur on your local machine,"
|
||||||
|
ERROR_MESSAGE+=' make sure your packages are up-to-date by running `pnpm install`.'
|
||||||
|
ERROR_MESSAGE+=' You may also need to delete your prettier cache by running'
|
||||||
|
ERROR_MESSAGE+=' `rm ./node_modules/.cache/prettier/.prettier-cache`.'
|
||||||
|
echo "::error title=Lint failure::${ERROR_MESSAGE}"
|
||||||
|
# make sure to return an error exitcode so that GitHub actions shows a red-cross
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Verify Docs
|
- name: Verify Docs
|
||||||
|
id: verifyDocs
|
||||||
|
working-directory: ./packages/mermaid
|
||||||
|
continue-on-error: ${{ github.event_name == 'push' }}
|
||||||
run: pnpm run docs:verify
|
run: pnpm run docs:verify
|
||||||
|
|
||||||
|
- name: Rebuild Docs
|
||||||
|
if: ${{ steps.verifyDocs.outcome == 'failure' && github.event_name == 'push' }}
|
||||||
|
working-directory: ./packages/mermaid
|
||||||
|
run: pnpm run docs:build
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
if: ${{ steps.verifyDocs.outcome == 'failure' && github.event_name == 'push' }}
|
||||||
|
with:
|
||||||
|
message: 'Update docs'
|
||||||
|
add: 'docs/*'
|
||||||
|
62
.github/workflows/publish-docs.yml
vendored
Normal file
62
.github/workflows/publish-docs.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: Deploy Vitepress docs to Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Runs on pushes targeting the default branch
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
# Allow one concurrent deployment
|
||||||
|
concurrency:
|
||||||
|
group: 'pages'
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Build job
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: pnpm
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v2
|
||||||
|
|
||||||
|
- name: Run Build
|
||||||
|
run: pnpm --filter mermaid run docs:build:vitepress
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v1
|
||||||
|
with:
|
||||||
|
path: packages/mermaid/src/vitepress/.vitepress/dist
|
||||||
|
|
||||||
|
# Deployment job
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v1
|
22
.github/workflows/release-preview-publish.yml
vendored
22
.github/workflows/release-preview-publish.yml
vendored
@@ -10,22 +10,30 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
cache: pnpm
|
||||||
- name: Install Yarn
|
node-version: 18.x
|
||||||
run: npm i yarn --global
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
env:
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Install Json
|
- name: Install Json
|
||||||
run: npm i json --global
|
run: npm i json --global
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: yarn install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
|
working-directory: ./packages/mermaid
|
||||||
run: |
|
run: |
|
||||||
PREVIEW_VERSION=8
|
PREVIEW_VERSION=$(git log --oneline "origin/$GITHUB_REF_NAME" ^"origin/master" | wc -l)
|
||||||
VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION
|
VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION
|
||||||
echo $VERSION
|
echo $VERSION
|
||||||
npm version --no-git-tag-version --allow-same-version $VERSION
|
npm version --no-git-tag-version --allow-same-version $VERSION
|
||||||
|
2
.github/workflows/release-publish.yml
vendored
2
.github/workflows/release-publish.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 18.x
|
||||||
- name: Install Yarn
|
- name: Install Yarn
|
||||||
run: npm i yarn --global
|
run: npm i yarn --global
|
||||||
|
|
||||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -32,3 +32,7 @@ cypress/snapshots/
|
|||||||
.eslintcache
|
.eslintcache
|
||||||
.tsbuildinfo
|
.tsbuildinfo
|
||||||
tsconfig.tsbuildinfo
|
tsconfig.tsbuildinfo
|
||||||
|
|
||||||
|
knsv*.html
|
||||||
|
local*.html
|
||||||
|
stats/
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"packages/mermaid/src/docs/**": ["pnpm run docs:build --git"],
|
|
||||||
"packages/mermaid/src/docs.mts": ["pnpm run docs:build --git"],
|
|
||||||
"*.{ts,js,json,html,md,mts}": ["eslint --fix", "prettier --write"],
|
|
||||||
"*.jison": ["pnpm run lint:jison"]
|
|
||||||
}
|
|
11
.lintstagedrc.mjs
Normal file
11
.lintstagedrc.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
'!(docs/**/*)*.{ts,js,json,html,md,mts}': [
|
||||||
|
'eslint --cache --cache-strategy content --fix',
|
||||||
|
// don't cache prettier yet, since we use `prettier-plugin-jsdoc`,
|
||||||
|
// and prettier doesn't invalidate cache on plugin updates"
|
||||||
|
// https://prettier.io/docs/en/cli.html#--cache
|
||||||
|
'prettier --write',
|
||||||
|
],
|
||||||
|
'cSpell.json': ['ts-node-esm scripts/fixCSpell.ts'],
|
||||||
|
'**/*.jison': ['pnpm -w run lint:jison'],
|
||||||
|
};
|
16
.lycheeignore
Normal file
16
.lycheeignore
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# These links are ignored by our link checker https://github.com/lycheeverse/lychee
|
||||||
|
# The file allows you to list multiple regular expressions for exclusion (one pattern per line).
|
||||||
|
|
||||||
|
# Network error: Forbidden
|
||||||
|
https://codepen.io
|
||||||
|
|
||||||
|
# Network error: The certificate was not trusted
|
||||||
|
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_
|
||||||
|
|
||||||
|
# Don't check files that are generated during the build via `pnpm docs:code`
|
||||||
|
packages/mermaid/src/docs/config/setup/*
|
3
.npmrc
Normal file
3
.npmrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
auto-install-peers=true
|
||||||
|
strict-peer-dependencies=false
|
||||||
|
use-inline-specifiers-lockfile-format=true
|
@@ -3,4 +3,5 @@ cypress/platform/xss3.html
|
|||||||
.cache
|
.cache
|
||||||
coverage
|
coverage
|
||||||
# Autogenerated by PNPM
|
# Autogenerated by PNPM
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
stats
|
@@ -1,11 +1,14 @@
|
|||||||
import { build, InlineConfig } from 'vite';
|
import { build, InlineConfig, type PluginOption } from 'vite';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import jisonPlugin from './jisonPlugin.js';
|
import jisonPlugin from './jisonPlugin.js';
|
||||||
import pkg from '../package.json' assert { type: 'json' };
|
import { readFileSync } from 'fs';
|
||||||
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||||||
|
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';
|
||||||
|
|
||||||
const { dependencies } = pkg;
|
const visualize = process.argv.includes('--visualize');
|
||||||
const watch = process.argv.includes('--watch');
|
const watch = process.argv.includes('--watch');
|
||||||
|
const mermaidOnly = process.argv.includes('--mermaid');
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
|
|
||||||
type OutputOptions = Exclude<
|
type OutputOptions = Exclude<
|
||||||
@@ -13,31 +16,30 @@ type OutputOptions = Exclude<
|
|||||||
undefined
|
undefined
|
||||||
>['output'];
|
>['output'];
|
||||||
|
|
||||||
|
const visualizerOptions = (packageName: string, core = false): PluginOption[] => {
|
||||||
|
if (packageName !== 'mermaid' || !visualize) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return ['network', 'treemap', 'sunburst'].map((chartType) =>
|
||||||
|
visualizer({
|
||||||
|
filename: `./stats/${chartType}${core ? '.core' : ''}.html`,
|
||||||
|
template: chartType as TemplateType,
|
||||||
|
gzipSize: true,
|
||||||
|
brotliSize: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const packageOptions = {
|
const packageOptions = {
|
||||||
mermaid: {
|
mermaid: {
|
||||||
name: 'mermaid',
|
name: 'mermaid',
|
||||||
packageName: 'mermaid',
|
packageName: 'mermaid',
|
||||||
file: 'mermaid.ts',
|
file: 'mermaid.ts',
|
||||||
},
|
},
|
||||||
'mermaid-mindmap': {
|
|
||||||
name: 'mermaid-mindmap',
|
|
||||||
packageName: 'mermaid-mindmap',
|
|
||||||
file: 'add-diagram.ts',
|
|
||||||
},
|
|
||||||
'mermaid-mindmap-detector': {
|
|
||||||
name: 'mermaid-mindmap-detector',
|
|
||||||
packageName: 'mermaid-mindmap',
|
|
||||||
file: 'registry.ts',
|
|
||||||
},
|
|
||||||
'mermaid-example-diagram': {
|
'mermaid-example-diagram': {
|
||||||
name: 'mermaid-example-diagram',
|
name: 'mermaid-example-diagram',
|
||||||
packageName: 'mermaid-example-diagram',
|
packageName: 'mermaid-example-diagram',
|
||||||
file: 'add-diagram.ts',
|
file: 'detector.ts',
|
||||||
},
|
|
||||||
'mermaid-example-diagram-detector': {
|
|
||||||
name: 'mermaid-example-diagram-detector',
|
|
||||||
packageName: 'mermaid-example-diagram',
|
|
||||||
file: 'registry.ts',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,7 +51,7 @@ interface BuildOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
||||||
const external = ['require', 'fs', 'path'];
|
const external: (string | RegExp)[] = ['require', 'fs', 'path'];
|
||||||
console.log(entryName, packageOptions[entryName]);
|
console.log(entryName, packageOptions[entryName]);
|
||||||
const { name, file, packageName } = packageOptions[entryName];
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
let output: OutputOptions = [
|
let output: OutputOptions = [
|
||||||
@@ -68,9 +70,14 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (core) {
|
if (core) {
|
||||||
|
const { dependencies } = JSON.parse(
|
||||||
|
readFileSync(resolve(__dirname, `../packages/${packageName}/package.json`), 'utf-8')
|
||||||
|
);
|
||||||
// Core build is used to generate file without bundled dependencies.
|
// Core build is used to generate file without bundled dependencies.
|
||||||
// This is used by downstream projects to bundle dependencies themselves.
|
// This is used by downstream projects to bundle dependencies themselves.
|
||||||
external.push(...Object.keys(dependencies));
|
// Ignore dependencies and any dependencies of dependencies
|
||||||
|
// Adapted from the RegEx used by `rollup-plugin-node`
|
||||||
|
external.push(new RegExp('^(?:' + Object.keys(dependencies).join('|') + ')(?:/.+)?$'));
|
||||||
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
||||||
output = [
|
output = [
|
||||||
{
|
{
|
||||||
@@ -102,16 +109,12 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.jison', '.js', '.ts', '.json'],
|
extensions: ['.jison', '.js', '.ts', '.json'],
|
||||||
},
|
},
|
||||||
plugins: [jisonPlugin()],
|
plugins: [jisonPlugin(), ...visualizerOptions(packageName, core)],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (watch && config.build) {
|
if (watch && config.build) {
|
||||||
config.build.watch = {
|
config.build.watch = {
|
||||||
include: [
|
include: ['packages/mermaid-example-diagram/src/**', 'packages/mermaid/src/**'],
|
||||||
'packages/mermaid-mindmap/src/**',
|
|
||||||
'packages/mermaid/src/**',
|
|
||||||
'packages/mermaid-example-diagram/src/**',
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,15 +131,19 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
|||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
|
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
|
||||||
for (const pkg of packageNames) {
|
for (const pkg of packageNames.filter((pkg) => !mermaidOnly || pkg === 'mermaid')) {
|
||||||
await buildPackage(pkg);
|
await buildPackage(pkg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (watch) {
|
if (watch) {
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid' }));
|
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' }));
|
if (!mermaidOnly) {
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
||||||
|
}
|
||||||
|
} else if (visualize) {
|
||||||
|
await build(getBuildConfig({ minify: false, core: true, entryName: 'mermaid' }));
|
||||||
|
await build(getBuildConfig({ minify: false, core: false, entryName: 'mermaid' }));
|
||||||
} else {
|
} else {
|
||||||
void main();
|
void main();
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,13 @@
|
|||||||
import express from 'express';
|
import express, { NextFunction, Request, Response } from 'express';
|
||||||
import { createServer as createViteServer } from 'vite';
|
import { createServer as createViteServer } from 'vite';
|
||||||
// import { getBuildConfig } from './build';
|
|
||||||
|
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();
|
||||||
@@ -12,9 +19,10 @@ async function createServer() {
|
|||||||
appType: 'custom', // don't include Vite's default HTML handling middlewares
|
appType: 'custom', // don't include Vite's default HTML handling middlewares
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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(express.static('./packages/mermaid-mindmap/dist'));
|
|
||||||
app.use(vite.middlewares);
|
app.use(vite.middlewares);
|
||||||
app.use(express.static('demos'));
|
app.use(express.static('demos'));
|
||||||
app.use(express.static('cypress/platform'));
|
app.use(express.static('cypress/platform'));
|
||||||
@@ -24,5 +32,4 @@ async function createServer() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// build(getBuildConfig({ minify: false, watch: true }));
|
|
||||||
createServer();
|
createServer();
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"module": "ES2022"
|
|
||||||
}
|
|
||||||
}
|
|
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@@ -12,6 +12,17 @@
|
|||||||
"args": ["run", "${relativeFile}"],
|
"args": ["run", "${relativeFile}"],
|
||||||
"smartStep": true,
|
"smartStep": true,
|
||||||
"console": "integratedTerminal"
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Docs generation",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": ["src/docs.mts"],
|
||||||
|
"runtimeArgs": ["--loader", "ts-node/esm"],
|
||||||
|
"cwd": "${workspaceRoot}/packages/mermaid",
|
||||||
|
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
|
||||||
|
"smartStep": true,
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
128
CODE_OF_CONDUCT.md
Normal file
128
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
- Demonstrating empathy and kindness toward other people
|
||||||
|
- Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
- Giving and gracefully accepting constructive feedback
|
||||||
|
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
- Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
- The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
- Public or private harassment
|
||||||
|
- Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at security@mermaid.live
|
||||||
|
.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
@@ -6,12 +6,23 @@ So you want to help? That's great!
|
|||||||
|
|
||||||
Here are a few things to know to get you started on the right path.
|
Here are a few things to know to get you started on the right path.
|
||||||
|
|
||||||
|
Below link will help you making a copy of the repository in your local system.
|
||||||
|
|
||||||
|
https://docs.github.com/en/get-started/quickstart/fork-a-repo
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- [volta](https://volta.sh/) to manage node versions.
|
||||||
|
- [Node.js](https://nodejs.org/en/). `volta install node`
|
||||||
|
- [pnpm](https://pnpm.io/) package manager. `volta install pnpm`
|
||||||
|
|
||||||
## Development Installation
|
## Development Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:mermaid-js/mermaid.git
|
git clone git@github.com:mermaid-js/mermaid.git
|
||||||
cd mermaid
|
cd mermaid
|
||||||
pnpm install
|
# npx is required for first install as volta support for pnpm is not added yet.
|
||||||
|
npx pnpm install
|
||||||
pnpm test
|
pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -21,7 +32,7 @@ We make all changes via pull requests. As we have many pull requests from develo
|
|||||||
|
|
||||||
- Large changes reviewed by knsv or other developer asked to review by knsv
|
- Large changes reviewed by knsv or other developer asked to review by knsv
|
||||||
- Smaller low-risk changes like dependencies, documentation, etc. can be merged by active collaborators
|
- Smaller low-risk changes like dependencies, documentation, etc. can be merged by active collaborators
|
||||||
- Documentation (updates to the `src/docs` folder is also allowed via direct commits)
|
- Documentation (updates to the `package/mermaid/src/docs` folder is also allowed via direct commits)
|
||||||
|
|
||||||
To commit code, create a branch, let it start with the type like feature or bug followed by the issue number for reference and some describing text.
|
To commit code, create a branch, let it start with the type like feature or bug followed by the issue number for reference and some describing text.
|
||||||
|
|
||||||
@@ -39,16 +50,16 @@ Less strict here, it is OK to commit directly in the `develop` branch if you are
|
|||||||
|
|
||||||
The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
|
The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
|
||||||
|
|
||||||
### Documentation source files are in /src/docs
|
### Documentation source files are in [`/packages/mermaid/src/docs`](packages/mermaid/src/docs)
|
||||||
|
|
||||||
The source files for the project documentation are located in the `/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 `/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.
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart LR
|
flowchart LR
|
||||||
classDef default fill:#fff,color:black,stroke:black
|
classDef default fill:#fff,color:black,stroke:black
|
||||||
|
|
||||||
source["files in /src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]
|
source["files in /packages/mermaid/src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -56,31 +67,22 @@ flowchart LR
|
|||||||
|
|
||||||
### The official documentation site
|
### The official documentation site
|
||||||
|
|
||||||
**[The mermaid documentation site](https://mermaid-js.github.io/mermaid/) is powered by [Docsify](https://docsify.js.org), a simple documentation site generator.**
|
**[The mermaid documentation site](https://mermaid-js.github.io/mermaid/) is powered by [Vitepress](https://vitepress.vuejs.org/), a simple documentation site generator.**
|
||||||
|
|
||||||
If you want to preview the whole documentation site on your machine, you need to install `docsify-cli`:
|
If you want to preview the whole documentation site on your machine:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm i docsify-cli -g
|
cd packages/mermaid
|
||||||
|
pnpm i
|
||||||
|
pnpm docs:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are more familiar with Yarn, you can use the following command:
|
You can now build and serve the documentation site:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ yarn global add docsify-cli
|
pnpm docs:serve
|
||||||
```
|
```
|
||||||
|
|
||||||
The above command will install `docsify-cli` globally.
|
|
||||||
If the installation is successful, the command `docsify` will be available in your `PATH`.
|
|
||||||
|
|
||||||
You can now run the following command to serve the documentation site:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ docsify serve docs
|
|
||||||
```
|
|
||||||
|
|
||||||
Once the local HTTP server is listening, you can point your browser at http://localhost:3000.
|
|
||||||
|
|
||||||
## Branching
|
## Branching
|
||||||
|
|
||||||
Going forward we will use a git flow inspired approach to branching. So development is done in develop, to do the development in the develop.
|
Going forward we will use a git flow inspired approach to branching. So development is done in develop, to do the development in the develop.
|
||||||
@@ -137,11 +139,11 @@ it('should render forks and joins', () => {
|
|||||||
|
|
||||||
Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?
|
Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?
|
||||||
|
|
||||||
The source files for documentation are in `/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated.
|
The source files for documentation are in `/packages/mermaid/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated.
|
||||||
|
|
||||||
#### Adding to or changing the documentation organization
|
#### Adding to or changing the documentation organization
|
||||||
|
|
||||||
If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `src/docs/_sidebar.md`.
|
If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `mermaid/src/docs/.vitepress/config.js`.
|
||||||
|
|
||||||
When changes are committed and then released, they become part of the `master` branch and become part of the published documentation on https://mermaid-js.github.io/mermaid/
|
When changes are committed and then released, they become part of the `master` branch and become part of the published documentation on https://mermaid-js.github.io/mermaid/
|
||||||
|
|
||||||
|
35
README.md
35
README.md
@@ -1,21 +1,6 @@
|
|||||||
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
# mermaid
|
||||||
|
|
||||||
# Whoa, whats going on here?
|
[](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_)
|
||||||
|
|
||||||
We are transforming the Mermaid repository to a so called mono-repo. This is a part of the effort to decouple the diagrams from the core of mermaid. This will:
|
|
||||||
|
|
||||||
- Make it possible to select which diagrams to include on your site
|
|
||||||
- Open up for lazy loading
|
|
||||||
- Make it possible to add diagrams from outside of the Mermaid repository
|
|
||||||
- Separate the release flow between different diagrams and the Mermaid core
|
|
||||||
|
|
||||||
As such be aware of some changes..
|
|
||||||
|
|
||||||
# We use pnpm now
|
|
||||||
|
|
||||||
# The source code has moved
|
|
||||||
|
|
||||||
It is now located in the src folder for each respective package located as subfolders in packages.
|
|
||||||
|
|
||||||
English | [简体中文](./README.zh-CN.md)
|
English | [简体中文](./README.zh-CN.md)
|
||||||
|
|
||||||
@@ -25,7 +10,7 @@ English | [简体中文](./README.zh-CN.md)
|
|||||||
|
|
||||||
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
|
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
|
||||||
|
|
||||||
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
|
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
@@ -41,12 +26,12 @@ Mermaid addresses this problem by enabling users to create easily modifiable dia
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
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/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/integrations.md).
|
Use Mermaid with your 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/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).
|
||||||
|
|
||||||
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/n00b-overview.md), [Usage](./docs/usage.md) and [Tutorials](./docs/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)
|
🌐 [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)
|
||||||
|
|
||||||
@@ -352,7 +337,11 @@ To report a vulnerability, please e-mail security@mermaid.live with a descriptio
|
|||||||
|
|
||||||
A quick note from Knut Sveidqvist:
|
A quick note from Knut Sveidqvist:
|
||||||
|
|
||||||
> _Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!_ >_Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering._ >_Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017._
|
> _Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!_
|
||||||
|
>
|
||||||
|
> _Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering._
|
||||||
|
>
|
||||||
|
> _Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017._
|
||||||
>
|
>
|
||||||
> _Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!_
|
> _Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!_
|
||||||
|
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
# mermaid
|
||||||
|
|
||||||
|
[](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_)
|
||||||
|
|
||||||
[English](./README.md) | 简体中文
|
[English](./README.md) | 简体中文
|
||||||
|
|
||||||
@@ -8,7 +10,7 @@
|
|||||||
|
|
||||||
**感谢所有参与进来提交 PR,解答疑问的人们! 🙏**
|
**感谢所有参与进来提交 PR,解答疑问的人们! 🙏**
|
||||||
|
|
||||||
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/img/book-banner-pre-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
|
<a href="https://mermaid-js.github.io/mermaid/landing/"><img src="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
|
||||||
|
|
||||||
## 关于 Mermaid
|
## 关于 Mermaid
|
||||||
|
|
||||||
@@ -22,9 +24,9 @@ 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/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/misc/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
||||||
|
|
||||||
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/n00b-overview.md), [用法](./docs/usage.md) 和 [教程](./docs/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)
|
🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [文档](https://mermaidjs.github.io) | 🙌 [贡献](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [更新日志](./docs/CHANGELOG.md)
|
||||||
|
|
||||||
@@ -37,7 +39,7 @@ Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://merma
|
|||||||
<table>
|
<table>
|
||||||
<!-- <Flowchart> -->
|
<!-- <Flowchart> -->
|
||||||
|
|
||||||
### 流程图 [<a href="https://mermaid-js.github.io/mermaid/#/flowchart">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
### 流程图 [<a href="https://mermaid-js.github.io/mermaid/#/flowchart">文档</a> - <a href="https://mermaid.live/edit#base64:eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0hhcmRdIC0tPnxUZXh0fCBCKFJvdW5kKVxuICAgIEIgLS0-IEN7RGVjaXNpb259XG4gICAgQyAtLT58T25lfCBEW1Jlc3VsdCAxXVxuICAgIEMgLS0-fFR3b3wgRVtSZXN1bHQgMl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
flowchart LR
|
flowchart LR
|
||||||
@@ -55,7 +57,7 @@ C -->|One| D[Result 1]
|
|||||||
C -->|Two| E[Result 2]
|
C -->|Two| E[Result 2]
|
||||||
```
|
```
|
||||||
|
|
||||||
### 时序图 [<a href="https://mermaid-js.github.io/mermaid/#/sequenceDiagram">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
### 时序图 [<a href="https://mermaid-js.github.io/mermaid/#/sequenceDiagram">文档</a> - <a href="https://mermaid.live/edit#base64:eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG5BbGljZS0-PkpvaG46IEhlbGxvIEpvaG4sIGhvdyBhcmUgeW91P1xubG9vcCBIZWFsdGhjaGVja1xuICAgIEpvaG4tPj5Kb2huOiBGaWdodCBhZ2FpbnN0IGh5cG9jaG9uZHJpYVxuZW5kXG5Ob3RlIHJpZ2h0IG9mIEpvaG46IFJhdGlvbmFsIHRob3VnaHRzIVxuSm9obi0tPj5BbGljZTogR3JlYXQhXG5Kb2huLT4-Qm9iOiBIb3cgYWJvdXQgeW91P1xuQm9iLS0-PkpvaG46IEpvbGx5IGdvb2QhIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
@@ -81,7 +83,7 @@ John->>Bob: How about you?
|
|||||||
Bob-->>John: Jolly good!
|
Bob-->>John: Jolly good!
|
||||||
```
|
```
|
||||||
|
|
||||||
### 甘特图 [<a href="https://mermaid-js.github.io/mermaid/#/gantt">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
### 甘特图 [<a href="https://mermaid-js.github.io/mermaid/#/gantt">文档</a> - <a href="https://mermaid.live/edit#base64:eyJjb2RlIjoiZ2FudHRcbnNlY3Rpb24gU2VjdGlvblxuQ29tcGxldGVkIDpkb25lLCAgICBkZXMxLCAyMDE0LTAxLTA2LDIwMTQtMDEtMDhcbkFjdGl2ZSAgICAgICAgOmFjdGl2ZSwgIGRlczIsIDIwMTQtMDEtMDcsIDNkXG5QYXJhbGxlbCAxICAgOiAgICAgICAgIGRlczMsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAyICAgOiAgICAgICAgIGRlczQsIGFmdGVyIGRlczEsIDFkXG5QYXJhbGxlbCAzICAgOiAgICAgICAgIGRlczUsIGFmdGVyIGRlczMsIDFkXG5QYXJhbGxlbCA0ICAgOiAgICAgICAgIGRlczYsIGFmdGVyIGRlczQsIDFkIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
gantt
|
gantt
|
||||||
@@ -105,7 +107,7 @@ gantt
|
|||||||
Parallel 4 : des6, after des4, 1d
|
Parallel 4 : des6, after des4, 1d
|
||||||
```
|
```
|
||||||
|
|
||||||
### 类图 [<a href="https://mermaid-js.github.io/mermaid/#/classDiagram">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
### 类图 [<a href="https://mermaid-js.github.io/mermaid/#/classDiagram">文档</a> - <a href="https://mermaid.live/edit#base64:eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5DbGFzczAxIDx8LS0gQXZlcnlMb25nQ2xhc3MgOiBDb29sXG48PGludGVyZmFjZT4-IENsYXNzMDFcbkNsYXNzMDkgLS0-IEMyIDogV2hlcmUgYW0gaT9cbkNsYXNzMDkgLS0qIEMzXG5DbGFzczA5IC0tfD4gQ2xhc3MwN1xuQ2xhc3MwNyA6IGVxdWFscygpXG5DbGFzczA3IDogT2JqZWN0W10gZWxlbWVudERhdGFcbkNsYXNzMDEgOiBzaXplKClcbkNsYXNzMDEgOiBpbnQgY2hpbXBcbkNsYXNzMDEgOiBpbnQgZ29yaWxsYVxuY2xhc3MgQ2xhc3MxMCB7XG4gID4-c2VydmljZT4-XG4gIGludCBpZFxuICBzaXplKClcbn0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
classDiagram
|
classDiagram
|
||||||
@@ -145,7 +147,7 @@ class Class10 {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 状态图 [[<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtLXYyXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoid2hpdGUiLCJwcmltYXJ5Q29sb3IiOiIjRUNFQ0ZGIiwic2Vjb25kYXJ5Q29sb3IiOiIjZmZmZmRlIiwidGVydGlhcnlDb2xvciI6ImhzbCg4MCwgMTAwJSwgOTYuMjc0NTA5ODAzOSUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDI0MCwgNjAlLCA4Ni4yNzQ1MDk4MDM5JSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xvciI6ImhzbCg2MCwgNjAlLCA4My41Mjk0MTE3NjQ3JSkiLCJ0ZXJ0aWFyeUJvcmRlckNvbG9yIjoiaHNsKDgwLCA2MCUsIDg2LjI3NDUwOTgwMzklKSIsInByaW1hcnlUZXh0Q29sb3IiOiIjMTMxMzAwIiwic2Vjb25kYXJ5VGV4dENvbG9yIjoiIzAwMDAyMSIsInRlcnRpYXJ5VGV4dENvbG9yIjoicmdiKDkuNTAwMDAwMDAwMSwgOS41MDAwMDAwMDAxLCA5LjUwMDAwMDAwMDEpIiwibGluZUNvbG9yIjoiIzMzMzMzMyIsInRleHRDb2xvciI6IiMzMzMiLCJtYWluQmtnIjoiI0VDRUNGRiIsInNlY29uZEJrZyI6IiNmZmZmZGUiLCJib3JkZXIxIjoiIzkzNzBEQiIsImJvcmRlcjIiOiIjYWFhYTMzIiwiYXJyb3doZWFkQ29sb3IiOiIjMzMzMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwibGFiZWxCYWNrZ3JvdW5kIjoiI2U4ZThlOCIsIm5vZGVCa2ciOiIjRUNFQ0ZGIiwibm9kZUJvcmRlciI6IiM5MzcwREIiLCJjbHVzdGVyQmtnIjoiI2ZmZmZkZSIsImNsdXN0ZXJCb3JkZXIiOiIjYWFhYTMzIiwiZGVmYXVsdExpbmtDb2xvciI6IiMzMzMzMzMiLCJ0aXRsZUNvbG9yIjoiIzMzMyIsImVkZ2VMYWJlbEJhY2tncm91bmQiOiIjZThlOGU4IiwiYWN0b3JCb3JkZXIiOiJoc2woMjU5LjYyNjE2ODIyNDMsIDU5Ljc3NjUzNjMxMjglLCA4Ny45MDE5NjA3ODQzJSkiLCJhY3RvckJrZyI6IiNFQ0VDRkYiLCJhY3RvclRleHRDb2xvciI6ImJsYWNrIiwiYWN0b3JMaW5lQ29sb3IiOiJncmV5Iiwic2lnbmFsQ29sb3IiOiIjMzMzIiwic2lnbmFsVGV4dENvbG9yIjoiIzMzMyIsImxhYmVsQm94QmtnQ29sb3IiOiIjRUNFQ0ZGIiwibGFiZWxCb3hCb3JkZXJDb2xvciI6ImhzbCgyNTkuNjI2MTY4MjI0MywgNTkuNzc2NTM2MzEyOCUsIDg3LjkwMTk2MDc4NDMlKSIsImxhYmVsVGV4dENvbG9yIjoiYmxhY2siLCJsb29wVGV4dENvbG9yIjoiYmxhY2siLCJub3RlQm9yZGVyQ29sb3IiOiIjYWFhYTMzIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiJibGFjayIsImFjdGl2YXRpb25Cb3JkZXJDb2xvciI6IiM2NjYiLCJhY3RpdmF0aW9uQmtnQ29sb3IiOiIjZjRmNGY0Iiwic2VxdWVuY2VOdW1iZXJDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yIjoicmdiYSgxMDIsIDEwMiwgMjU1LCAwLjQ5KSIsImFsdFNlY3Rpb25Ca2dDb2xvciI6IndoaXRlIiwic2VjdGlvbkJrZ0NvbG9yMiI6IiNmZmY0MDAiLCJ0YXNrQm9yZGVyQ29sb3IiOiIjNTM0ZmJjIiwidGFza0JrZ0NvbG9yIjoiIzhhOTBkZCIsInRhc2tUZXh0TGlnaHRDb2xvciI6IndoaXRlIiwidGFza1RleHRDb2xvciI6IndoaXRlIiwidGFza1RleHREYXJrQ29sb3IiOiJibGFjayIsInRhc2tUZXh0T3V0c2lkZUNvbG9yIjoiYmxhY2siLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImFjdGl2ZVRhc2tCb3JkZXJDb2xvciI6IiM1MzRmYmMiLCJhY3RpdmVUYXNrQmtnQ29sb3IiOiIjYmZjN2ZmIiwiZ3JpZENvbG9yIjoibGlnaHRncmV5IiwiZG9uZVRhc2tCa2dDb2xvciI6ImxpZ2h0Z3JleSIsImRvbmVUYXNrQm9yZGVyQ29sb3IiOiJncmV5IiwiY3JpdEJvcmRlckNvbG9yIjoiI2ZmODg4OCIsImNyaXRCa2dDb2xvciI6InJlZCIsInRvZGF5TGluZUNvbG9yIjoicmVkIiwibGFiZWxDb2xvciI6ImJsYWNrIiwiZXJyb3JCa2dDb2xvciI6IiM1NTIyMjIiLCJlcnJvclRleHRDb2xvciI6IiM1NTIyMjIiLCJjbGFzc1RleHQiOiIjMTMxMzAwIiwiZmlsbFR5cGUwIjoiI0VDRUNGRiIsImZpbGxUeXBlMSI6IiNmZmZmZGUiLCJmaWxsVHlwZTIiOiJoc2woMzA0LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTMiOiJoc2woMTI0LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkiLCJmaWxsVHlwZTQiOiJoc2woMTc2LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTUiOiJoc2woLTQsIDEwMCUsIDkzLjUyOTQxMTc2NDclKSIsImZpbGxUeXBlNiI6ImhzbCg4LCAxMDAlLCA5Ni4yNzQ1MDk4MDM5JSkiLCJmaWxsVHlwZTciOiJoc2woMTg4LCAxMDAlLCA5My41Mjk0MTE3NjQ3JSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9">live editor</a>]
|
### 状态图 [[<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkLsOwjAMRX-l8ojahTEDCzB26kgYrMYtkfJAqVMJVf13QiIKqqfr44d8vUDvFYGAiZHponEMaJv5KF2V4na4V01zqjrWxhSUZYapuEetn7UbCy16P_5HzwGnR6FZfpdCDZaCRa3SWcunQQI_yJIEkaSiAaNhCdKtqRUj--7lehAcItUQn-pnBMSAZtroVWn2YYOU07b4z29Y37gJVYk">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
stateDiagram-v2
|
stateDiagram-v2
|
||||||
@@ -167,7 +169,7 @@ Moving --> Crash
|
|||||||
Crash --> [*]
|
Crash --> [*]
|
||||||
```
|
```
|
||||||
|
|
||||||
### 饼图 [<a href="https://mermaid-js.github.io/mermaid/#/pie">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
### 饼图 [<a href="https://mermaid-js.github.io/mermaid/#/pie">文档</a> - <a href="https://mermaid.live/edit#base64:eyJjb2RlIjoicGllXG5cIkRvZ3NcIiA6IDQyLjk2XG5cIkNhdHNcIiA6IDUwLjA1XG5cIlJhdHNcIiA6IDEwLjAxIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
pie
|
pie
|
||||||
@@ -183,9 +185,9 @@ pie
|
|||||||
"Rats" : 15
|
"Rats" : 15
|
||||||
```
|
```
|
||||||
|
|
||||||
### Git 图 [实验特性 - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
### Git 图 [实验特性 - <a href="https://mermaid.live/edit#base64:eyJjb2RlIjoiZ2l0R3JhcGg6XG5vcHRpb25zXG57XG4gICAgXCJub2RlU3BhY2luZ1wiOiAxNTAsXG4gICAgXCJub2RlUmFkaXVzXCI6IDEwXG59XG5lbmRcbmNvbW1pdFxuYnJhbmNoIG5ld2JyYW5jaFxuY2hlY2tvdXQgbmV3YnJhbmNoXG5jb21taXRcbmNvbW1pdFxuY2hlY2tvdXQgbWFzdGVyXG5jb21taXRcbmNvbW1pdFxubWVyZ2UgbmV3YnJhbmNoXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ">live editor</a>]
|
||||||
|
|
||||||
### 用户体验旅程图 [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">文档</a> - <a href="https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoic3RhdGVEaWFncmFtXG4gICAgWypdIC0tPiBTdGlsbFxuICAgIFN0aWxsIC0tPiBbKl1cbiAgICBTdGlsbCAtLT4gTW92aW5nXG4gICAgTW92aW5nIC0tPiBTdGlsbFxuICAgIE1vdmluZyAtLT4gQ3Jhc2hcbiAgICBDcmFzaCAtLT4gWypdIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0">live editor</a>]
|
### 用户体验旅程图 [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">文档</a> - <a href="https://mermaid.live/edit#pako:eNpljzEPgkAMhf9K05nFGJdbJXFiYmVpuKIncDVHL4QQ_ruHaILaqXnf63vpjLVYRoMAd4nB81R5SKNOO4ZiglFC6_wVLL3JwLU68XARUHnhTQcoqGVQJgMnAwV_5GSMj0HJhcHAcU_y7d7AYVUzOJP-ddyk3ydZGf0n66uldPqCPxWYYc-hJ2fTj_OqVqg3Tplo0mq5odhphZVfkpWiSjn5Go2GyBnGhyXl3NE1UI-moW7g5QkSoF5m">live editor</a>]
|
||||||
|
|
||||||
```
|
```
|
||||||
journey
|
journey
|
||||||
|
5
V10-BreakingChanges.md
Normal file
5
V10-BreakingChanges.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# 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
|
21
__mocks__/c4Renderer.js
Normal file
21
__mocks__/c4Renderer.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Mocked C4Context diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const drawPersonOrSystemArray = vi.fn();
|
||||||
|
export const drawBoundary = vi.fn();
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
drawPersonOrSystemArray,
|
||||||
|
drawBoundary,
|
||||||
|
setConf,
|
||||||
|
draw,
|
||||||
|
};
|
16
__mocks__/classRenderer-v2.js
Normal file
16
__mocks__/classRenderer-v2.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Mocked class diagram v2 renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
draw,
|
||||||
|
};
|
13
__mocks__/classRenderer.js
Normal file
13
__mocks__/classRenderer.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* Mocked class diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
draw,
|
||||||
|
};
|
@@ -1,67 +1,14 @@
|
|||||||
// @ts-nocheck TODO: Fix TS
|
// @ts-nocheck TODO: Fix TS
|
||||||
import { vi } from 'vitest';
|
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3';
|
||||||
|
|
||||||
const NewD3 = function () {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function returnThis() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
append: function () {
|
|
||||||
return NewD3();
|
|
||||||
},
|
|
||||||
lower: returnThis,
|
|
||||||
attr: returnThis,
|
|
||||||
style: returnThis,
|
|
||||||
text: returnThis,
|
|
||||||
0: {
|
|
||||||
0: {
|
|
||||||
getBBox: function () {
|
|
||||||
return {
|
|
||||||
height: 10,
|
|
||||||
width: 20,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const select = function () {
|
export const select = function () {
|
||||||
return new NewD3();
|
return new MockedD3();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const selectAll = function () {
|
export const selectAll = function () {
|
||||||
return new NewD3();
|
return new MockedD3();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const curveBasis = 'basis';
|
export const curveBasis = 'basis';
|
||||||
export const curveLinear = 'linear';
|
export const curveLinear = 'linear';
|
||||||
export const curveCardinal = 'cardinal';
|
export const curveCardinal = 'cardinal';
|
||||||
|
|
||||||
export const MockD3 = (name, parent) => {
|
|
||||||
const children = [];
|
|
||||||
const elem = {
|
|
||||||
get __children() {
|
|
||||||
return children;
|
|
||||||
},
|
|
||||||
get __name() {
|
|
||||||
return name;
|
|
||||||
},
|
|
||||||
get __parent() {
|
|
||||||
return parent;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
elem.append = (name) => {
|
|
||||||
const mockElem = MockD3(name, elem);
|
|
||||||
children.push(mockElem);
|
|
||||||
return mockElem;
|
|
||||||
};
|
|
||||||
elem.lower = vi.fn(() => elem);
|
|
||||||
elem.attr = vi.fn(() => elem);
|
|
||||||
elem.text = vi.fn(() => elem);
|
|
||||||
elem.style = vi.fn(() => elem);
|
|
||||||
return elem;
|
|
||||||
};
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
import { vi } from 'vitest';
|
// DO NOT delete this file. It is used by vitest to mock the dagre-d3 module.
|
||||||
|
|
||||||
// export const render = vi.fn();
|
|
||||||
|
16
__mocks__/erRenderer.js
Normal file
16
__mocks__/erRenderer.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Mocked er diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
draw,
|
||||||
|
};
|
24
__mocks__/flowRenderer-v2.js
Normal file
24
__mocks__/flowRenderer-v2.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Mocked flow (flowchart) diagram v2 renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
export const addVertices = vi.fn();
|
||||||
|
export const addEdges = vi.fn();
|
||||||
|
export const getClasses = vi.fn().mockImplementation(() => {
|
||||||
|
return {};
|
||||||
|
});
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
addVertices,
|
||||||
|
addEdges,
|
||||||
|
getClasses,
|
||||||
|
draw,
|
||||||
|
};
|
16
__mocks__/ganttRenderer.js
Normal file
16
__mocks__/ganttRenderer.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Mocked gantt diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
draw,
|
||||||
|
};
|
13
__mocks__/gitGraphRenderer.js
Normal file
13
__mocks__/gitGraphRenderer.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* Mocked git (graph) diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
draw,
|
||||||
|
};
|
15
__mocks__/journeyRenderer.js
Normal file
15
__mocks__/journeyRenderer.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Mocked pie (picChart) diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
draw,
|
||||||
|
};
|
13
__mocks__/pieRenderer.js
Normal file
13
__mocks__/pieRenderer.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* Mocked pie (picChart) diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
draw,
|
||||||
|
};
|
13
__mocks__/requirementRenderer.js
Normal file
13
__mocks__/requirementRenderer.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* Mocked requirement diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
draw,
|
||||||
|
};
|
23
__mocks__/sequenceRenderer.js
Normal file
23
__mocks__/sequenceRenderer.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Mocked sequence diagram renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const bounds = vi.fn();
|
||||||
|
export const drawActors = vi.fn();
|
||||||
|
export const drawActorsPopup = vi.fn();
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
bounds,
|
||||||
|
drawActors,
|
||||||
|
drawActorsPopup,
|
||||||
|
setConf,
|
||||||
|
draw,
|
||||||
|
};
|
22
__mocks__/stateRenderer-v2.js
Normal file
22
__mocks__/stateRenderer-v2.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* Mocked state diagram v2 renderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
export const setConf = vi.fn();
|
||||||
|
export const getClasses = vi.fn().mockImplementation(() => {
|
||||||
|
return {};
|
||||||
|
});
|
||||||
|
export const stateDomId = vi.fn().mockImplementation(() => {
|
||||||
|
return 'mocked-stateDiagram-stateDomId';
|
||||||
|
});
|
||||||
|
export const draw = vi.fn().mockImplementation(() => {
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
getClasses,
|
||||||
|
draw,
|
||||||
|
};
|
@@ -15,5 +15,5 @@ module.exports = defineConfig({
|
|||||||
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
||||||
],
|
],
|
||||||
// set batch name to the configuration
|
// set batch name to the configuration
|
||||||
batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
|
// batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
|
||||||
});
|
});
|
||||||
|
151
cSpell.json
Normal file
151
cSpell.json
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2",
|
||||||
|
"language": "en",
|
||||||
|
"words": [
|
||||||
|
"acyclicer",
|
||||||
|
"adamiecki",
|
||||||
|
"alois",
|
||||||
|
"antiscript",
|
||||||
|
"appli",
|
||||||
|
"applitools",
|
||||||
|
"asciidoctor",
|
||||||
|
"ashish",
|
||||||
|
"astah",
|
||||||
|
"bbox",
|
||||||
|
"bilkent",
|
||||||
|
"bisheng",
|
||||||
|
"blrs",
|
||||||
|
"braintree",
|
||||||
|
"brkt",
|
||||||
|
"brolin",
|
||||||
|
"brotli",
|
||||||
|
"classdef",
|
||||||
|
"codedoc",
|
||||||
|
"colour",
|
||||||
|
"cpettitt",
|
||||||
|
"customizability",
|
||||||
|
"cuzon",
|
||||||
|
"cytoscape",
|
||||||
|
"dagre",
|
||||||
|
"descr",
|
||||||
|
"docsify",
|
||||||
|
"docsy",
|
||||||
|
"doku",
|
||||||
|
"dompurify",
|
||||||
|
"edgechromium",
|
||||||
|
"elkjs",
|
||||||
|
"faber",
|
||||||
|
"flatmap",
|
||||||
|
"ftplugin",
|
||||||
|
"gantt",
|
||||||
|
"gitea",
|
||||||
|
"gitgraph",
|
||||||
|
"globby",
|
||||||
|
"graphlib",
|
||||||
|
"graphviz",
|
||||||
|
"grav",
|
||||||
|
"greywolf",
|
||||||
|
"inkdrop",
|
||||||
|
"jaoude",
|
||||||
|
"jison",
|
||||||
|
"kaufmann",
|
||||||
|
"khroma",
|
||||||
|
"klemm",
|
||||||
|
"klink",
|
||||||
|
"knsv",
|
||||||
|
"knut",
|
||||||
|
"laganeckas",
|
||||||
|
"lintstagedrc",
|
||||||
|
"logmsg",
|
||||||
|
"lucida",
|
||||||
|
"matthieu",
|
||||||
|
"mdast",
|
||||||
|
"mdbook",
|
||||||
|
"mermerd",
|
||||||
|
"mindaugas",
|
||||||
|
"mindmap",
|
||||||
|
"mindmaps",
|
||||||
|
"mitigations",
|
||||||
|
"mkdocs",
|
||||||
|
"mult",
|
||||||
|
"orlandoni",
|
||||||
|
"phpbb",
|
||||||
|
"plantuml",
|
||||||
|
"playfair",
|
||||||
|
"pnpm",
|
||||||
|
"podlite",
|
||||||
|
"quence",
|
||||||
|
"radious",
|
||||||
|
"ranksep",
|
||||||
|
"rect",
|
||||||
|
"rects",
|
||||||
|
"redmine",
|
||||||
|
"roledescription",
|
||||||
|
"sandboxed",
|
||||||
|
"setupgraphviewbox",
|
||||||
|
"shiki",
|
||||||
|
"sidharth",
|
||||||
|
"sidharthv",
|
||||||
|
"sphinxcontrib",
|
||||||
|
"statediagram",
|
||||||
|
"stylis",
|
||||||
|
"substate",
|
||||||
|
"sveidqvist",
|
||||||
|
"swimm",
|
||||||
|
"techn",
|
||||||
|
"teststr",
|
||||||
|
"textlength",
|
||||||
|
"treemap",
|
||||||
|
"ts-nocheck",
|
||||||
|
"tuleap",
|
||||||
|
"ugge",
|
||||||
|
"unist",
|
||||||
|
"verdana",
|
||||||
|
"viewports",
|
||||||
|
"vinod",
|
||||||
|
"visio",
|
||||||
|
"vitepress",
|
||||||
|
"xlink",
|
||||||
|
"yash"
|
||||||
|
],
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "Markdown links", "pattern": "\\((.*)\\)", "description": "" },
|
||||||
|
{
|
||||||
|
"name": "Markdown code blocks",
|
||||||
|
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
|
||||||
|
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Inline code blocks",
|
||||||
|
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
|
||||||
|
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
|
||||||
|
},
|
||||||
|
{ "name": "Link contents", "pattern": "\\<a(.*)\\>", "description": "" },
|
||||||
|
{ "name": "Snippet references", "pattern": "-- snippet:(.*)", "description": "" },
|
||||||
|
{
|
||||||
|
"name": "Snippet references 2",
|
||||||
|
"pattern": "\\<\\[sample:(.*)",
|
||||||
|
"description": "another kind of snippet reference"
|
||||||
|
},
|
||||||
|
{ "name": "Multi-line code blocks", "pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm" },
|
||||||
|
{
|
||||||
|
"name": "HTML Tags",
|
||||||
|
"pattern": "<[^>]*>",
|
||||||
|
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ignoreRegExpList": [
|
||||||
|
"Markdown links",
|
||||||
|
"Markdown code blocks",
|
||||||
|
"Inline code blocks",
|
||||||
|
"Link contents",
|
||||||
|
"Snippet references",
|
||||||
|
"Snippet references 2",
|
||||||
|
"Multi-line code blocks",
|
||||||
|
"HTML Tags"
|
||||||
|
],
|
||||||
|
"ignorePaths": [
|
||||||
|
"packages/mermaid/src/docs/CHANGELOG.md",
|
||||||
|
"packages/mermaid/src/docs/.vitepress/redirect.ts"
|
||||||
|
]
|
||||||
|
}
|
@@ -2,6 +2,8 @@ const utf8ToB64 = (str) => {
|
|||||||
return window.btoa(unescape(encodeURIComponent(str)));
|
return window.btoa(unescape(encodeURIComponent(str)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const batchId = 'mermaid-batch' + new Date().getTime();
|
||||||
|
|
||||||
export const mermaidUrl = (graphStr, options, api) => {
|
export const mermaidUrl = (graphStr, options, api) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
code: graphStr,
|
code: graphStr,
|
||||||
@@ -44,83 +46,48 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
|
|||||||
if (!options.fontSize) {
|
if (!options.fontSize) {
|
||||||
options.fontSize = '16px';
|
options.fontSize = '16px';
|
||||||
}
|
}
|
||||||
const useAppli = Cypress.env('useAppli');
|
|
||||||
//const useAppli = false;
|
|
||||||
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
|
||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
|
||||||
|
|
||||||
if (useAppli) {
|
|
||||||
cy.eyesOpen({
|
|
||||||
appName: 'Mermaid',
|
|
||||||
testName: name,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = mermaidUrl(graphStr, options, api);
|
const url = mermaidUrl(graphStr, options, api);
|
||||||
|
openURLAndVerifyRendering(url, options, validation);
|
||||||
cy.visit(url);
|
|
||||||
if (validation) cy.get('svg').should(validation);
|
|
||||||
cy.get('svg');
|
|
||||||
// Default name to test title
|
|
||||||
|
|
||||||
if (useAppli) {
|
|
||||||
cy.eyesCheckWindow('Click!');
|
|
||||||
cy.eyesClose();
|
|
||||||
} else {
|
|
||||||
cy.matchImageSnapshot(name);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
||||||
cy.log(_options);
|
|
||||||
const options = Object.assign(_options);
|
const options = Object.assign(_options);
|
||||||
if (!options.fontFamily) {
|
openURLAndVerifyRendering(url, options, validation);
|
||||||
options.fontFamily = 'courier';
|
|
||||||
}
|
|
||||||
if (!options.sequence) {
|
|
||||||
options.sequence = {};
|
|
||||||
}
|
|
||||||
if (!options.sequence || (options.sequence && !options.sequence.actorFontFamily)) {
|
|
||||||
options.sequence.actorFontFamily = 'courier';
|
|
||||||
}
|
|
||||||
if (options.sequence && !options.sequence.noteFontFamily) {
|
|
||||||
options.sequence.noteFontFamily = 'courier';
|
|
||||||
}
|
|
||||||
options.sequence.actorFontFamily = 'courier';
|
|
||||||
options.sequence.noteFontFamily = 'courier';
|
|
||||||
options.sequence.messageFontFamily = 'courier';
|
|
||||||
if (options.sequence && !options.sequence.actorFontFamily) {
|
|
||||||
options.sequence.actorFontFamily = 'courier';
|
|
||||||
}
|
|
||||||
if (!options.fontSize) {
|
|
||||||
options.fontSize = '16px';
|
|
||||||
}
|
|
||||||
const useAppli = Cypress.env('useAppli');
|
|
||||||
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
|
||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
|
||||||
|
|
||||||
if (useAppli) {
|
|
||||||
cy.eyesOpen({
|
|
||||||
appName: 'Mermaid',
|
|
||||||
testName: name,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
cy.visit(url);
|
|
||||||
if (validation) cy.get('svg').should(validation);
|
|
||||||
cy.get('body');
|
|
||||||
// Default name to test title
|
|
||||||
|
|
||||||
if (useAppli) {
|
|
||||||
cy.eyesCheckWindow('Click!');
|
|
||||||
cy.eyesClose();
|
|
||||||
} else {
|
|
||||||
cy.matchImageSnapshot(name);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const renderGraph = (graphStr, options, api) => {
|
export const renderGraph = (graphStr, options, api) => {
|
||||||
const url = mermaidUrl(graphStr, options, api);
|
const url = mermaidUrl(graphStr, options, api);
|
||||||
|
openURLAndVerifyRendering(url, options);
|
||||||
|
};
|
||||||
|
|
||||||
|
const openURLAndVerifyRendering = (url, options, validation = undefined) => {
|
||||||
|
const useAppli = Cypress.env('useAppli');
|
||||||
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
|
if (useAppli) {
|
||||||
|
cy.log('Opening eyes ' + Cypress.spec.name + ' --- ' + name);
|
||||||
|
cy.eyesOpen({
|
||||||
|
appName: 'Mermaid',
|
||||||
|
testName: name,
|
||||||
|
batchName: Cypress.spec.name,
|
||||||
|
batchId: batchId + Cypress.spec.name,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
|
cy.window().should('have.property', 'rendered', true);
|
||||||
|
cy.get('svg').should('be.visible');
|
||||||
|
|
||||||
|
if (validation) {
|
||||||
|
cy.get('svg').should(validation);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useAppli) {
|
||||||
|
cy.log('Check eyes' + Cypress.spec.name);
|
||||||
|
cy.eyesCheckWindow('Click!');
|
||||||
|
cy.log('Closing eyes' + Cypress.spec.name);
|
||||||
|
cy.eyesClose();
|
||||||
|
} else {
|
||||||
|
cy.matchImageSnapshot(name);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
10
cypress/integration/other/external-diagrams.spec.js
Normal file
10
cypress/integration/other/external-diagrams.spec.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { urlSnapshotTest } from '../../helpers/util';
|
||||||
|
|
||||||
|
describe('mermaid', () => {
|
||||||
|
describe('registerDiagram', () => {
|
||||||
|
it('should work on @mermaid-js/mermaid-example-diagram', () => {
|
||||||
|
const url = 'http://localhost:9000/external-diagrams-example-diagram.html';
|
||||||
|
urlSnapshotTest(url, {}, false, false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -7,4 +7,10 @@ describe('CSS injections', () => {
|
|||||||
flowchart: { htmlLabels: false },
|
flowchart: { htmlLabels: false },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('should not allow adding styletags affecting the page', () => {
|
||||||
|
urlSnapshotTest('http://localhost:9000/ghsa3.html', {
|
||||||
|
logLevel: 1,
|
||||||
|
flowchart: { htmlLabels: false },
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,266 +1,180 @@
|
|||||||
describe('Interaction', () => {
|
describe('Interaction', () => {
|
||||||
describe('Interaction - security level loose', () => {
|
describe('Security level loose', () => {
|
||||||
it('Graph: should handle a click on a node with a bound function', () => {
|
beforeEach(() => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.visit('http://localhost:9000/click_security_loose.html');
|
||||||
cy.viewport(1440, 1024);
|
});
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-4').click();
|
|
||||||
|
|
||||||
|
it('Graph: should handle a click on a node with a bound function', () => {
|
||||||
|
cy.contains('FunctionTest1').parents('.node').click();
|
||||||
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Graph: should handle a click on a node with a bound function with args', () => {
|
it('Graph: should handle a click on a node with a bound function with args', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('FunctionArgTest2').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-FunctionArg-28').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Flowchart: should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('Flowchart: should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('2FunctionArg').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-FunctionArg-34"]').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
||||||
});
|
});
|
||||||
it('Graph: should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('#flowchart-URL-5').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Graph: should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
// When there is a URL, cy.contains selects the a tag instead of the span. The .node is a child of a, so we have to use find instead of parent.
|
||||||
|
cy.contains('URLTest1').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('Graph: should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-2URL-11"]').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Graph: should handle a click on a node with a bound url where the node starts with a number', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('2URL').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound function', () => {
|
it('Flowchart-v2: should handle a click on a node with a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('FunctionTest2').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-16').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('Flowchart-v2: should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('10Function').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-1Function-22"]').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
||||||
});
|
});
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('#flowchart-URL-17').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Flowchart-v2: should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('URLTest2').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-2URL-23"]').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Flowchart-v2: should handle a click on a node with a bound url where the node starts with a number', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('20URL').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.get('rect#cl1').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('rect#cl1').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.get('text#cl1-text').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('text#cl1-text').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function without args', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl2').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function without args', () => {
|
||||||
|
cy.get('rect#cl2').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function with args', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl3').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function with args', () => {
|
||||||
|
cy.get('rect#cl3').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound function without args', () => {
|
it('should handle a click on a task with a bound function without args', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.get('text#cl2-text').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
||||||
|
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function with args ', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl3-text').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function with args ', () => {
|
||||||
|
cy.get('text#cl3-text').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Interaction - security level tight', () => {
|
describe('Interaction - security level tight', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit('http://localhost:9000/click_security_strict.html');
|
||||||
|
});
|
||||||
it('should handle a click on a node without a bound function', () => {
|
it('should handle a click on a node without a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.contains('Function1').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-4').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
// cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.contains('1Function').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-1Function-10"]').click();
|
|
||||||
|
|
||||||
// cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-URL-5').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('URL1').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-2URL-11"]').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('should handle a click on a node with a bound url where the node starts with a number', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('2URL').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.get('rect#cl1').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('rect#cl1').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.get('text#cl1-text').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('text#cl1-text').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl2').click({ force: true });
|
|
||||||
|
|
||||||
// cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
|
it('should handle a click on a task with a bound function', () => {
|
||||||
|
cy.get('rect#cl2').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
||||||
|
|
||||||
// cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
|
it('should handle a click on a task with a bound function', () => {
|
||||||
|
cy.get('text#cl2-text').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Interaction - security level other, missspelling', () => {
|
describe('Interaction - security level other, missspelling', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit('http://localhost:9000/click_security_other.html');
|
||||||
|
});
|
||||||
|
|
||||||
it('should handle a click on a node with a bound function', () => {
|
it('should handle a click on a node with a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
cy.contains('Function1').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-4').click();
|
|
||||||
|
|
||||||
// cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
cy.contains('1Function').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-1Function-10"]').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-URL-5').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('URL1').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound function', () => {
|
it('should handle a click on a task with a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
cy.get('rect#cl2').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl2').click({ force: true });
|
|
||||||
|
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function', () => {
|
||||||
|
cy.get('text#cl2-text').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -21,7 +21,7 @@ describe('Git Graph diagram', () => {
|
|||||||
// // Call Open on eyes to initialize a test session
|
// // Call Open on eyes to initialize a test session
|
||||||
// cy.eyesOpen({
|
// cy.eyesOpen({
|
||||||
// appName: 'Demo App',
|
// appName: 'Demo App',
|
||||||
// testName: 'Ultrafast grid demo',
|
// testName: 'UltraFast grid demo',
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// // check the login page with fluent api, see more info here
|
// // check the login page with fluent api, see more info here
|
||||||
|
122
cypress/integration/rendering/c4.spec.js
Normal file
122
cypress/integration/rendering/c4.spec.js
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('C4 diagram', () => {
|
||||||
|
it('should render a simple C4Context diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
C4Context
|
||||||
|
accTitle: C4 context demo
|
||||||
|
accDescr: Many large C4 diagrams
|
||||||
|
|
||||||
|
title System Context diagram for Internet Banking System
|
||||||
|
|
||||||
|
Enterprise_Boundary(b0, "BankBoundary0") {
|
||||||
|
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
|
||||||
|
|
||||||
|
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
|
||||||
|
|
||||||
|
Enterprise_Boundary(b1, "BankBoundary") {
|
||||||
|
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BiRel(customerA, SystemAA, "Uses")
|
||||||
|
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
|
||||||
|
Rel(SystemC, customerA, "Sends e-mails to")
|
||||||
|
|
||||||
|
UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
|
||||||
|
UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
|
||||||
|
UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render a simple C4Container diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
C4Container
|
||||||
|
title Container diagram for Internet Banking System
|
||||||
|
|
||||||
|
System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system", $tags="v1.0")
|
||||||
|
Person(customer, Customer, "A customer of the bank, with personal bank accounts", $tags="v1.0")
|
||||||
|
|
||||||
|
Container_Boundary(c1, "Internet Banking") {
|
||||||
|
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to customers via their web browser")
|
||||||
|
}
|
||||||
|
|
||||||
|
Rel(customer, spa, "Uses", "HTTPS")
|
||||||
|
Rel(email_system, customer, "Sends e-mails to")
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render a simple C4Component diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
C4Component
|
||||||
|
title Component diagram for Internet Banking System - API Application
|
||||||
|
|
||||||
|
Container(spa, "Single Page Application", "javascript and angular", "Provides all the internet banking functionality to customers via their web browser.")
|
||||||
|
|
||||||
|
Container_Boundary(api, "API Application") {
|
||||||
|
Component(sign, "Sign In Controller", "MVC Rest Controller", "Allows users to sign in to the internet banking system")
|
||||||
|
}
|
||||||
|
|
||||||
|
Rel_Back(spa, sign, "Uses", "JSON/HTTPS")
|
||||||
|
UpdateRelStyle(spa, sign, $offsetY="-40")
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render a simple C4Dynamic diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
C4Dynamic
|
||||||
|
title Dynamic diagram for Internet Banking System - API Application
|
||||||
|
|
||||||
|
ContainerDb(c4, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")
|
||||||
|
Container(c1, "Single-Page Application", "JavaScript and Angular", "Provides all of the Internet banking functionality to customers via their web browser.")
|
||||||
|
Container_Boundary(b, "API Application") {
|
||||||
|
Component(c3, "Security Component", "Spring Bean", "Provides functionality Related to signing in, changing passwords, etc.")
|
||||||
|
Component(c2, "Sign In Controller", "Spring MVC Rest Controller", "Allows users to sign in to the Internet Banking System.")
|
||||||
|
}
|
||||||
|
Rel(c1, c2, "Submits credentials to", "JSON/HTTPS")
|
||||||
|
Rel(c2, c3, "Calls isAuthenticated() on")
|
||||||
|
Rel(c3, c4, "select * from users where username = ?", "JDBC")
|
||||||
|
|
||||||
|
UpdateRelStyle(c1, c2, $textColor="red", $offsetY="-40")
|
||||||
|
UpdateRelStyle(c2, c3, $textColor="red", $offsetX="-40", $offsetY="60")
|
||||||
|
UpdateRelStyle(c3, c4, $textColor="red", $offsetY="-40", $offsetX="10")
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
it('should render a simple C4Deployment diagram', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
C4Deployment
|
||||||
|
title Deployment Diagram for Internet Banking System - Live
|
||||||
|
|
||||||
|
Deployment_Node(mob, "Customer's mobile device", "Apple IOS or Android"){
|
||||||
|
Container(mobile, "Mobile App", "Xamarin", "Provides a limited subset of the Internet Banking functionality to customers via their mobile device.")
|
||||||
|
}
|
||||||
|
|
||||||
|
Deployment_Node(plc, "Big Bank plc", "Big Bank plc data center"){
|
||||||
|
Deployment_Node(dn, "bigbank-api*** x8", "Ubuntu 16.04 LTS"){
|
||||||
|
Deployment_Node(apache, "Apache Tomcat", "Apache Tomcat 8.x"){
|
||||||
|
Container(api, "API Application", "Java and Spring MVC", "Provides Internet Banking functionality via a JSON/HTTPS API.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rel(mobile, api, "Makes API calls to", "json/HTTPS")
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
});
|
@@ -478,4 +478,33 @@ describe('Class diagram V2', () => {
|
|||||||
);
|
);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('18: should render a simple class diagram with notes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
classDiagram-v2
|
||||||
|
note "I love this diagram!\nDo you love it?"
|
||||||
|
class Class10 {
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
note for Class10 "Cool class\nI said it's very cool class!"
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ logLevel: 1, flowchart: { htmlLabels: false } }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('1433: should render a simple class with a title', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: simple class diagram
|
||||||
|
---
|
||||||
|
classDiagram-v2
|
||||||
|
class Class10
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -407,4 +407,20 @@ describe('Class diagram', () => {
|
|||||||
// // expect(svg).to.not.have.attr('style');
|
// // expect(svg).to.not.have.attr('style');
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
it('19: should render a simple class diagram with notes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
classDiagram
|
||||||
|
note "I love this diagram!\nDo you love it?"
|
||||||
|
class Class10 {
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
note for Class10 "Cool class\nI said it's very cool class!"
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util';
|
import { imgSnapshotTest } from '../../helpers/util';
|
||||||
|
|
||||||
describe('State diagram', () => {
|
describe('Current diagram', () => {
|
||||||
it('should render a state with states in it', () => {
|
it('should render a state with states in it', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
|
@@ -167,7 +167,7 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('should render entities with generic and array attributes', () => {
|
it('should render entities with generic and array attributes', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
erDiagram
|
erDiagram
|
||||||
@@ -182,6 +182,20 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should render entities with length in attributes type', () => {
|
||||||
|
renderGraph(
|
||||||
|
`
|
||||||
|
erDiagram
|
||||||
|
CLUSTER {
|
||||||
|
varchar(99) name
|
||||||
|
string(255) description
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
{ 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', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@@ -255,4 +269,35 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
);
|
);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should render entities with aliases', () => {
|
||||||
|
renderGraph(
|
||||||
|
`
|
||||||
|
erDiagram
|
||||||
|
T1 one or zero to one or more T2 : test
|
||||||
|
T2 one or many optionally to zero or one T3 : test
|
||||||
|
T3 zero or more to zero or many T4 : test
|
||||||
|
T4 many(0) to many(1) T5 : test
|
||||||
|
T5 many optionally to one T6 : test
|
||||||
|
T6 only one optionally to only one T1 : test
|
||||||
|
T4 0+ to 1+ T6 : test
|
||||||
|
T1 1 to 1 T3 : test
|
||||||
|
`,
|
||||||
|
{ logLevel: 1 }
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('1433: should render a simple ER diagram with a title', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: simple ER diagram
|
||||||
|
---
|
||||||
|
erDiagram
|
||||||
|
CUSTOMER ||--o{ ORDER : places
|
||||||
|
ORDER ||--|{ LINE-ITEM : contains
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
687
cypress/integration/rendering/flowchart-elk.spec.js
Normal file
687
cypress/integration/rendering/flowchart-elk.spec.js
Normal file
@@ -0,0 +1,687 @@
|
|||||||
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
||||||
|
|
||||||
|
describe('Flowchart ELK', () => {
|
||||||
|
it('1-elk: should render a simple flowchart', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { defaultRenderer: 'elk' } }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('2-elk: should render a simple flowchart with diagramPadding set to 0', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
%% this is a comment
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { diagramPadding: 0 } }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('3-elk: a link with correct arrowhead to a subgraph', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
P1
|
||||||
|
P1 -->P1.5
|
||||||
|
subgraph P1.5
|
||||||
|
P2
|
||||||
|
P2.5(( A ))
|
||||||
|
P3
|
||||||
|
end
|
||||||
|
P2 --> P4
|
||||||
|
P3 --> P6
|
||||||
|
P1.5 --> P5
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('4-elk: Length of edges', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
L1 --- L2
|
||||||
|
L2 --- C
|
||||||
|
M1 ---> C
|
||||||
|
R1 .-> R2
|
||||||
|
R2 <.-> C
|
||||||
|
C -->|Label 1| E1
|
||||||
|
C <-- Label 2 ---> E2
|
||||||
|
C ----> E3
|
||||||
|
C <-...-> E4
|
||||||
|
C ======> E5
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('5-elk: should render escaped without html labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
a["<strong>Haiya</strong>"]---->b
|
||||||
|
`,
|
||||||
|
{ htmlLabels: false, flowchart: { htmlLabels: false } }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('6-elk: should render non-escaped with html labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
a["<strong>Haiya</strong>"]===>b
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('7-elk: should render a flowchart when useMaxWidth is true (default)', () => {
|
||||||
|
renderGraph(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { useMaxWidth: true } }
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
expect(svg).to.have.attr('width', '100%');
|
||||||
|
// expect(svg).to.have.attr('height');
|
||||||
|
// use within because the absolute value can be slightly different depending on the environment ±5%
|
||||||
|
// const height = parseFloat(svg.attr('height'));
|
||||||
|
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
||||||
|
const style = svg.attr('style');
|
||||||
|
expect(style).to.match(/^max-width: [\d.]+px;$/);
|
||||||
|
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
|
||||||
|
expect(maxWidthValue).to.be.within(230 * 0.95, 230 * 1.05);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('8-elk: should render a flowchart when useMaxWidth is false', () => {
|
||||||
|
renderGraph(
|
||||||
|
`flowchart-elk TD
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
B --> C{Let me think}
|
||||||
|
C -->|One| D[Laptop]
|
||||||
|
C -->|Two| E[iPhone]
|
||||||
|
C -->|Three| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ flowchart: { useMaxWidth: false } }
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
// const height = parseFloat(svg.attr('height'));
|
||||||
|
const width = parseFloat(svg.attr('width'));
|
||||||
|
// use within because the absolute value can be slightly different depending on the environment ±5%
|
||||||
|
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
||||||
|
expect(width).to.be.within(230 * 0.95, 230 * 1.05);
|
||||||
|
expect(svg).to.not.have.attr('style');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('V2 elk - 16: Render Stadium shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
` flowchart-elk TD
|
||||||
|
A([stadium shape test])
|
||||||
|
A -->|Get money| B([Go shopping])
|
||||||
|
B --> C([Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?])
|
||||||
|
C -->|One| D([Laptop])
|
||||||
|
C -->|Two| E([iPhone])
|
||||||
|
C -->|Three| F([Car<br/>wroom wroom])
|
||||||
|
click A "index.html#link-clicked" "link test"
|
||||||
|
click B testClick "click test"
|
||||||
|
classDef someclass fill:#f96;
|
||||||
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
|
`,
|
||||||
|
{ flowchart: { htmlLabels: false }, fontFamily: 'courier' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('50-elk: handle nested subgraphs in reverse order', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk LR
|
||||||
|
a -->b
|
||||||
|
subgraph A
|
||||||
|
B
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
b
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('51-elk: handle nested subgraphs in reverse order', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk LR
|
||||||
|
a -->b
|
||||||
|
subgraph A
|
||||||
|
B
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
b
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('52-elk: handle nested subgraphs in several levels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
b-->B
|
||||||
|
a-->c
|
||||||
|
subgraph O
|
||||||
|
A
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
c
|
||||||
|
end
|
||||||
|
subgraph A
|
||||||
|
a
|
||||||
|
b
|
||||||
|
B
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('53-elk: handle nested subgraphs with edges in and out', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
internet
|
||||||
|
nat
|
||||||
|
routeur
|
||||||
|
lb1
|
||||||
|
lb2
|
||||||
|
compute1
|
||||||
|
compute2
|
||||||
|
subgraph project
|
||||||
|
routeur
|
||||||
|
nat
|
||||||
|
subgraph subnet1
|
||||||
|
compute1
|
||||||
|
lb1
|
||||||
|
end
|
||||||
|
subgraph subnet2
|
||||||
|
compute2
|
||||||
|
lb2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
internet --> routeur
|
||||||
|
routeur --> subnet1 & subnet2
|
||||||
|
subnet1 & subnet2 --> nat --> internet
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('54-elk: handle nested subgraphs with outgoing links', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
subgraph main
|
||||||
|
subgraph subcontainer
|
||||||
|
subcontainer-child
|
||||||
|
end
|
||||||
|
subcontainer-child--> subcontainer-sibling
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('55-elk: handle nested subgraphs with outgoing links 2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TD
|
||||||
|
|
||||||
|
subgraph one[One]
|
||||||
|
subgraph sub_one[Sub One]
|
||||||
|
_sub_one
|
||||||
|
end
|
||||||
|
subgraph sub_two[Sub Two]
|
||||||
|
_sub_two
|
||||||
|
end
|
||||||
|
_one
|
||||||
|
end
|
||||||
|
|
||||||
|
%% here, either the first or the second one
|
||||||
|
sub_one --> sub_two
|
||||||
|
_one --> b
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('56-elk: handle nested subgraphs with outgoing links 3', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
subgraph container_Beta
|
||||||
|
process_C-->Process_D
|
||||||
|
end
|
||||||
|
subgraph container_Alpha
|
||||||
|
process_A-->process_B
|
||||||
|
process_A-->|messages|process_C
|
||||||
|
end
|
||||||
|
process_B-->|via_AWSBatch|container_Beta
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('57-elk: handle nested subgraphs with outgoing links 4', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk LR
|
||||||
|
subgraph A
|
||||||
|
a -->b
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
b
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('57-elk: handle nested subgraphs with outgoing links 2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
c1-->a2
|
||||||
|
subgraph one
|
||||||
|
a1-->a2
|
||||||
|
end
|
||||||
|
subgraph two
|
||||||
|
b1-->b2
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c1-->c2
|
||||||
|
end
|
||||||
|
one --> two
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('57.x: handle nested subgraphs with outgoing links 5', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%% this does not produce the desired result
|
||||||
|
flowchart-elk TB
|
||||||
|
subgraph container_Beta
|
||||||
|
process_C-->Process_D
|
||||||
|
end
|
||||||
|
subgraph container_Alpha
|
||||||
|
process_A-->process_B
|
||||||
|
process_B-->|via_AWSBatch|container_Beta
|
||||||
|
process_A-->|messages|process_C
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('58-elk: handle styling with style expressions', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
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
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('59-elk: handle styling of subgraphs and links', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TD
|
||||||
|
A[Christmas] ==> D
|
||||||
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
|
A[Christmas] ==> C
|
||||||
|
subgraph T ["Test"]
|
||||||
|
A
|
||||||
|
B
|
||||||
|
C
|
||||||
|
end
|
||||||
|
|
||||||
|
classDef Test fill:#F84E68,stroke:#333,color:white;
|
||||||
|
class A,T Test
|
||||||
|
classDef TestSub fill:green;
|
||||||
|
class T TestSub
|
||||||
|
linkStyle 0,1 color:orange, stroke: orange;
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('60-elk: handle styling for all node shapes - v2', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
A[red text] -->|default style| B(blue text)
|
||||||
|
C([red text]) -->|default style| D[[blue text]]
|
||||||
|
E[(red text)] -->|default style| F((blue text))
|
||||||
|
G>red text] -->|default style| H{blue text}
|
||||||
|
I{{red text}} -->|default style| J[/blue text/]
|
||||||
|
K[\\ red text\\] -->|default style| L[/blue text\\]
|
||||||
|
M[\\ red text/] -->|default style| N[blue text];
|
||||||
|
O(((red text))) -->|default style| P(((blue text)));
|
||||||
|
linkStyle default color:Sienna;
|
||||||
|
style A stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style B stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style D stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style E stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style F stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style G stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style H stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style I stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style J stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style K stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style L stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style M stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style N stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
style O stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||||
|
style P stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose', logLevel: 2 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('61-elk: fontawesome icons in edge labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TD
|
||||||
|
C -->|fa:fa-car Car| F[fa:fa-car Car]
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('62-elk: should render styled subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TB
|
||||||
|
A
|
||||||
|
B
|
||||||
|
subgraph foo[Foo SubGraph]
|
||||||
|
C
|
||||||
|
D
|
||||||
|
end
|
||||||
|
subgraph bar[Bar SubGraph]
|
||||||
|
E
|
||||||
|
F
|
||||||
|
end
|
||||||
|
G
|
||||||
|
|
||||||
|
A-->B
|
||||||
|
B-->C
|
||||||
|
C-->D
|
||||||
|
B-->D
|
||||||
|
D-->E
|
||||||
|
E-->A
|
||||||
|
E-->F
|
||||||
|
F-->D
|
||||||
|
F-->G
|
||||||
|
B-->G
|
||||||
|
G-->D
|
||||||
|
|
||||||
|
style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
|
||||||
|
style bar fill:#999,stroke-width:10px,stroke:#0F0,color:blue
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('63-elk: title on subgraphs should be themable', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
%%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%%
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph A
|
||||||
|
a --> b
|
||||||
|
end
|
||||||
|
subgraph B
|
||||||
|
i -->f
|
||||||
|
end
|
||||||
|
A --> B
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('65-elk: text-color from classes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
classDef dark fill:#000,stroke:#000,stroke-width:4px,color:#fff
|
||||||
|
Lorem --> Ipsum --> Dolor
|
||||||
|
class Lorem,Dolor dark
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('66-elk: More nested subgraph cases (TB)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TB
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('67-elk: More nested subgraph cases (RL)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('68-elk: More nested subgraph cases (BT)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk BT
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('69-elk: More nested subgraph cases (LR)', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
subgraph two
|
||||||
|
b1
|
||||||
|
end
|
||||||
|
subgraph three
|
||||||
|
c2
|
||||||
|
end
|
||||||
|
|
||||||
|
three --> two
|
||||||
|
two --> c2
|
||||||
|
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('70-elk: Handle nested subgraph cases (TB) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TB
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('71-elk: Handle nested subgraph cases (RL) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('72-elk: Handle nested subgraph cases (BT) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk BT
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('74-elk: Handle nested subgraph cases (RL) link out and link between subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph S1
|
||||||
|
sub1 -->sub2
|
||||||
|
end
|
||||||
|
subgraph S2
|
||||||
|
sub4
|
||||||
|
end
|
||||||
|
S1 --> S2
|
||||||
|
sub1 --> sub4
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('74-elk: Handle labels for multiple edges from and to the same couple of nodes', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk RL
|
||||||
|
subgraph one
|
||||||
|
a1 -- l1 --> a2
|
||||||
|
a1 -- l2 --> a2
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('76-elk: handle unicode encoded character with HTML labels true', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`flowchart-elk TB
|
||||||
|
a{{"Lorem 'ipsum' dolor 'sit' amet, 'consectetur' adipiscing 'elit'."}}
|
||||||
|
--> b{{"Lorem #quot;ipsum#quot; dolor #quot;sit#quot; amet,#quot;consectetur#quot; adipiscing #quot;elit#quot;."}}
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('2050-elk: handling of different rendering direction in subgraphs', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
|
||||||
|
subgraph TOP
|
||||||
|
direction TB
|
||||||
|
subgraph B1
|
||||||
|
direction RL
|
||||||
|
i1 -->f1
|
||||||
|
end
|
||||||
|
subgraph B2
|
||||||
|
direction BT
|
||||||
|
i2 -->f2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
A --> TOP --> B
|
||||||
|
B1 --> B2
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('2388-elk: handling default in the node name', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk LR
|
||||||
|
default-index.js --> dot.template.js
|
||||||
|
index.js --> module-utl.js
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('2824-elk: Clipping of edges', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
flowchart-elk TD
|
||||||
|
A --> B
|
||||||
|
A --> C
|
||||||
|
B --> C
|
||||||
|
`,
|
||||||
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('1433-elk: should render a titled flowchart with titleTopMargin set to 0', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: Simple flowchart
|
||||||
|
---
|
||||||
|
flowchart-elk TD
|
||||||
|
A --> B
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
@@ -663,4 +663,15 @@ flowchart RL
|
|||||||
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
{ htmlLabels: true, flowchart: { htmlLabels: true }, securityLevel: 'loose' }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('1433: should render a titled flowchart with titleTopMargin set to 0', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: Simple flowchart
|
||||||
|
---
|
||||||
|
flowchart TD
|
||||||
|
A --> B
|
||||||
|
`,
|
||||||
|
{ titleTopMargin: 0 }
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -92,7 +92,7 @@ describe('Gantt diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should render a gantt chart for issue #1060', () => {
|
it('should FAIL redering a gantt chart for issue #1060 with invalid date', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
gantt
|
gantt
|
||||||
@@ -310,35 +310,129 @@ describe('Gantt diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render accessibility tags', function () {
|
it('should render a gantt diagram with tick is 15 minutes', () => {
|
||||||
const expectedTitle = 'Gantt Diagram';
|
imgSnapshotTest(
|
||||||
const expectedAccDescription = 'Tasks for Q4';
|
|
||||||
renderGraph(
|
|
||||||
`
|
`
|
||||||
gantt
|
gantt
|
||||||
accTitle: ${expectedTitle}
|
title A Gantt Diagram
|
||||||
accDescr: ${expectedAccDescription}
|
dateFormat YYYY-MM-DD
|
||||||
dateFormat YYYY-MM-DD
|
axisFormat %H:%M
|
||||||
section Section
|
tickInterval 15minute
|
||||||
A task :a1, 2014-01-01, 30d
|
excludes weekends
|
||||||
|
|
||||||
|
section Section
|
||||||
|
A task : a1, 2022-10-03, 6h
|
||||||
|
Another task : after a1, 6h
|
||||||
|
section Another
|
||||||
|
Task in sec : 2022-10-03, 3h
|
||||||
|
another task : 3h
|
||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg').should((svg) => {
|
});
|
||||||
const el = svg.get(0);
|
|
||||||
const children = Array.from(el.children);
|
|
||||||
|
|
||||||
const titleEl = children.find(function (node) {
|
it('should render a gantt diagram with tick is 6 hours', () => {
|
||||||
return node.tagName === 'title';
|
imgSnapshotTest(
|
||||||
});
|
`
|
||||||
const descriptionEl = children.find(function (node) {
|
gantt
|
||||||
return node.tagName === 'desc';
|
title A Gantt Diagram
|
||||||
});
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %d %H:%M
|
||||||
|
tickInterval 6hour
|
||||||
|
excludes weekends
|
||||||
|
|
||||||
expect(titleEl).to.exist;
|
section Section
|
||||||
expect(titleEl.textContent).to.equal(expectedTitle);
|
A task : a1, 2022-10-03, 1d
|
||||||
expect(descriptionEl).to.exist;
|
Another task : after a1, 2d
|
||||||
expect(descriptionEl.textContent).to.equal(expectedAccDescription);
|
section Another
|
||||||
});
|
Task in sec : 2022-10-04, 2d
|
||||||
|
another task : 2d
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a gantt diagram with tick is 1 day', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title A Gantt Diagram
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %m-%d
|
||||||
|
tickInterval 1day
|
||||||
|
excludes weekends
|
||||||
|
|
||||||
|
section Section
|
||||||
|
A task : a1, 2022-10-01, 30d
|
||||||
|
Another task : after a1, 20d
|
||||||
|
section Another
|
||||||
|
Task in sec : 2022-10-20, 12d
|
||||||
|
another task : 24d
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a gantt diagram with tick is 1 week', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title A Gantt Diagram
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %m-%d
|
||||||
|
tickInterval 1week
|
||||||
|
excludes weekends
|
||||||
|
|
||||||
|
section Section
|
||||||
|
A task : a1, 2022-10-01, 30d
|
||||||
|
Another task : after a1, 20d
|
||||||
|
section Another
|
||||||
|
Task in sec : 2022-10-20, 12d
|
||||||
|
another task : 24d
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a gantt diagram with tick is 1 month', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title A Gantt Diagram
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %m-%d
|
||||||
|
tickInterval 1month
|
||||||
|
excludes weekends
|
||||||
|
|
||||||
|
section Section
|
||||||
|
A task : a1, 2022-10-01, 30d
|
||||||
|
Another task : after a1, 20d
|
||||||
|
section Another
|
||||||
|
Task in sec : 2022-10-20, 12d
|
||||||
|
another task : 24d
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render a gantt diagram with tick is 1 day and topAxis is true', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title A Gantt Diagram
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %m-%d
|
||||||
|
tickInterval 1day
|
||||||
|
excludes weekends
|
||||||
|
|
||||||
|
section Section
|
||||||
|
A task : a1, 2022-10-01, 30d
|
||||||
|
Another task : after a1, 20d
|
||||||
|
section Another
|
||||||
|
Task in sec : 2022-10-20, 12d
|
||||||
|
another task : 24d
|
||||||
|
`,
|
||||||
|
{ gantt: { topAxis: true } }
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -322,4 +322,15 @@ describe('Git Graph diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('1433: should render a simple gitgraph with a title', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: simple gitGraph
|
||||||
|
---
|
||||||
|
gitGraph
|
||||||
|
commit id: "1-abcdefg"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,75 +0,0 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
|
||||||
|
|
||||||
describe('Mindmap', () => {
|
|
||||||
it('square shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
mindmap
|
|
||||||
root[
|
|
||||||
The root
|
|
||||||
]
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
it('rounded rect shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
mindmap
|
|
||||||
root((
|
|
||||||
The root
|
|
||||||
))
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
it('circle shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
mindmap
|
|
||||||
root(
|
|
||||||
The root
|
|
||||||
)
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
it('default shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
mindmap
|
|
||||||
The root
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
it('adding children', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
mindmap
|
|
||||||
The root
|
|
||||||
child1
|
|
||||||
child2
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
it('adding grand children', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`
|
|
||||||
mindmap
|
|
||||||
The root
|
|
||||||
child1
|
|
||||||
child2
|
|
||||||
child3
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg');
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,115 +0,0 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
|
|
||||||
|
|
||||||
describe('Mindmaps', () => {
|
|
||||||
it('Only a root', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('a root with a shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root[root]
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('a root with wrapping text and a shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root[A root with a long text that wraps to keep the node size in check]
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('a root with an icon', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root[root]
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Blang and cloud shape', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root))bang((
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
a))Another bang((
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
a)A cloud(
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Blang and cloud shape with icons', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root))bang((
|
|
||||||
|
|
||||||
a))Another bang((
|
|
||||||
a)A cloud(
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('braches', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root
|
|
||||||
child1
|
|
||||||
grandchild 1
|
|
||||||
grandchild 2
|
|
||||||
child2
|
|
||||||
grandchild 3
|
|
||||||
grandchild 4
|
|
||||||
child3
|
|
||||||
grandchild 5
|
|
||||||
grandchild 6
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('braches with shapes and labels', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root
|
|
||||||
child1((Circle))
|
|
||||||
grandchild 1
|
|
||||||
grandchild 2
|
|
||||||
child2(Round rectangle)
|
|
||||||
grandchild 3
|
|
||||||
grandchild 4
|
|
||||||
child3[Square]
|
|
||||||
grandchild 5
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
gc6((grand<br/>child 6))
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it('text shouhld wrap with icon', () => {
|
|
||||||
imgSnapshotTest(
|
|
||||||
`mindmap
|
|
||||||
root
|
|
||||||
Child3(A node with an icon and with a long text that wraps to keep the node size in check)
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
/* The end */
|
|
||||||
});
|
|
227
cypress/integration/rendering/mindmap.spec.ts
Normal file
227
cypress/integration/rendering/mindmap.spec.ts
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether the SVG Element has a Mindmap root
|
||||||
|
*
|
||||||
|
* Sometimes, Cypress takes a snapshot before the mermaid mindmap has finished
|
||||||
|
* generating the SVG.
|
||||||
|
*
|
||||||
|
* @param $p - The element to check.
|
||||||
|
*/
|
||||||
|
function shouldHaveRoot($p: JQuery<SVGSVGElement>) {
|
||||||
|
// get HTML Element from jquery element
|
||||||
|
const svgElement = $p[0];
|
||||||
|
expect(svgElement.nodeName).equal('svg');
|
||||||
|
|
||||||
|
const sectionRoots = svgElement.getElementsByClassName('mindmap-node section-root');
|
||||||
|
// mindmap should have at least one root section
|
||||||
|
expect(sectionRoots).to.have.lengthOf.at.least(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Mindmaps', () => {
|
||||||
|
it('Only a root', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('a root with a shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root[root]
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('a root with wrapping text and a shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root[A root with a long text that wraps to keep the node size in check]
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('a root with an icon', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root[root]
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Blang and cloud shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root))bang((
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
a))Another bang((
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
a)A cloud(
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Blang and cloud shape with icons', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root))bang((
|
||||||
|
|
||||||
|
a))Another bang((
|
||||||
|
a)A cloud(
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('braches', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root
|
||||||
|
child1
|
||||||
|
grandchild 1
|
||||||
|
grandchild 2
|
||||||
|
child2
|
||||||
|
grandchild 3
|
||||||
|
grandchild 4
|
||||||
|
child3
|
||||||
|
grandchild 5
|
||||||
|
grandchild 6
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('braches with shapes and labels', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root
|
||||||
|
child1((Circle))
|
||||||
|
grandchild 1
|
||||||
|
grandchild 2
|
||||||
|
child2(Round rectangle)
|
||||||
|
grandchild 3
|
||||||
|
grandchild 4
|
||||||
|
child3[Square]
|
||||||
|
grandchild 5
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
gc6((grand<br/>child 6))
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('text shouhld wrap with icon', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`mindmap
|
||||||
|
root
|
||||||
|
Child3(A node with an icon and with a long text that wraps to keep the node size in check)
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('square shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
mindmap
|
||||||
|
root[
|
||||||
|
The root
|
||||||
|
]
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('rounded rect shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
mindmap
|
||||||
|
root((
|
||||||
|
The root
|
||||||
|
))
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('circle shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
mindmap
|
||||||
|
root(
|
||||||
|
The root
|
||||||
|
)
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('default shape', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
mindmap
|
||||||
|
The root
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('adding children', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
mindmap
|
||||||
|
The root
|
||||||
|
child1
|
||||||
|
child2
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('adding grand children', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
mindmap
|
||||||
|
The root
|
||||||
|
child1
|
||||||
|
child2
|
||||||
|
child3
|
||||||
|
`,
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
shouldHaveRoot
|
||||||
|
);
|
||||||
|
});
|
||||||
|
/* The end */
|
||||||
|
});
|
@@ -46,69 +46,4 @@ describe('Requirement diagram', () => {
|
|||||||
);
|
);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render accessibility tags', function () {
|
|
||||||
const expectedTitle = 'Gantt Diagram';
|
|
||||||
const expectedAccDescription = 'Tasks for Q4';
|
|
||||||
renderGraph(
|
|
||||||
`
|
|
||||||
requirementDiagram
|
|
||||||
accTitle: ${expectedTitle}
|
|
||||||
accDescr: ${expectedAccDescription}
|
|
||||||
|
|
||||||
requirement test_req {
|
|
||||||
id: 1
|
|
||||||
text: the test text.
|
|
||||||
risk: high
|
|
||||||
verifymethod: test
|
|
||||||
}
|
|
||||||
|
|
||||||
functionalRequirement test_req2 {
|
|
||||||
id: 1.1
|
|
||||||
text: the second test text.
|
|
||||||
risk: low
|
|
||||||
verifymethod: inspection
|
|
||||||
}
|
|
||||||
|
|
||||||
performanceRequirement test_req3 {
|
|
||||||
id: 1.2
|
|
||||||
text: the third test text.
|
|
||||||
risk: medium
|
|
||||||
verifymethod: demonstration
|
|
||||||
}
|
|
||||||
|
|
||||||
element test_entity {
|
|
||||||
type: simulation
|
|
||||||
}
|
|
||||||
|
|
||||||
element test_entity2 {
|
|
||||||
type: word doc
|
|
||||||
docRef: reqs/test_entity
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
test_entity - satisfies -> test_req2
|
|
||||||
test_req - traces -> test_req2
|
|
||||||
test_req - contains -> test_req3
|
|
||||||
test_req <- copies - test_entity2
|
|
||||||
`,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
cy.get('svg').should((svg) => {
|
|
||||||
const el = svg.get(0);
|
|
||||||
const children = Array.from(el.children);
|
|
||||||
|
|
||||||
const titleEl = children.find(function (node) {
|
|
||||||
return node.tagName === 'title';
|
|
||||||
});
|
|
||||||
const descriptionEl = children.find(function (node) {
|
|
||||||
return node.tagName === 'desc';
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(titleEl).to.exist;
|
|
||||||
expect(titleEl.textContent).to.equal(expectedTitle);
|
|
||||||
expect(descriptionEl).to.exist;
|
|
||||||
expect(descriptionEl.textContent).to.equal(expectedAccDescription);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@@ -3,6 +3,42 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util';
|
||||||
|
|
||||||
context('Sequence diagram', () => {
|
context('Sequence diagram', () => {
|
||||||
|
it('should render a sequence diagram with boxes', () => {
|
||||||
|
renderGraph(
|
||||||
|
`
|
||||||
|
sequenceDiagram
|
||||||
|
box LightGrey Alice and Bob
|
||||||
|
participant Alice
|
||||||
|
participant Bob
|
||||||
|
end
|
||||||
|
participant John as John<br/>Second Line
|
||||||
|
Alice ->> Bob: Hello Bob, how are you?
|
||||||
|
Bob-->>John: How about you John?
|
||||||
|
Bob--x Alice: I am good thanks!
|
||||||
|
Bob-x John: I am good thanks!
|
||||||
|
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
|
||||||
|
Bob-->Alice: Checking with John...
|
||||||
|
alt either this
|
||||||
|
Alice->>John: Yes
|
||||||
|
else or this
|
||||||
|
Alice->>John: No
|
||||||
|
else or this will happen
|
||||||
|
Alice->John: Maybe
|
||||||
|
end
|
||||||
|
par this happens in parallel
|
||||||
|
Alice -->> Bob: Parallel message 1
|
||||||
|
and
|
||||||
|
Alice -->> John: Parallel message 2
|
||||||
|
end
|
||||||
|
`,
|
||||||
|
{ sequence: { useMaxWidth: false } }
|
||||||
|
);
|
||||||
|
cy.get('svg').should((svg) => {
|
||||||
|
const width = parseFloat(svg.attr('width'));
|
||||||
|
expect(width).to.be.within(830 * 0.95, 830 * 1.05);
|
||||||
|
expect(svg).to.not.have.attr('style');
|
||||||
|
});
|
||||||
|
});
|
||||||
it('should render a simple sequence diagram', () => {
|
it('should render a simple sequence diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
|
@@ -328,7 +328,7 @@ describe('State diagram', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('v2 it should be possibel to use a choice', () => {
|
it('v2 it should be possible to use a choice', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
stateDiagram-v2
|
stateDiagram-v2
|
||||||
@@ -521,4 +521,54 @@ stateDiagram-v2
|
|||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('classDefs and applying classes', () => {
|
||||||
|
it('v2 states can have a class applied', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
stateDiagram-v2
|
||||||
|
[*] --> A
|
||||||
|
A --> B: test({ foo#colon; 'far' })
|
||||||
|
B --> [*]
|
||||||
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
|
class B badBadEvent
|
||||||
|
`,
|
||||||
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('v2 can have multiple classes applied to multiple states', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
stateDiagram-v2
|
||||||
|
classDef notMoving fill:white
|
||||||
|
classDef movement font-style:italic;
|
||||||
|
classDef badBadEvent fill:#f00,color:white,font-weight:bold
|
||||||
|
|
||||||
|
[*] --> Still
|
||||||
|
Still --> [*]
|
||||||
|
Still --> Moving
|
||||||
|
Moving --> Still
|
||||||
|
Moving --> Crash
|
||||||
|
Crash --> [*]
|
||||||
|
|
||||||
|
class Still notMoving
|
||||||
|
class Moving, Crash movement
|
||||||
|
class Crash badBadEvent
|
||||||
|
`,
|
||||||
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('1433: should render a simple state diagram with a title', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`---
|
||||||
|
title: simple state diagram
|
||||||
|
---
|
||||||
|
stateDiagram-v2
|
||||||
|
[*] --> State1
|
||||||
|
State1 --> [*]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -25,6 +25,7 @@ describe('themeCSS balancing, it', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: Delete/Rename this describe, keeping the inner contents.
|
||||||
describe('Pie Chart', () => {
|
describe('Pie Chart', () => {
|
||||||
// beforeEach(()=>{
|
// beforeEach(()=>{
|
||||||
// cy.clock((new Date('2014-06-09')).getTime());
|
// cy.clock((new Date('2014-06-09')).getTime());
|
||||||
|
164
cypress/integration/rendering/timeline.spec.ts
Normal file
164
cypress/integration/rendering/timeline.spec.ts
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
||||||
|
|
||||||
|
describe('Timeline diagram', () => {
|
||||||
|
it('1: should render a simple timeline with no specific sections', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('2: should render a timeline diagram with sections', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`timeline
|
||||||
|
title Timeline of Industrial Revolution
|
||||||
|
section 17th-20th century
|
||||||
|
Industry 1.0 : Machinery, Water power, Steam <br>power
|
||||||
|
Industry 2.0 : Electricity, Internal combustion engine, Mass production
|
||||||
|
Industry 3.0 : Electronics, Computers, Automation
|
||||||
|
section 21st century
|
||||||
|
Industry 4.0 : Internet, Robotics, Internet of Things
|
||||||
|
Industry 5.0 : Artificial intelligence, Big data,3D printing
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('3: should render a complex timeline with sections, and long events text with <br>', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`timeline
|
||||||
|
title England's History Timeline
|
||||||
|
section Stone Age
|
||||||
|
7600 BC : Britain's oldest known house was built in Orkney, Scotland
|
||||||
|
6000 BC : Sea levels rise and Britain becomes an island.<br> The people who live here are hunter-gatherers.
|
||||||
|
section Broze Age
|
||||||
|
2300 BC : People arrive from Europe and settle in Britain. <br>They bring farming and metalworking.
|
||||||
|
: New styles of pottery and ways of burying the dead appear.
|
||||||
|
2200 BC : The last major building works are completed at Stonehenge.<br> People now bury their dead in stone circles.
|
||||||
|
: The first metal objects are made in Britain.Some other nice things happen. it is a good time to be alive.
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('4: should render a simple timeline with directives and disableMultiColor:true ', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'base', 'timeline': {'disableMulticolor': true}}}%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('5: should render a simple timeline with directive overriden colors', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
` %%{init: { 'logLevel': 'debug', 'theme': 'default' , 'themeVariables': {
|
||||||
|
'cScale0': '#ff0000',
|
||||||
|
'cScale1': '#00ff00',
|
||||||
|
'cScale2': '#0000ff'
|
||||||
|
} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('6: should render a simple timeline in base theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('7: should render a simple timeline in default theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'default' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('8: should render a simple timeline in dark theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'dark' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('9: should render a simple timeline in neutral theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'neutral' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('10: should render a simple timeline in forest theme', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
231
cypress/platform/ashish2.html
Normal file
231
cypress/platform/ashish2.html
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
<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>
|
||||||
|
<div>Security check</div>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
timeline
|
||||||
|
title My day
|
||||||
|
section section with no tasks
|
||||||
|
section Go to work at the dog office
|
||||||
|
1930 : first step : second step is a long step
|
||||||
|
: third step
|
||||||
|
1940 : fourth step : fifth step
|
||||||
|
section Go home
|
||||||
|
1950 : India got independent and already won war against Pakistan
|
||||||
|
1960 : India fights poverty, looses war to China and gets nuclear weapons from USA and USSR
|
||||||
|
1970 : Green Revolution comes to india
|
||||||
|
section Another section with no tasks
|
||||||
|
I am a big big big tasks
|
||||||
|
I am not so big tasks
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
timeline
|
||||||
|
title MermaidChart 2023 Timeline
|
||||||
|
section 2023 Q1 <br> Release Personal Tier
|
||||||
|
Buttet 1 : sub-point 1a : sub-point 1b
|
||||||
|
: sub-point 1c
|
||||||
|
Bullet 2 : sub-point 2a : sub-point 2b
|
||||||
|
section 2023 Q2 <br> Release XYZ Tier
|
||||||
|
Buttet 3 : sub-point <br> 3a : sub-point 3b
|
||||||
|
: sub-point 3c
|
||||||
|
Bullet 4 : sub-point 4a : sub-point 4b
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
timeline
|
||||||
|
title England's History Timeline
|
||||||
|
section Stone Age
|
||||||
|
7600 BC : Britain's oldest known house was built in Orkney, Scotland
|
||||||
|
6000 BC : Sea levels rise and Britain becomes an island. The people who live here are hunter-gatherers.
|
||||||
|
section Broze Age
|
||||||
|
2300 BC : People arrive from Europe and settle in Britain. They bring farming and metalworking.
|
||||||
|
: New styles of pottery and ways of burying the dead appear.
|
||||||
|
2200 BC : The last major building works are completed at Stonehenge. People now bury their dead in stone circles.
|
||||||
|
: The first metal objects are made in Britain.Some other nice things happen. it is a good time to be alive.
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{'init': { 'logLevel': 'debug', 'theme': 'default', 'timeline': {'disableMulticolor':false} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google : Pixar
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008s : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'themeVariables': {
|
||||||
|
'cScale0': '#ff0000',
|
||||||
|
'cScale1': '#00ff00',
|
||||||
|
'cScale2': '#ff0000'
|
||||||
|
} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google : Pixar
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008s : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{init: { 'logLevel': 'debug', 'theme': 'default' , 'themeVariables': {
|
||||||
|
'cScale0': '#ff0000',
|
||||||
|
'cScale1': '#00ff00',
|
||||||
|
'cScale2': '#0000ff'
|
||||||
|
} } }%%
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008 : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
timeline
|
||||||
|
title History of Social Media Platform
|
||||||
|
2002 : LinkedIn
|
||||||
|
2004 : Facebook : Google
|
||||||
|
2005 : Youtube
|
||||||
|
2006 : Twitter
|
||||||
|
2007 : Tumblr
|
||||||
|
2008s : Instagram
|
||||||
|
2010 : Pinterest
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
root
|
||||||
|
child1((Circle))
|
||||||
|
grandchild 1
|
||||||
|
grandchild 2
|
||||||
|
child2(Round rectangle)
|
||||||
|
grandchild 3
|
||||||
|
grandchild 4
|
||||||
|
child3[Square]
|
||||||
|
grandchild 5
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
gc6((grand<br/>child 6))
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
gc7((grand<br/>grand<br/>child 8))
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
flowchart-elk TB
|
||||||
|
a --> b
|
||||||
|
a --> c
|
||||||
|
b --> d
|
||||||
|
c --> d
|
||||||
|
</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 type="module">
|
||||||
|
//import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
|
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
|
// import timeline from '../../packages/mermaid-timeline/src/detector';
|
||||||
|
import mermaid from '../../packages/mermaid/src/mermaid';
|
||||||
|
// await mermaid.registerExternalDiagrams([]);
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'base',
|
||||||
|
startOnLoad: true,
|
||||||
|
logLevel: 0,
|
||||||
|
flowchart: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
timeline: {
|
||||||
|
disableMulticolor: false,
|
||||||
|
htmlLabels: false,
|
||||||
|
},
|
||||||
|
useMaxWidth: true,
|
||||||
|
lazyLoadedDiagrams: [
|
||||||
|
// './mermaid-mindmap-detector.esm.mjs',
|
||||||
|
// './mermaid-example-diagram-detector.esm.mjs',
|
||||||
|
//'./mermaid-timeline-detector.esm.mjs',
|
||||||
|
],
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
// mermaid.test1('first_slow', 1200).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('forth_slow', 1200).then((r) => console.info(r));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -46,13 +46,9 @@
|
|||||||
<pre class="mermaid" style="width: 100%; height: 20%">
|
<pre class="mermaid" style="width: 100%; height: 20%">
|
||||||
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class BankAccount{
|
classA <|-- classB : implements
|
||||||
+String owner
|
classC *-- classD : composition
|
||||||
+BigDecimal balance
|
classE o-- classF : aggregation
|
||||||
+deposit(amount) bool
|
|
||||||
+withdrawl(amount) int
|
|
||||||
}
|
|
||||||
cssClass "BankAccount" customCss
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid2" style="width: 100%; height: 20%">
|
<pre class="mermaid2" style="width: 100%; height: 20%">
|
||||||
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
%%{init: {'theme': 'base', 'fontFamily': 'courier', 'themeVariables': { 'primaryColor': '#fff000'}}}%%
|
||||||
|
@@ -13,42 +13,42 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
FunctionTest1-->URLTest1
|
||||||
click Function clickByFlow "Add a div"
|
click FunctionTest1 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URLTest1 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function--->2URL
|
1Function--->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
Function-->URL
|
FunctionTest2-->URLTest2
|
||||||
click Function clickByFlow "Add a div"
|
click FunctionTest2 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click URLTest2 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
1Function--->2URL
|
10Function--->20URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 10Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click 20URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
Calling a Callback with args :cl3, after cl1, 3d
|
Calling a Callback with args :cl3, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt()
|
click cl2 call clickByGantt()
|
||||||
click cl3 call clickByGantt("test1", test2, test3)
|
click cl3 call clickByGantt("test1", test2, test3)
|
||||||
|
|
||||||
@@ -95,31 +95,31 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
FunctionArg-->URL
|
FunctionArgTest2-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click FunctionArgTest2 call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
FunctionArg-->URL
|
2FunctionArg-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click 2FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
|
@@ -9,15 +9,15 @@
|
|||||||
<body>
|
<body>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
Function1-->URL1
|
||||||
click Function clickByFlow "Add a div"
|
click Function1 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL1 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function-->2URL
|
1Function-->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
|
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
|
||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt("test", test, test)
|
click cl2 call clickByGantt("test", test, test)
|
||||||
|
|
||||||
section Last section
|
section Last section
|
||||||
|
@@ -17,38 +17,38 @@
|
|||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
Function-->URL
|
||||||
click Function clickByFlow "Add a div"
|
click Function clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function--->2URL
|
1Function--->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
Function-->URL
|
Function-->URL
|
||||||
click Function clickByFlow "Add a div"
|
click Function clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
1Function--->2URL
|
1Function--->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
Calling a Callback with args :cl3, after cl1, 3d
|
Calling a Callback with args :cl3, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt()
|
click cl2 call clickByGantt()
|
||||||
click cl3 call clickByGantt("test1", test2, test3)
|
click cl3 call clickByGantt("test1", test2, test3)
|
||||||
|
|
||||||
@@ -99,19 +99,19 @@
|
|||||||
graph TB
|
graph TB
|
||||||
FunctionArg-->URL
|
FunctionArg-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
FunctionArg-->URL
|
FunctionArg-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
|
@@ -9,15 +9,15 @@
|
|||||||
<body>
|
<body>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
Function1-->URL1
|
||||||
click Function clickByFlow "Add a div"
|
click Function1 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL1 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function-->2URL
|
1Function-->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
Calling a Callback with args :cl3, after cl1, 3d
|
Calling a Callback with args :cl3, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt()
|
click cl2 call clickByGantt()
|
||||||
click cl3 call clickByGantt("test1", test2, test3)
|
click cl3 call clickByGantt("test1", test2, test3)
|
||||||
|
|
||||||
|
10
cypress/platform/empty.html
Normal file
10
cypress/platform/empty.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Empty</title>
|
||||||
|
</head>
|
||||||
|
<body></body>
|
||||||
|
</html>
|
26
cypress/platform/external-diagrams-example-diagram.html
Normal file
26
cypress/platform/external-diagrams-example-diagram.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h1>Should correctly load a third-party diagram using registerDiagram</h1>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
example-diagram
|
||||||
|
</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 type="module" src="./external-diagrams-mindmap.mjs" /> -->
|
||||||
|
<script type="module">
|
||||||
|
import exampleDiagram from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
|
// import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
|
import mermaid from '../../packages/mermaid/src/mermaid';
|
||||||
|
|
||||||
|
await mermaid.registerExternalDiagrams([exampleDiagram]);
|
||||||
|
await mermaid.initialize({ logLevel: 0 });
|
||||||
|
await mermaid.initThrowsErrorsAsync();
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -4,7 +4,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<body>
|
<body>
|
||||||
<div id="target">
|
<div id="target">
|
||||||
<h1>This element does not belong to the SVG but we can style it</h1>
|
<h1>Background should be yellow!!!</h1>
|
||||||
</div>
|
</div>
|
||||||
<svg id="diagram"></svg>
|
<svg id="diagram"></svg>
|
||||||
|
|
||||||
@@ -21,6 +21,9 @@
|
|||||||
const diagram = document.getElementById('diagram');
|
const diagram = document.getElementById('diagram');
|
||||||
const svg = mermaid.render('diagram-svg', graph);
|
const svg = mermaid.render('diagram-svg', graph);
|
||||||
diagram.innerHTML = svg;
|
diagram.innerHTML = svg;
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -21,6 +21,9 @@
|
|||||||
const diagram = document.getElementById('diagram');
|
const diagram = document.getElementById('diagram');
|
||||||
const svg = mermaid.render('diagram-svg', graph);
|
const svg = mermaid.render('diagram-svg', graph);
|
||||||
diagram.innerHTML = svg;
|
diagram.innerHTML = svg;
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
103
cypress/platform/ghsa3.html
Normal file
103
cypress/platform/ghsa3.html
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
||||||
|
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
/* background: rgb(221, 208, 208); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>PAGE SHOULD NOT BE RED</h1>
|
||||||
|
<div class="flex">
|
||||||
|
<div id="diagram" class="mermaid"></div>
|
||||||
|
<div id="res" class=""></div>
|
||||||
|
</div>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
arrowMarkerAbsolute: true,
|
||||||
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
|
logLevel: 0,
|
||||||
|
state: {
|
||||||
|
defaultRenderer: 'dagre-wrapper',
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'dagre-wrapper',
|
||||||
|
nodeSpacing: 10,
|
||||||
|
curve: 'cardinal',
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
htmlLabels: true,
|
||||||
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
// fontFamily: '"times", sans-serif',
|
||||||
|
// fontFamily: 'courier',
|
||||||
|
fontSize: 18,
|
||||||
|
curve: 'basis',
|
||||||
|
// securityLevel: 'strict',
|
||||||
|
startOnLoad: false,
|
||||||
|
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
|
||||||
|
let diagram = '%%{init: {"flowchart": {"htmlLabels": "true"}} }%%\n';
|
||||||
|
diagram += 'flowchart\n';
|
||||||
|
diagram += 'A["<p><sty';
|
||||||
|
diagram += 'le> * { background : red}</style>test</p>"]';
|
||||||
|
|
||||||
|
console.log(diagram);
|
||||||
|
// document.querySelector('#diagram').innerHTML = diagram;
|
||||||
|
mermaid.render('diagram', diagram, (res) => {
|
||||||
|
document.querySelector('#res').innerHTML = res;
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -368,7 +368,6 @@ flowchart TD
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<!-- <script src="./mermaid.js"></script> -->
|
<!-- <script src="./mermaid.js"></script> -->
|
||||||
<script src="./mermaid-mindmap-detector.js"></script>
|
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
@@ -386,6 +385,7 @@ flowchart TD
|
|||||||
htmlLabels: false,
|
htmlLabels: false,
|
||||||
fontFamily: 'courier',
|
fontFamily: 'courier',
|
||||||
},
|
},
|
||||||
|
lazyLoadedDiagrams: ['./mermaid-mindmap-detector.js'],
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
|
@@ -29,6 +29,12 @@
|
|||||||
}
|
}
|
||||||
.mermaid svg {
|
.mermaid svg {
|
||||||
/* font-size: 18px !important; */
|
/* 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 {
|
.malware {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -48,40 +54,234 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>Security check</div>
|
<pre id="diagram" class="mermaid">
|
||||||
|
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
||||||
|
graph BT
|
||||||
|
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
|
||||||
|
</pre>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
example-diagram
|
flowchart-elk TB
|
||||||
|
a --> b
|
||||||
|
a --> c
|
||||||
|
b --> d
|
||||||
|
c --> d
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
%%{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]
|
||||||
|
|
||||||
|
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 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
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid2">
|
||||||
mindmap
|
mindmap
|
||||||
root
|
root((mindmap))
|
||||||
child1((Circle))
|
Origins
|
||||||
grandchild 1
|
Long history
|
||||||
grandchild 2
|
::icon(fa fa-book)
|
||||||
child2(Round rectangle)
|
Popularisation
|
||||||
grandchild 3
|
British popular psychology author Tony Buzan
|
||||||
grandchild 4
|
Research
|
||||||
child3[Square]
|
On effectiveness<br/>and features
|
||||||
grandchild 5
|
On Automatic creation
|
||||||
::icon(mdi mdi-fire)
|
Uses
|
||||||
gc6((grand<br/>child 6))
|
Creative techniques
|
||||||
::icon(mdi mdi-fire)
|
Strategic planning
|
||||||
gc7((grand<br/>grand<br/>child 8))
|
Argument mapping
|
||||||
</pre>
|
Tools
|
||||||
|
Pen and paper
|
||||||
|
Mermaid
|
||||||
|
</pre>
|
||||||
|
<br />
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
example-diagram
|
||||||
|
</pre>
|
||||||
|
|
||||||
<!-- <div id="cy"></div> -->
|
<!-- <div id="cy"></div> -->
|
||||||
<script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script>
|
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
||||||
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
||||||
<script src="./mermaid.js"></script>
|
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
||||||
<script>
|
<!-- <script src="./mermaid.js"></script> -->
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
|
import example from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
|
import mermaid from '../../packages/mermaid/src/mermaid';
|
||||||
|
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',
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
logLevel: 0,
|
logLevel: 5,
|
||||||
basePath: './packages/',
|
flowchart: {
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
// defaultRenderer: 'elk',
|
||||||
|
useMaxWidth: false,
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
useMaxWidth: false,
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
@@ -90,6 +290,10 @@ mindmap
|
|||||||
console.error('In parse error:');
|
console.error('In parse error:');
|
||||||
console.error(err);
|
console.error(err);
|
||||||
};
|
};
|
||||||
|
// mermaid.test1('first_slow', 1200).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('forth_slow', 1200).then((r) => console.info(r));
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,257 +1,111 @@
|
|||||||
<html>
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
<meta charset="utf-8" />
|
||||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<link
|
<title>Mindmap Mermaid Quick Test Page</title>
|
||||||
rel="stylesheet"
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
div.mermaid {
|
||||||
/* background: rgb(221, 208, 208); */
|
/* font-family: 'trebuchet ms', verdana, arial; */
|
||||||
/* background:#333; */
|
font-family: 'Courier New', Courier, monospace !important;
|
||||||
font-family: 'Courier New', Courier, monospace;
|
|
||||||
/* font-size: 18px !important; */
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
color: grey;
|
|
||||||
}
|
|
||||||
.mermaid2 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.mermaid {
|
|
||||||
border: 1px solid red;
|
|
||||||
font-family: 'Courier New', Courier, monospace;
|
|
||||||
/* font-size: 18px !important; */
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div>info below</div>
|
<h1>Mindmap diagram demo</h1>
|
||||||
<div class="">
|
<pre class="mermaid">
|
||||||
<pre class="mermaid2" style="width: 100%; height: 400px">
|
mindmap
|
||||||
flowchart TB;subgraph "number as labels";1;end;
|
root
|
||||||
</pre>
|
child1((Circle))
|
||||||
<pre class="mermaid2" style="width: 100%; height: 400px">
|
grandchild 1
|
||||||
flowchart TB;a[APA];
|
grandchild 2
|
||||||
</pre>
|
child2(Round rectangle)
|
||||||
<pre class="mermaid2" style="margin-left: 100px">
|
grandchild 3
|
||||||
graph TD
|
grandchild 4
|
||||||
work --> sleep
|
child3[Square]
|
||||||
sleep --> work
|
grandchild 5
|
||||||
eat --> sleep
|
::icon(mdi mdi-fire)
|
||||||
work --> eat
|
gc6((grand<br/>child 6))
|
||||||
</pre>
|
::icon(mdi mdi-fire)
|
||||||
<pre class="mermaid2" style="margin-left: 100px">
|
gc7((grand<br/>grand<br/>child 8))
|
||||||
flowchart TD
|
</pre>
|
||||||
work --> sleep
|
|
||||||
sleep --> work
|
|
||||||
eat --> sleep
|
|
||||||
work --> eat
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="">
|
|
||||||
graph TB
|
|
||||||
A
|
|
||||||
B
|
|
||||||
subgraph foo[Foo SubGraph]
|
|
||||||
C
|
|
||||||
D
|
|
||||||
end
|
|
||||||
subgraph bar[Bar SubGraph]
|
|
||||||
E
|
|
||||||
F
|
|
||||||
end
|
|
||||||
G
|
|
||||||
|
|
||||||
A-->B
|
<h2>Mindmap with root wrapping text and a shape</h2>
|
||||||
B-->C
|
<pre class="mermaid">
|
||||||
C-->D
|
mindmap
|
||||||
B-->D
|
root[A root with a long text that wraps to keep the node size in check]
|
||||||
D-->E
|
</pre>
|
||||||
E-->A
|
|
||||||
E-->F
|
|
||||||
F-->D
|
|
||||||
F-->G
|
|
||||||
B-->G
|
|
||||||
G-->D
|
|
||||||
|
|
||||||
style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
|
<script type="module">
|
||||||
style bar fill:#999,stroke-width:2px,stroke:#0F0,color:blue
|
// import mermaid from './mermaid.esm.mjs';
|
||||||
</pre>
|
import mermaid from '../../packages/mermaid/src/mermaid';
|
||||||
<pre class="mermaid2" style="">
|
// import mermaidMindmap from './mermaid-mindmap.esm.mjs';
|
||||||
graph TB
|
|
||||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
|
||||||
A
|
|
||||||
B
|
|
||||||
subgraph foo[Foo SubGraph]
|
|
||||||
C
|
|
||||||
D
|
|
||||||
end
|
|
||||||
subgraph bar[Bar SubGraph]
|
|
||||||
E
|
|
||||||
F
|
|
||||||
end
|
|
||||||
G
|
|
||||||
|
|
||||||
A-->B
|
// import mermaidMindmap from 'https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-mindmap@9.3.0/+esm';
|
||||||
B-->C
|
// await mermaid.registerExternalDiagrams([mermaidMindmap]);
|
||||||
C-->D
|
|
||||||
B-->D
|
|
||||||
D-->E
|
|
||||||
E-->A
|
|
||||||
E-->F
|
|
||||||
F-->D
|
|
||||||
F-->G
|
|
||||||
B-->G
|
|
||||||
G-->D
|
|
||||||
|
|
||||||
style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
|
const ALLOWED_TAGS = [
|
||||||
style bar fill:#999,stroke-width:10px,stroke:#0F0,color:blue
|
'a',
|
||||||
</pre>
|
'b',
|
||||||
<pre class="mermaid2" style="">
|
'blockquote',
|
||||||
graph TD
|
'br',
|
||||||
A[Christmas] ==> D
|
'dd',
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
'div',
|
||||||
A[Christmas] ==> C
|
'dl',
|
||||||
</pre>
|
'dt',
|
||||||
<pre class="mermaid2" style="">
|
'em',
|
||||||
graph TD
|
'foreignObject',
|
||||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
'h1',
|
||||||
A[Christmas] ==> D
|
'h2',
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
'h3',
|
||||||
A[Christmas] ==> C
|
'h4',
|
||||||
</pre>
|
'h5',
|
||||||
<pre class="mermaid2" style="">
|
'h6',
|
||||||
flowchart TD
|
'h7',
|
||||||
A[Christmas] ==> D
|
'h8',
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
'hr',
|
||||||
A[Christmas] ==> C
|
'i',
|
||||||
</pre>
|
'li',
|
||||||
<pre class="mermaid2" style="">
|
'ul',
|
||||||
flowchart TD
|
'ol',
|
||||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
'p',
|
||||||
A[Christmas] ==> D
|
'pre',
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
'span',
|
||||||
A[Christmas] ==> C
|
'strike',
|
||||||
</pre>
|
'strong',
|
||||||
<pre class="mermaid2" style="">
|
'table',
|
||||||
flowchart LR
|
'tbody',
|
||||||
a["<strong>Haiya</strong>"]---->b
|
'td',
|
||||||
</pre>
|
'tfoot',
|
||||||
<pre class="mermaid" style="">
|
'th',
|
||||||
flowchart LR
|
'thead',
|
||||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
'tr',
|
||||||
a["<strong>Haiya</strong>"]---->b
|
];
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="">
|
|
||||||
flowchart TD
|
|
||||||
A[Christmas] ==> D
|
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
|
||||||
A[Christmas] ==> C
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="">
|
|
||||||
flowchart TD
|
|
||||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
|
||||||
A[Christmas] ==> D
|
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
|
||||||
A[Christmas] ==> C
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="">
|
|
||||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
|
||||||
classDiagram-v2
|
|
||||||
Class01 <|-- AveryLongClass : Cool
|
|
||||||
<<interface>> Class01
|
|
||||||
Class03 *-- Class04
|
|
||||||
Class05 o-- Class06
|
|
||||||
Class07 .. Class08
|
|
||||||
Class09 --> C2 : Where am i?
|
|
||||||
Class09 --* C3
|
|
||||||
Class09 --|> Class07
|
|
||||||
Class12 <|.. Class08
|
|
||||||
Class11 ..>Class12
|
|
||||||
Class07 : equals()
|
|
||||||
Class07 : Object[] elementData
|
|
||||||
Class01 : size()
|
|
||||||
Class01 : int chimp
|
|
||||||
Class01 : int gorilla
|
|
||||||
Class01 : -int privateChimp
|
|
||||||
Class01 : +int publicGorilla
|
|
||||||
Class01 : #int protectedMarmoset
|
|
||||||
Class08 <--> C2: Cool label
|
|
||||||
class Class10 {
|
|
||||||
<<service>>
|
|
||||||
int id
|
|
||||||
test()
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="">
|
|
||||||
classDiagram-v2
|
|
||||||
Class01 <|-- AveryLongClass : Cool
|
|
||||||
<<interface>> Class01
|
|
||||||
Class03 *-- Class04
|
|
||||||
Class05 o-- Class06
|
|
||||||
Class07 .. Class08
|
|
||||||
Class09 --> C2 : Where am i?
|
|
||||||
Class09 --* C3
|
|
||||||
Class09 --|> Class07
|
|
||||||
Class12 <|.. Class08
|
|
||||||
Class11 ..>Class12
|
|
||||||
Class07 : equals()
|
|
||||||
Class07 : Object[] elementData
|
|
||||||
Class01 : size()
|
|
||||||
Class01 : int chimp
|
|
||||||
Class01 : int gorilla
|
|
||||||
Class01 : -int privateChimp
|
|
||||||
Class01 : +int publicGorilla
|
|
||||||
Class01 : #int protectedMarmoset
|
|
||||||
Class08 <--> C2: Cool label
|
|
||||||
class Class10 {
|
|
||||||
<<service>>
|
|
||||||
int id
|
|
||||||
test()
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid" style="">
|
|
||||||
flowchart BT
|
|
||||||
subgraph S1
|
|
||||||
sub1 -->sub2
|
|
||||||
end
|
|
||||||
subgraph S2
|
|
||||||
sub4
|
|
||||||
end
|
|
||||||
S1 --> S2
|
|
||||||
sub1 --> sub4
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'neutral',
|
theme: 'base',
|
||||||
// arrowMarkerAbsolute: true,
|
startOnLoad: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'cardinal', htmlLabels: false },
|
flowchart: {
|
||||||
// htmlLabels: true,
|
useMaxWidth: false,
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
htmlLabels: true,
|
||||||
// sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
|
},
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
gantt: {
|
||||||
// fontFamily: '"times", sans-serif',
|
useMaxWidth: false,
|
||||||
fontFamily: 'courier',
|
},
|
||||||
// fontSize: 18,
|
useMaxWidth: false,
|
||||||
// curve: 'cardinal',
|
|
||||||
securityLevel: 'loose',
|
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
}
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
mermaid.init({ startOnLoad: false });
|
mermaid.init({ startOnLoad: false });
|
||||||
|
|
||||||
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('rendering');
|
console.log('rendering');
|
||||||
mermaid.mermaidAPI.render('graphDiv', `>`);
|
mermaid.mermaidAPI.render('graphDiv', `>`);
|
||||||
|
@@ -17,9 +17,9 @@
|
|||||||
rerender('XMas');
|
rerender('XMas');
|
||||||
|
|
||||||
function rerender(text) {
|
function rerender(text) {
|
||||||
var graphText = `graph TD
|
const graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`;
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
var graph = mermaid.mermaidAPI.render('id', graphText);
|
const graph = mermaid.mermaidAPI.render('id', graphText);
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
||||||
document.getElementById('graph').innerHTML = graph;
|
document.getElementById('graph').innerHTML = graph;
|
||||||
}
|
}
|
||||||
|
283
cypress/platform/sidv.html
Normal file
283
cypress/platform/sidv.html
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
<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>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
|
||||||
|
graph TB
|
||||||
|
a --> b
|
||||||
|
a --> c
|
||||||
|
b --> d
|
||||||
|
c --> d
|
||||||
|
</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]
|
||||||
|
|
||||||
|
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">
|
||||||
|
import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
||||||
|
// 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) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
// theme: 'forest',
|
||||||
|
startOnLoad: true,
|
||||||
|
logLevel: 0,
|
||||||
|
flowchart: {
|
||||||
|
// defaultRenderer: 'elk',
|
||||||
|
useMaxWidth: false,
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
useMaxWidth: false,
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
// mermaid.test1('first_slow', 1200).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('forth_slow', 1200).then((r) => console.info(r));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -1,15 +1,23 @@
|
|||||||
import mermaid2 from '../../packages/mermaid/src/mermaid';
|
import mermaid2 from '../../packages/mermaid/src/mermaid';
|
||||||
|
import externalExample from '../../packages/mermaid-example-diagram/src/detector';
|
||||||
|
|
||||||
function b64ToUtf8(str) {
|
function b64ToUtf8(str) {
|
||||||
return decodeURIComponent(escape(window.atob(str)));
|
return decodeURIComponent(escape(window.atob(str)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adds a rendered flag to window when rendering is done, so cypress can wait for it.
|
||||||
|
function markRendered() {
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
* ##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
||||||
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
|
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
|
||||||
* page.
|
* page.
|
||||||
*/
|
*/
|
||||||
const contentLoaded = function () {
|
const contentLoaded = 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;
|
||||||
@@ -36,8 +44,10 @@ const contentLoaded = function () {
|
|||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await mermaid2.registerExternalDiagrams([externalExample]);
|
||||||
mermaid2.initialize(graphObj.mermaid);
|
mermaid2.initialize(graphObj.mermaid);
|
||||||
mermaid2.init();
|
await mermaid2.init();
|
||||||
|
markRendered();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,7 +62,7 @@ function merge(current, update) {
|
|||||||
if (
|
if (
|
||||||
current.hasOwnProperty(key) &&
|
current.hasOwnProperty(key) &&
|
||||||
typeof current[key] === 'object' &&
|
typeof current[key] === 'object' &&
|
||||||
!(current[key] instanceof Array)
|
!Array.isArray(current[key])
|
||||||
) {
|
) {
|
||||||
merge(current[key], update[key]);
|
merge(current[key], update[key]);
|
||||||
|
|
||||||
@@ -118,12 +128,15 @@ const contentLoadedApi = function () {
|
|||||||
(svgCode, bindFunctions) => {
|
(svgCode, bindFunctions) => {
|
||||||
div.innerHTML = svgCode;
|
div.innerHTML = svgCode;
|
||||||
|
|
||||||
if (bindFunctions) bindFunctions(div);
|
if (bindFunctions) {
|
||||||
|
bindFunctions(div);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
div
|
div
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
markRendered();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
@@ -138,7 +151,7 @@ if (typeof document !== 'undefined') {
|
|||||||
contentLoadedApi();
|
contentLoadedApi();
|
||||||
} else {
|
} else {
|
||||||
this.console.log('Not using api');
|
this.console.log('Not using api');
|
||||||
contentLoaded();
|
void contentLoaded();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'classDiagram\n';
|
let diagram = 'classDiagram\n';
|
||||||
diagram += 'class Square~<img/src';
|
diagram += 'class Square~<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>~{\n";
|
diagram += "='1'/onerror=xssAttack()>~{\n";
|
||||||
diagram += 'id A\n';
|
diagram += 'id A\n';
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += 's2 : This is a state description<img/src';
|
diagram += 's2 : This is a state description<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += 's2 : A<img/src';
|
diagram += 's2 : A<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += 'if_state --> False: if n < 0<img/src';
|
diagram += 'if_state --> False: if n < 0<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'classDiagram\n';
|
let diagram = 'classDiagram\n';
|
||||||
diagram += 'classA <-- classB : <ifr';
|
diagram += 'classA <-- classB : <ifr';
|
||||||
diagram += "ame/srcdoc='<scr";
|
diagram += "ame/srcdoc='<scr";
|
||||||
diagram += 'ipt>parent.xssAttack(`XSS`)</';
|
diagram += 'ipt>parent.xssAttack(`XSS`)</';
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = `sequenceDiagram
|
let diagram = `sequenceDiagram
|
||||||
participant John
|
participant John
|
||||||
links John: {"XSS": "javas`;
|
links John: {"XSS": "javas`;
|
||||||
diagram += `cript:alert('AudioParam')"}`;
|
diagram += `cript:alert('AudioParam')"}`;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user